WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
39959
exitStatus() returns 0 when child process crashes due to missing symbol in dylib
https://bugs.webkit.org/show_bug.cgi?id=39959
Summary
exitStatus() returns 0 when child process crashes due to missing symbol in dylib
David Kilzer (:ddkilzer)
Reported
2010-05-31 09:35:11 PDT
* SUMMARY When an app crashes on Mac OS X 10.6 due to a missing symbol in a dylib (for example, testapi in run-javascriptcore-tests), the exitStatus() method in webkitdirs.pm returns 0 (zero) because the value passed in is 5. This happens because WEXITSTATUS() does an 8-bit right shift of the value passed to it, which causes 5 to become 0. Normally the 8-bit shift is the correct action since the exit status of the child process is stored in the upper 8 bits of $?. However, when an app crashes due to a missing symbol in a dylib, $? is set to 5 and there is no child exit status. Unfortunately, I haven't found any Perl man pages that fully describe what the lower 8 bits of $? are ("man perlvar" describes some, but not all, of the lower bits), so it's not clear how best to fix this. Changing every place that calls exitStatus() to also check $? seems burdensome. It would be nice if exitStatus() would always return a non-zero value if a non-zero value was passed in, even if it was less than 256. I'm not sure if that would break other platforms, though.
Attachments
Add attachment
proposed patch, testcase, etc.
Mark Rowe (bdash)
Comment 1
2010-06-18 15:14:46 PDT
Some bits of $? represent the manner in which the process exited, which can be queried using WIFEXITED / WIFSIGNALED / WIFSTOPPED/. Depending on the values of those macros you can use one of the following to learn more: WEXITSTATUS / WTERMSIG / WCOREDUMP / WSTOPSIG. I’m not entirely sure what the combination of flags will be when an application fails to launch due to missing symbols, but I suspect it’s detectable via some combination of the above. It may just be a matter of ensuring that WIFEXITED is true.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug