----------------------------------------
> Subject: Re: [Valgrind-users] Helgrind 3.9.0: false positive with 
> pthread_mutex_destroy
> From: philippe.waroqui...@skynet.be
> To: saur...@hotmail.com
> CC: valgrind-users@lists.sourceforge.net
> 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
>
>                                         
------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to