Bug 201216

Summary: Valgrind does not support pthread_sigmask() on OS X
Product: [Developer tools] valgrind Reporter: Alexander Potapenko <glider>
Component: generalAssignee: Rhys Kidd <rhyskidd>
Status: RESOLVED FIXED    
Severity: normal CC: bart.vanassche+kde, gkodinov, j.lopez.r, njn, rhyskidd
Priority: NOR    
Version: 3.10 SVN   
Target Milestone: ---   
Platform: Unlisted Binaries   
OS: macOS   
Latest Commit: Version Fixed In:
Attachments: Proposed patch

Description Alexander Potapenko 2009-07-23 13:33:38 UTC
To reproduce the bug:
  gcc none/tests/pth_blockedsig.c -o pth_blockedsig
  valgrind ./pth_blockedsig

UNKNOWN __pthread_sigmask is unsupported. This warning will not be repeated.
thread CHILD sending SIGUSR1 to thread MAIN
SHOULD NOT BE HERE (SIGUSR1)!!!!
==66545== 

, while a native run produces the following output:
glider$ ./pth_blockedsig 
thread CHILD sending SIGUSR1 to thread MAIN

Nullgrind behaves the same way on this test.
Comment 1 Georgi Kodinov 2011-01-26 16:09:46 UTC
This is what's currently preventing mysqld from running under valgrind on MacOSX 10.6
Comment 2 Rhys Kidd 2015-06-07 05:07:47 UTC
This can be reliably reproduced with the below commands:

$ make check
$ perl tests/vg_regtest memcheck/tests/thread_alloca none/tests/pth_blockedsig
thread_alloca:   valgrind   -q --trace-children=yes ./thread_alloca 30 
sh: line 1: 77175 Illegal instruction: 4  VALGRIND_LIB=/Users/rhyskidd/Documents/Coding/valgrind/trunk/.in_place VALGRIND_LIB_INNER=/Users/rhyskidd/Documents/Coding/valgrind/trunk/.in_place /Users/rhyskidd/Documents/Coding/valgrind/trunk/./coregrind/valgrind --command-line-only=yes --memcheck:leak-check=no --tool=memcheck -q --trace-children=yes ./thread_alloca 30 > thread_alloca.stdout.out 2> thread_alloca.stderr.out
*** thread_alloca failed (stderr) ***
pth_blockedsig:  valgrind   ./pth_blockedsig 
*** pth_blockedsig failed (stderr) ***

== 2 tests, 2 stderr failures, 0 stdout failures, 0 stderrB failures, 0 stdoutB failures, 0 post failures ==
memcheck/tests/thread_alloca             (stderr)
none/tests/pth_blockedsig                (stderr)
Comment 3 Rhys Kidd 2015-07-11 08:44:03 UTC
Created attachment 93559 [details]
Proposed patch
Comment 4 Rhys Kidd 2015-07-12 07:07:45 UTC
Resolved with r15410.