Comment #6 on issue 532180 by
ric...@chromium.org: nacl_loader_unittests is
broken
https://code.google.com/p/chromium/issues/detail?id=532180
This seems to also require a release build. It looks like the new sigreturn
function breaks libgcc's stack unwinding :-(
(gdb) set follow-fork-mode child
(gdb) r
Starting program:
/usr/local/google/home/rickyz/chromium2/src/out/Release/nacl_loader_unittests
--gtest_filter=NaClNonSfiSandboxSIGSYSTest._sysctl
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/grte/v4/lib64/libthread_db.so.1".
Unable to determine compiler version.
Defaulting to gdb's copy of None libstdc++ pretty-printers.
Debugger detected, switching to single process mode.
Pass --test-launcher-debug-launcher to debug the launcher itself.
Detected presence of a debugger, running without test timeouts.
Note: Google Test filter = NaClNonSfiSandboxSIGSYSTest._sysctl
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from NaClNonSfiSandboxSIGSYSTest
[ RUN ] NaClNonSfiSandboxSIGSYSTest._sysctl
[New process 10877]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/grte/v4/lib64/libthread_db.so.1".
Program received signal SIGSYS, Bad system call.
[Switching to Thread 0x7ffff7fcd780 (LWP 10877)]
syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
38 ../sysdeps/unix/sysv/linux/x86_64/syscall.S: No such file or
directory.
(gdb) c
Continuing.
Program received signal SIGSEGV, Segmentation fault.
0x0000000000563f03 in
sandbox::CrashSIGSYS_Handler(sandbox::arch_seccomp_data const&, void*) ()
(gdb) c
Continuing.
Program received signal SIGSEGV, Segmentation fault.
uw_frame_state_for (context=context@entry=0x7fffffffbb50,
fs=fs@entry=0x7fffffffbc40) at ../../../src/libgcc/unwind-dw2.c:1253
1253 ../../../src/libgcc/unwind-dw2.c: No such file or directory.
(gdb)
On solution might be to obtain glibc's signal restorer function using
something like:
struct sigaction act = {};
struct sigaction old_act;
act.sa_handler = SIG_DFL;
sigaction(SIGUSR1, &act, &old_act);
sigaction(SIGUSR1, &old_act, &act);
printf("restorer = %p\n", act.sa_restorer);
But still need to double check whether this is allowed use of libc our case.
This seems like it could affect crash reporting on seccomp failures on
release builds, btw.