Hello,

I’m trying to use helgrind to debug thread race conditions in our software. 
We’re using std::thread(), std::atomic() and conditional variables.
Currently, I’m facing the following difficulties:
*  Std::thread() work fairly ok using 
http://www.valgrind.org/docs/manual/drd-manual.html#drd-manual.C++11
*  Std::thread() doen’t show thread names in valgrind output when being set by 
pthread_setname_np(handle, threadName.c_str());
    Thread names are seen in gdb-debugger though
*  Using the Client-request interface by

    ANNOTATE_THREAD_NAME(threadName_.c_str());
    std::thread::id tid=thread_.get_id();
    unsigned Valgrindid = DRD_GET_VALGRIND_THREADID;
    unsigned Helgrindid = DRD_GET_DRD_THREADID;
    std::cout << "ID: " << tid << " Valgrind_ID: " << Valgrindid << " 
Helgrind_ID: " << Helgrindid << " WT-Name: "<< threadName_ << std::endl;

    Doesn't print out good stuff. It prints the system-Thread ID, but Valgrind 
and Helgrind IDs are 0. ThreadName_ is the correct user defined name.
*  std::atomic() are treated as racy
*  conditional variables are treated as racy
*  std::future is racy ?

I'm calling the program via
     valgrind \
     --tool=helgrind \
     --log-socket=172.17.17.1 \
     -v \
    ./Application.elf

==1614== ---Thread-Announcement------------------------------------------
==1614==
==1614== Thread #21 was created
==1614==    at 0x4E016F6: clone (clone.S:56)
==1614==    by 0x486B9FB: create_thread (createthread.c:100)
==1614==    by 0x486D4E7: pthread_create@@GLIBC_2.4 (pthread_create.c:822)
==1614==    by 0x484E9F3: ??? (in 
/usr/lib/valgrind/vgpreload_helgrind-arm-linux.so)
==1614==
[...]
==1614==  Lock at 0x7D9D47BC was first observed
==1614==    at 0x484C6B0: ??? (in 
/usr/lib/valgrind/vgpreload_helgrind-arm-linux.so)
==1614==  Address 0x7d9d47bc is on thread #1's stack
==1614==
==1614==  Lock at 0x4EAD5E4 was first observed
==1614==    at 0x484C6B0: ??? (in 
/usr/lib/valgrind/vgpreload_helgrind-arm-linux.so)
==1614==  Address 0x4ead5e4 is 244 bytes inside a block of size 328 alloc'd
==1614==    at 0x4849368: operator new(unsigned int) (in 
/usr/lib/valgrind/vgpreload_helgrind-arm-linux.so)
==1614==  Block was alloc'd by thread #1
==1614==
==1614== Possible data race during read of size 4 at 0x4EB3968 by thread #1
==1614== Locks held: 1, at address 0x7D9D47BC
==1614==    at 0x17186C: _M_ptr (unique_ptr.h:147)
==1614==    by 0x17186C: get (unique_ptr.h:337)
==1614==    by 0x17186C: operator* (unique_ptr.h:323)
==1614==    by 0x17186C: wait (future:338)
==1614==    by 0x17186C: _M_get_result (future:717)
==1614==    by 0x17186C: get (future:796)

Is there any help to get this working?


Thanks,
Mario
-------------------------------------------------------------------
Röders GmbH

Sitz Soltau, Amtsgericht Lüneburg HRB 101247
Geschäftsführer: Dipl.-Ing. Jürgen Röders

Diese Nachricht und die mit ihr übermittelten Dateien sind vertraulich. Wenn 
Sie nicht der Empfänger sein sollten, für den die Nachricht bestimmt ist, bitte 
lesen oder kopieren Sie die Nachricht nicht und stellen Sie sie nicht anderen 
zur Verfügung. Bitte benachrichtigen Sie mich durch Beantwortung dieser E-Mail 
und löschen Sie sie anschließend. Vielen Dank.

This email and any files transmitted with it are confidential and intended for 
the individuals or entities named above. If you are not the intended recipient, 
please do not read, copy, use or disclose this communication to others; also 
please notify the sender by replying to this message and then delete it from 
your system. Thank you.

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

Reply via email to