qychen1982 / crashpad

Automatically exported from code.google.com/p/crashpad
0 stars 0 forks source link

MachMultiprocess.MachMultiprocess and Multiprocess.Multiprocess tests fail on Mac OS X 10.10 #17

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The MachMultiprocess.MachMultiprocess and Multiprocess.Multiprocess tests both 
fail on Mac OS X 10.10, but only when run as part of the full 
crashpad_util_test suite. When the tests are run individually, they pass.

When they fail, they produce this output:

[----------] 1 test from MachMultiprocess
[ RUN      ] MachMultiprocess.MachMultiprocess
../../../util/test/multiprocess_posix.cc:120: Failure
Failed
Child terminated by signal 11 (Segmentation fault: 11), expected exit with code 
0
[  FAILED  ] MachMultiprocess.MachMultiprocess (298 ms)
[----------] 1 test from MachMultiprocess (298 ms total)

[----------] 5 tests from Multiprocess
[ RUN      ] Multiprocess.Multiprocess
../../../util/test/multiprocess_posix.cc:120: Failure
Failed
Child terminated by signal 11 (Segmentation fault: 11), expected exit with code 
0
[  FAILED  ] Multiprocess.Multiprocess (286 ms)
[ RUN      ] Multiprocess.SuccessfulExit
[       OK ] Multiprocess.SuccessfulExit (1 ms)
[ RUN      ] Multiprocess.UnsuccessfulExit
[       OK ] Multiprocess.UnsuccessfulExit (1 ms)
[ RUN      ] Multiprocess.Exit2
[       OK ] Multiprocess.Exit2 (1 ms)
[ RUN      ] Multiprocess.AbortSignal
[       OK ] Multiprocess.AbortSignal (232 ms)
[----------] 5 tests from Multiprocess (521 ms total)

Running with --gtest_throw_on_failure, I got:

[----------] 1 test from MachMultiprocess
[ RUN      ] MachMultiprocess.MachMultiprocess
../../../util/test/multiprocess_posix.cc:120: Failure
Failed
Child terminated by signal 11 (Segmentation fault: 11), expected exit with code 
0

[ FATAL ] 
../../../third_party/gtest/gtest/include/gtest/internal/gtest-port.h:1948:: 
pthread_mutex_destroy(&mutex_)failed with error 16
Abort trap: 6

This also made it easy to examine the crash from the child that was terminated 
with SIGSEGV, in the attached ReportCrash report. The child is crashing in 
exit(), in atexit() destruction of something related to CFHTTPCookieStorage.

Multiprocess::RunChild() should be use _exit(0) instead of exit(0).

Yet again, this highlights the danger of fork()-without-exec().

Original issue reported on code.google.com by mark@chromium.org on 11 Mar 2015 at 4:46

Attachments:

GoogleCodeExporter commented 9 years ago
https://codereview.chromium.org/1000653002/

Original comment by mark@chromium.org on 11 Mar 2015 at 1:02

GoogleCodeExporter commented 9 years ago
https://chromium.googlesource.com/crashpad/crashpad/+/b8cbfff0d35ee41e9afd42ba1e
4119f4b4bd6504

Original comment by mark@chromium.org on 11 Mar 2015 at 9:08