Bug 426144 - DRD reports "condition variable has not been initialized" when spawning pthread threads
Summary: DRD reports "condition variable has not been initialized" when spawning pthre...
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: drd (show other bugs)
Version: 3.15 SVN
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Bart Van Assche
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-03 13:29 UTC by igor.chorazewicz
Modified: 2020-10-20 20:47 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description igor.chorazewicz 2020-09-03 13:29:43 UTC
SUMMARY
Several libpmemobj-cpp (https://github.com/pmem/libpmemobj-cpp) tests fail under drd with a following message:

411: ==3074519== Thread 2:
411: ==3074519== condition variable has not been initialized: cond 0x1fff000298
411: ==3074519==    at 0x4847048: pthread_cond_signal_intercept (drd_pthread_intercepts.c:1148)
411: ==3074519==    by 0x4847048: pthread_cond_signal@* (drd_pthread_intercepts.c:1161)
411: ==3074519==    by 0x48401CD: vgDrd_sema_up (drd_pthread_intercepts.c:297)
411: ==3074519==    by 0x48401CD: vgDrd_thread_wrapper (drd_pthread_intercepts.c:447)
411: ==3074519==    by 0x48B83F8: start_thread (in /usr/lib64/libpthread-2.32.9000.so)
411: ==3074519==    by 0x4BF8B42: clone (in /usr/lib64/libc-2.32.9000.so)

This error occurs even in tests which do not use conditional variable (only spawn some number of threads). It would seem that DRD reports an error on it's own conditional variable (?).

STEPS TO REPRODUCE (I was not able to provide a simple, standalone reproduction)
1. Run libpmemobj-cpp test suite (drd tests). Tests which are known to fail:
enumerable_thread_specific_iterators_0_drd, enumerable_thread_specific_size_0_drd, enumerable_thread_specific_access_0_drd

OBSERVED RESULT
Tests fail randomly, with an error message provided above.

EXPECTED RESULT
No errors.

SOFTWARE/OS VERSIONS
The error was found on fedora-33 and fedora-rawhide with valgrind-3.15.0 and valgrind-3.16.1

ADDITIONAL INFORMATION
Log from a failed build: https://kojipkgs.fedoraproject.org//work/tasks/5285/50625285/build.log
Comment 1 igor.chorazewicz 2020-09-15 09:46:19 UTC
Could you tell from the message I attached if this is indeed a problem within drd?
Comment 2 Bart Van Assche 2020-09-16 02:17:23 UTC
Maybe a new version of pthread_cond_init has been added in the Fedora 33 glibc library. I will take a look.
Comment 3 Bart Van Assche 2020-09-19 15:51:32 UTC
Does commit 15330adf7c24 ("drd: Port to Fedora 33") fix this bug?
Comment 4 igor.chorazewicz 2020-09-21 11:40:39 UTC
Yes, it seems the issue is solved. Thanks!