|
From: Bart V. A. <bar...@gm...> - 2009-07-23 08:06:11
|
Hello, While trying to port DRD to Darwin I noticed that on the Mac OS X system I used several POSIX threads functions behave differently than their Linux equivalents. Please note that the results below have been obtained on an old system (kernel 9.2.0). It would be great if someone could confirm whether the results below can be reproduced on a Mac OS X system with the latest updates installed. Note: the results below have been obtained by running native executables and hence are not related to the behavior of any Valgrind tool. ** drd/tests/pth_inconsistent_cond_wait* Linux: $ drd/tests/pth_inconsistent_cond_wait (empty output, as expected) Darwin: $ drd/tests/pth_inconsistent_cond_wait drd/tests/pth_inconsistent_cond_wait pth_inconsistent_cond_wait.c:52 pthread_cond_timedwait(&s_cond, mutex, &deadline) returned error code 22 (Invalid argument) pth_inconsistent_cond_wait.c:52 pthread_cond_timedwait(&s_cond, mutex, &deadline) returned error code 60 (Operation timed out) It is not clear to me why the first call to pthread_cond_timedwait() returns EINVAL on Darwin. As far as I know EINVAL means that either the condition variable, mutex or timeout passed to pthread_cond_timedwait() is invalid ? See also http://www.opengroup.org/onlinepubs/000095399/functions/pthread_cond_timedwait.html . ** helgrind/tests/tc17_sembar* Linux: $ helgrind/tests/tc17_sembar starting done, result is 88, should be 88 (expected output) Darwin: $ helgrind/tests/tc17_sembar starting done, result is 99, should be 88 (not expected) I've also noticed that DRD reports race conditions in the drd/tests/circular_buffer test program on Darwin but not on Linux. Both the tc17_sembar and the circular_buffer test program trigger many semaphore calls. Bart. |