[webkit-reviews] review granted: [Bug 214756] WebKit::setCrashReportApplicationSpecificInformation() should also log to WTFLogAlways() : [Attachment 405223] Patch v3

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Jul 25 08:57:02 PDT 2020


Darin Adler <darin at apple.com> has granted David Kilzer (:ddkilzer)
<ddkilzer at webkit.org>'s request for review:
Bug 214756: WebKit::setCrashReportApplicationSpecificInformation() should also
log to WTFLogAlways()
https://bugs.webkit.org/show_bug.cgi?id=214756

Attachment 405223: Patch v3

https://bugs.webkit.org/attachment.cgi?id=405223&action=review




--- Comment #12 from Darin Adler <darin at apple.com> ---
Comment on attachment 405223
  --> https://bugs.webkit.org/attachment.cgi?id=405223
Patch v3

View in context: https://bugs.webkit.org/attachment.cgi?id=405223&action=review

Change looks fine.

> Source/WebKit/Platform/IPC/cocoa/ConnectionCocoa.mm:276
> +	   WebKit::setCrashReportApplicationSpecificInformation([NSString
stringWithFormat:@"Unhandled error code %x, message '%s' (%hu)", kr,
description(message->messageName()), message->messageName()].UTF8String);

Now that we are trying to make a C string rather than an CFStringRef, we could
use WebKit string formatting instead of NSString stuff. It’s easier to use
correctly with more type safety. Something like this:

    auto name = message->messageName();
    auto string = makeString("Unhandled error code ", hex(kr, Lowercase) ",
message '", description(name), " (", name, ')');
    WebKit::setCrashReportApplicationSpecificInformation(string.utf8().data());

> Source/WebKit/Platform/IPC/cocoa/ConnectionCocoa.mm:493
> +	   WebKit::setCrashReportApplicationSpecificInformation([NSString
stringWithFormat:@"Unhandled error code %x from mach_msg, receive port is %x",
kr, machPort].UTF8String);

auto string = makeString("Unhandled error code ", hex(kr, Lowercase) ", from
mach_msg, receive port is ", hex(machPort, Lowercase));
    WebKit::setCrashReportApplicationSpecificInformation(string.utf8().data());

> Source/WebKit/Shared/Cocoa/AuxiliaryProcessCocoa.mm:37
> +    setCrashReportApplicationSpecificInformation([NSString
stringWithFormat:@"Received invalid message: '%s' (%hu)",
description(messageName), messageName].UTF8String);

auto string = makeString("Received invalid message: '",
description(messageName), "' (", messageName, ')');
    WebKit::setCrashReportApplicationSpecificInformation(string.utf8().data());

>
Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:159
> +	       setCrashReportApplicationSpecificInformation([NSString
stringWithFormat:@"WebKit framework version mismatch: %s != %s",
webKitBundleVersion.utf8().data(),
expectedBundleVersion.utf8().data()].UTF8String);

auto string = makeString("WebKit framework version mismatch: ",
webKitBundleVersion, " != ", expectedBundleVersion);
    WebKit::setCrashReportApplicationSpecificInformation(string.utf8().data());

> Tools/WebKitTestRunner/cocoa/CrashReporterInfo.mm:73
>	   String message("CRASHING TEST: ");
>	   message = message + testPath;

auto message = makeString("CRASHING TEST: ", testPath);


More information about the webkit-reviews mailing list