Changeset 294809 in webkit


Ignore:
Timestamp:
May 25, 2022 11:01:30 AM (2 years ago)
Author:
pvollan@apple.com
Message:

Add logging related to Mach bootstrap enablement
https://bugs.webkit.org/show_bug.cgi?id=240909

Reviewed by Chris Dumez.

We are seeing telemetry that indicates that enabling Mach bootstrap is failing in some cases.
Add logging to help diagnose this.

  • Source/WebKit/Platform/Logging.h:
  • Source/WebKit/Shared/Cocoa/SandboxExtensionCocoa.mm:

(WebKit::SandboxExtension::createHandleForMachLookup):

  • Source/WebKit/Shared/Cocoa/SandboxExtensionCocoa.mm:

(WebKit::SandboxExtension::createHandleForMachLookup):

Canonical link: https://commits.webkit.org/250963@main

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/Platform/Logging.h

    r290085 r294809  
    9494    M(Resize) \
    9595    M(ResourceLoadStatistics) \
     96    M(Sandbox) \
    9697    M(ScrollAnimations) \
    9798    M(Scrolling) \
  • trunk/Source/WebKit/Shared/Cocoa/SandboxExtensionCocoa.mm

    r293595 r294809  
    3333#import "Decoder.h"
    3434#import "Encoder.h"
     35#import "Logging.h"
    3536#import "WebCoreArgumentCoders.h"
    3637#import <string.h>
     
    338339    // Unblocking launchd is done by enabling a sandbox state variable.
    339340    // In the initial version of this change, Mach bootstrap'ing is enabled unconditionally.
    340     if (auditToken)
    341         sandbox_enable_state_flag(ENABLE_MACH_BOOTSTRAP, *auditToken);
     341    if (auditToken) {
     342        if (!sandbox_enable_state_flag(ENABLE_MACH_BOOTSTRAP, *auditToken))
     343            RELEASE_LOG_FAULT(Sandbox, "Could not enable Mach bootstrap, errno = %d.", errno);
     344    } else if (machBootstrapOptions == MachBootstrapOptions::EnableMachBootstrap)
     345        RELEASE_LOG_FAULT(Sandbox, "Could not enable Mach bootstrap, no audit token provided.");
    342346#endif
    343347
Note: See TracChangeset for help on using the changeset viewer.