$ ../vg-in-place --tool=none ./passsigalrm
==92191== Nulgrind, the minimal Valgrind tool
==92191== Copyright (C) 2002-2017, and GNU GPL'd, by Nicholas Nethercote.
==92191== Using Valgrind-3.17.0.GIT and LibVEX; rerun with -h for copyright info
==92191== Command: ./passsigalrm
==92191==
starting ...
==92191==
==92191== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==92191== Access not within mapped region at address 0x4
==92191== at 0x5F2D5CB: ??? (in /lib/libthr.so.3)
==92191== by 0x5F2CBB1: ??? (in /lib/libthr.so.3)
==92191== by 0x380EBDE3: ??? (in /usr/home/paulf/freebsd_valgrind/none/none-x86-freebsd)
==92191== by 0x401143: _start1 (src/lib/csu/i386/crt1_c.c:73)
==92191== by 0x401017: (below main) (crt1_s.S:49)
==92191== If you believe this happened as a result of a stack
==92191== overflow in your program's main thread (unlikely but
==92191== possible), you can try to increase the size of the
==92191== main thread stack using the --main-stacksize= flag.
==92191== The main thread stack size used in this run was 16777216.
==92191==
Segmentation fault
This only happens when the executable is linked with -lpthread
Can reproduce without vgdb
This looks like a signal sigframe issue. If I try fiddling with the stack pointer in build_sigframe then this testcase passes but ./none/tests/thread-exits fails. See issue #117 and related.
$ ../vg-in-place --tool=none ./passsigalrm ==92191== Nulgrind, the minimal Valgrind tool ==92191== Copyright (C) 2002-2017, and GNU GPL'd, by Nicholas Nethercote. ==92191== Using Valgrind-3.17.0.GIT and LibVEX; rerun with -h for copyright info ==92191== Command: ./passsigalrm ==92191== starting ... ==92191== ==92191== Process terminating with default action of signal 11 (SIGSEGV): dumping core ==92191== Access not within mapped region at address 0x4 ==92191== at 0x5F2D5CB: ??? (in /lib/libthr.so.3) ==92191== by 0x5F2CBB1: ??? (in /lib/libthr.so.3) ==92191== by 0x380EBDE3: ??? (in /usr/home/paulf/freebsd_valgrind/none/none-x86-freebsd) ==92191== by 0x401143: _start1 (src/lib/csu/i386/crt1_c.c:73) ==92191== by 0x401017: (below main) (crt1_s.S:49) ==92191== If you believe this happened as a result of a stack ==92191== overflow in your program's main thread (unlikely but ==92191== possible), you can try to increase the size of the ==92191== main thread stack using the --main-stacksize= flag. ==92191== The main thread stack size used in this run was 16777216. ==92191== Segmentation fault
This only happens when the executable is linked with -lpthread
Can reproduce without vgdb
This looks like a signal sigframe issue. If I try fiddling with the stack pointer in build_sigframe then this testcase passes but ./none/tests/thread-exits fails. See issue #117 and related.
See this thread.
https://freebsd-hackers.freebsd.narkive.com/IAqPHY7d/valgrind-on-amd64-crashes-when-delivering-signal-for-threaded-application
drd/tests/sigalrm seems to have the same issue.