|
From: Saurabh T <sa...@ho...> - 2013-11-08 23:06:24
|
---------------------------------------- > Subject: Re: [Valgrind-users] Helgrind 3.9.0: false positive with pthread_mutex_destroy > From: phi...@sk... > To: sa...@ho... > CC: val...@li... > Date: Fri, 8 Nov 2013 22:46:28 +0100 > > I think this is a regression in 3.9.0 caused by revision 13642 which: > Fix #323432: When calling pthread_cond_destroy or pthread_mutex_destroy > with initializers as argument Helgrind (incorrectly) reports errors. > > The problem is that the pthread_mutex_destroy wrapper function is > comparing the mutex with PTHREAD_MUTEX_INITIALIZER to detect if mutex > was initialised using PTHREAD_MUTEX_INITIALIZER > rather than with pthread_mutex_init. Philippe, Thank you for the patch, it worked. For what it's worth, the situation that you mention cannot happen for my code. saurabh > Now, is this really a regression ? It might in fact be a feature :). > > If there is no synchronisation mechanism between a thread doing > lock/unlock and another thread calling pthread_mutex_destroy, then > if the thread doing lock/unlock is slow, the mutex could be destroyed > while it is locked (or even before the locking thread has started to > lock it. And then the locking thread might try to lock a destroyed > mutex. > > Philippe > > |