Bug 225818 - [WebKitTestRunner] Forward WebContent termination reason
Summary: [WebKitTestRunner] Forward WebContent termination reason
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jonathan Bedard
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-05-14 12:05 PDT by Jonathan Bedard
Modified: 2021-05-14 22:02 PDT (History)
2 users (show)

See Also:


Attachments
Patch (6.01 KB, patch)
2021-05-14 12:09 PDT, Jonathan Bedard
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (5.77 KB, patch)
2021-05-14 13:51 PDT, Jonathan Bedard
no flags Details | Formatted Diff | Diff
Patch (6.62 KB, patch)
2021-05-14 17:01 PDT, Jonathan Bedard
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Bedard 2021-05-14 12:05:38 PDT
We should print the reason a WebContent process was terminated to aid in debugging.
Comment 1 Radar WebKit Bug Importer 2021-05-14 12:05:56 PDT
<rdar://problem/78027164>
Comment 2 Jonathan Bedard 2021-05-14 12:09:18 PDT
Created attachment 428645 [details]
Patch
Comment 3 Chris Dumez 2021-05-14 13:26:44 PDT
Comment on attachment 428645 [details]
Patch

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

> Tools/WebKitTestRunner/TestController.cpp:2163
> +        fprintf(stderr, "Terminating %s (pid %ld) ", webProcessName(), static_cast<long>(pid));

Isn't this going to look confusing?
"""
Terminating WebProcess (pid: 123) because the process crashed
#CRASHED - WebProcess (pid: 123)
"""

Why are we saying we are terminating a process when the process actually crashed?

Maybe it should be something like:
fprintf(stderr, "%s terminated (pid %ld) ", webProcessName(), static_cast<long>(pid));

> Tools/WebKitTestRunner/TestController.cpp:2182
> +            return;

Note that you are not calling fflush() in this early return case even though you printed something.

> Tools/WebKitTestRunner/TestController.cpp:2185
>          fflush(stderr);

Note the call to fflush() here.
Comment 4 Jonathan Bedard 2021-05-14 13:42:23 PDT
Comment on attachment 428645 [details]
Patch

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

>> Tools/WebKitTestRunner/TestController.cpp:2163
>> +        fprintf(stderr, "Terminating %s (pid %ld) ", webProcessName(), static_cast<long>(pid));
> 
> Isn't this going to look confusing?
> """
> Terminating WebProcess (pid: 123) because the process crashed
> #CRASHED - WebProcess (pid: 123)
> """
> 
> Why are we saying we are terminating a process when the process actually crashed?
> 
> Maybe it should be something like:
> fprintf(stderr, "%s terminated (pid %ld) ", webProcessName(), static_cast<long>(pid));

The #CRASHED string will not show up in run-webkit-test's output, that's a control statement that triggers some logic in webkitpy about collecting crashes. I was trying to match the name of the API

I'm good with your phrasing, though, indicating the termination has already occurred.

>> Tools/WebKitTestRunner/TestController.cpp:2182
>> +            return;
> 
> Note that you are not calling fflush() in this early return case even though you printed something.

My rationale here is that the processDidCrash callback was not triggered in the case originally, and the whole reason we call flush is because we may call exit at the end of this function. That being said, I suppose flush can't do any harm in the early return case.
Comment 5 Jonathan Bedard 2021-05-14 13:51:45 PDT
Created attachment 428654 [details]
Patch
Comment 6 Chris Dumez 2021-05-14 13:53:00 PDT
Comment on attachment 428654 [details]
Patch

r=me
Comment 7 Jonathan Bedard 2021-05-14 17:01:14 PDT
Created attachment 428687 [details]
Patch
Comment 8 EWS 2021-05-14 22:02:14 PDT
Committed r277533 (237761@main): <https://commits.webkit.org/237761@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 428687 [details].