Bug 27923 - run-webkit-tests should not invoke "ps" repeatedly on Mac OS X
: run-webkit-tests should not invoke "ps" repeatedly on Mac OS X
Status: RESOLVED FIXED
Product: WebKit
Classification: Unclassified
Component: Tools / Tests
: 528+ (Nightly build)
: Macintosh Intel Mac OS X 10.5
: P2 Normal
Assigned To: Mark Rowe (bdash)
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-08-01 12:46 PDT by Mark Rowe (bdash)
Modified: 2009-08-01 18:41 PDT (History)
3 users (show)

See Also:


Attachments
Patch (7.91 KB, patch)
2009-08-01 12:56 PDT, Mark Rowe (bdash)
mrowe: review-
Details | Formatted Diff | Diff
With support for Tiger (11.87 KB, patch)
2009-08-01 18:24 PDT, Mark Rowe (bdash)
ddkilzer: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Rowe (bdash) 2009-08-01 12:46:34 PDT
run-webkit-tests invokes "ps" repeatedly in an attempt to detect whether DumpRenderTree is in the process of crashing but being kept alive while ReportCrash generates a crash log.  It's invoked in a manner that spawns a subshell, which makes things even slower.
Comment 1 Mark Rowe (bdash) 2009-08-01 12:56:32 PDT
Created attachment 33939 [details]
Patch
Comment 2 Sam Weinig 2009-08-01 13:01:06 PDT
Comment on attachment 33939 [details]
Patch

Looks good, one issue below.


> +++ b/WebKitTools/DumpRenderTree/mac/PerlSupport/DumpRenderTreeSupport.c
> @@ -0,0 +1,17 @@
> +#include <sys/sysctl.h>
> +
> +int processIsCrashing(int pid)
> +{
> +    int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, pid };
> +    struct kinfo_proc info;
> +    size_t bufferSize = sizeof(info);
> +    if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), &info, &bufferSize, 0, 0)) {
> +        perror("sysctl");
> +        return 0;
> +    }
> +
> +    struct extern_proc proc = info.kp_proc;
> +
> +    // The process is crashing if it is waiting to exit, is not a zombie, and has a non-zero exit code.
> +    return proc.p_stat != SZOMB && (proc.p_flag & P_WEXIT) && proc.p_xstat;
> +}

This file needs a license.

Otherwise, r=me.
Comment 3 Mark Rowe (bdash) 2009-08-01 13:05:37 PDT
Landed in r46676.
Comment 4 Mark Rowe (bdash) 2009-08-01 13:14:04 PDT
Bah, Tiger doesn't have swig.
Comment 5 Mark Rowe (bdash) 2009-08-01 13:14:59 PDT
Rolled out in r46678.  Will have to do some thinking to find an approach that works on Tiger too.
Comment 6 Mark Rowe (bdash) 2009-08-01 18:24:10 PDT
Created attachment 33944 [details]
With support for Tiger
Comment 7 David Kilzer (:ddkilzer) 2009-08-01 18:33:48 PDT
Comment on attachment 33944 [details]
With support for Tiger

r=me
Comment 8 David Kilzer (:ddkilzer) 2009-08-01 18:35:31 PDT
(In reply to comment #7)
> (From update of attachment 33944 [details])
> r=me

WebKitTools/DumpRenderTree/mac/PerlSupport/Makefile needs a license, too.
Comment 9 Mark Rowe (bdash) 2009-08-01 18:41:15 PDT
Landed in r46682.