On Tue, 2012-12-18 at 21:00 +0900, ISHIKAWA,chiaki wrote:
> (2012/12/18 8:07), Philippe Waroquiers wrote:
> > Destruction of unknown cond var is probably/maybe bug
> > https://bugs.kde.org/show_bug.cgi?id=307082
> >
> I have produced a patch to take care of the issue.
> But before that, I have a question.
> 
> Q1: Why does valgrind not complain if I compile & link
> Marc's code (in the bug entry which was given as a reminder that
> "unknown cond var" may be a bug or false positive.) in the following manner,
> 
>      cc -o /tmp/a.out marc.c
No idea. Maybe a problem of redirection caused by static linking ?


> Q2: I have produced a work-in-progress patch to take care this issue.
> I wonder if the developers in the know can take a look and improve it.
> 
> The patch is posted to the bug entry
> https://bugs.kde.org/show_bug.cgi?id=307082
I took a quick look at the patch, approach looks ok to me.
No time to look more in depth at this now however :(.


> Not sure, though if it works with the initialized data as in
>     pthread_mutex_t mut = PTHREAD_MUTEX_INITIALIZER;
>     pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
I assume there is no function call for the above, so no way to
have Valgrind knowing that it is ok to destroy cond.

> 
> [Note: No it can't be obviously. This is because the mapping of cond var 
> to CVInfo structure can not be done explicitly using the timing of
> pthread_cond_init(). I tested it to confirm this observation by a slight 
> modification of marc's code.]

> 
> Q3:
>  > I have in a corner a patch for helgrind which print symbolic information
>  > for the lock addresses. Patch not finished yet.
>  >
>  > Would be worth filing a wish bug in bugzilla telling that helgrind
>  > could use --read-var-info=yes to show more info about
>  > cond var addresses, lock addresses, etc.
>  >
>  > Philippe
> 
> You mean helgrind can't use the information obtained by
> --read-var-info=yes (!?). That is tough, indeed.
helgrind uses --read-var-info=yes to report details about
address involved in race condition. It does not use it to
describe locks, cond var, etc...
For this, might be good to file a wish bug.

Philippe



------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to