Bug 206537

Summary: DLLLauncherMain print to console instead of opening window on fatal error
Product: WebKit Reporter: me
Component: New BugsAssignee: Ross Kirsling <ross.kirsling>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, bfulgham, ews-watchlist, Hironori.Fujii, keith_miller, mark.lam, msaboff, pvollan, ross.kirsling, saam, tzagallo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch none

Description me 2020-01-21 08:30:32 PST
DLLLauncherMain print to console instead of opening window on fatal error
Comment 1 me 2020-01-21 08:30:53 PST
Created attachment 388299 [details]
Patch
Comment 2 me 2020-01-21 08:37:00 PST
Created attachment 388300 [details]
Patch
Comment 3 me 2020-01-21 08:40:25 PST
Created attachment 388303 [details]
Patch
Comment 4 me 2020-01-21 08:48:52 PST
Created attachment 388304 [details]
Patch
Comment 5 me 2020-01-21 08:59:35 PST
Created attachment 388305 [details]
Patch
Comment 6 Ross Kirsling 2020-01-21 14:12:55 PST
Comment on attachment 388305 [details]
Patch

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

Nice! I hadn't thought of this approach.

Can you also apply this change to the other copy of DLLLauncherMain (which we use for all executables other than JSC shell)?
https://github.com/WebKit/webkit/blob/master/Tools/win/DLLLauncher/DLLLauncherMain.cpp

> Source/JavaScriptCore/shell/DLLLauncherMain.cpp:113
> +    fprintf(stderr, "%s %s\n", caption.c_str(), message.c_str());

Our Windows code uses wide-character strings, so let's do this:

    fwprintf(stderr, L"%s\n%s\n", caption.c_str(), message.c_str());

> Source/JavaScriptCore/shell/DLLLauncherMain.cpp:114
> +    exit(1);

This shouldn't be necessary; whatever is calling this should just exit with the returned 1.
Comment 7 Alex Christensen 2020-01-21 14:38:58 PST
Comment on attachment 388305 [details]
Patch

I like this too, but r- to address Ross's comments.
Comment 8 Ross Kirsling 2020-04-05 22:16:20 PDT
Created attachment 395544 [details]
Patch
Comment 9 EWS 2020-04-05 23:02:12 PDT
Committed r259565: <https://trac.webkit.org/changeset/259565>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 395544 [details].
Comment 10 Radar WebKit Bug Importer 2020-04-05 23:03:15 PDT
<rdar://problem/61330298>