On Wednesday 30 March 2016 11:28:27 Ivo Raisr wrote:
> 2016-03-30 10:59 GMT+02:00 David Faure <fa...@kde.org>:
> 
> > This simple testcase :
> >
> > int foo() {
> >     struct Foo {
> >         int *i;
> >         Foo() {  i = new int(42); }
> >     };
> >     static Foo f;
> >     return *(f.i);
> > }
> >
> > called from two threads (
> > http://www.davidfaure.fr/2016/testcase_ogoffart.cpp)
> > leads to this race warning in helgrind :
> >
> 
> I've done some googling for you:
> http://stackoverflow.com/questions/8393777/current-state-of-drd-and-helgrind-support-for-stdthread
> https://gcc.gnu.org/onlinedocs/libstdc++/manual/debug.html (search for
> "Data Race Hunting")

The #defines in these pages don't help, helgrind shows the same race.
They seem to be about atomic usage in templates defined by libstdc++ (which
doesn't seem to be the case for __cxa_guard_acquire).

> http://stackoverflow.com/questions/19128549/force-use-of-locks-inside-stdatomic-during-debugging-with-libstdc

Basically says there is no solution.

> There could be other articles, for sure.
> If you find Valgrind documentation [1] not sufficient, please file bugs [2]
> and suggest solutions. Patches are welcome!
> [1] http://valgrind.org/docs/manual/manual.html

Hmm I see nothing in there about static variables indeed.
(Qt5 is missing too).

Thanks.

-- 
David Faure, fa...@kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5


------------------------------------------------------------------------------
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to