Version: 3.6 SVN (using Devel) OS: Linux Despite support for mq_open (and all of mqueue.h) in Valgrind core, exp-ptrcheck does not handle mq_open, mq_unlink, etc. This is due to the way that setup_post_syscall_table explicitly adds all the syscalls to be handled. To allow programs using mq_* to work, add the following block anywhere in setup_post_syscall_table (in exp-ptrcheck/h_main.c) (I added at line 2480, at the end of the ADD(0,*) block) # if defined(__NR_mq_open) ADD(0, __NR_mq_open); ADD(0, __NR_mq_unlink); ADD(0, __NR_mq_timedsend); ADD(0, __NR_mq_timedreceive); ADD(0, __NR_mq_notify); ADD(0, __NR_mq_getsetattr); # endif As far as I understand, the leading 0 is appropriate to all the mq_ calls, as none return a pointer. Reproducible: Didn't try Steps to Reproduce: Run valgrind --tool=exp-ptrcheck on any executable that calls mq_open(). Actual Results: The tool terminates, printing sysno = 277 (in the case of mq_open) before dumping a stack trace. Expected Results: Expected to be able to test a program using mq_open and related calls. The above code-block solves the problem on my system (Linux ubuntu-df 2.6.31-22-generic #60-Ubuntu SMP Thu May 27 00:22:23 UTC 2010 i686 GNU/Linux) I think the #ifdef makes it suitably generic, but have no practical means to test that.
Committed, r11396. Thanks.