Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Getting Qt source line numbers to display in helgrind debugging multi-threaded race conditions
Forum Update on Monday, May 27th 2025

Getting Qt source line numbers to display in helgrind debugging multi-threaded race conditions

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 499 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Daniel Williams
    wrote on 1 Feb 2019, 21:15 last edited by
    #1

    I'm learning about helgrind from David Faure's excellent Qt Developer Days presentation. The presentation was very helpful and I'm able to run helgrind properly. However, in his presentation, the helgrind output includes source code line numbers. In my helgrind output, I only see hex memory locations and line numbers from libraries.

    Note: Presentation on youtube...
    https://www.youtube.com/watch?v=N9X6AJckIG8
    And webpage with instructions...
    http://www.kdab.com/~dfaure/helgrind.html)

    I've added "QMAKE_CXXFLAGS += -g" to my .pro files, but that doesn't seem to help. Do you have any idea how to get the line numbers / debugging information into the application? The lines below show my current output sample from helgrind

    ==25445== Possible data race during read of size 4 at 0x14D2ADE0 by thread #4
    ==25445== Locks held: none
    ==25445==    at 0xD666D21: g_private_set (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
    ==25445==    by 0xD649397: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
    ==25445==    by 0x4C32D06: mythread_wrapper (hg_intercepts.c:389)
    ==25445==    by 0x88C0493: start_thread (pthread_create.c:333)
    ==25445==    by 0x945BACE: clone (clone.S:97)
    ==25445== 
    ==25445== This conflicts with a previous write of size 8 by thread #1
    ==25445== Locks held: 1, at address 0x14D0ACF0
    ==25445==    at 0x88C94FF: recv (recv.c:28)
    ==25445==    by 0x18BB8A73: ??? (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.5000.3)
    ==25445==    by 0x18B9E4AB: g_input_stream_read (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.5000.3)
    ==25445==    by 0x18B75B41: ??? (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.5000.3)
    ==25445==    by 0x18B76843: g_buffered_input_stream_fill (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.5000.3)
    ==25445==    by 0x18B7DAED: g_data_input_stream_read_line (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.5000.3)
    ==25445==    by 0x18BEC144: ??? (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.5000.3)
    ==25445==    by 0x18BECAE8: ??? (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.5000.3)
    ==25445==  Address 0x14d2ade0 is 0 bytes inside a block of size 4 alloc'd
    ==25445==    at 0x4C2CFCF: malloc (vg_replace_malloc.c:299)
    ==25445==    by 0xD666772: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
    ==25445==    by 0xD666D60: g_private_set (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
    ==25445==    by 0xD649397: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
    ==25445==    by 0x4C32D06: mythread_wrapper (hg_intercepts.c:389)
    ==25445==    by 0x88C0493: start_thread (pthread_create.c:333)
    ==25445==    by 0x945BACE: clone (clone.S:97)
    ==25445==  Block was alloc'd by thread #3
    
    
    1 Reply Last reply
    0
    • C Offline
      C Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 1 Feb 2019, 21:17 last edited by
      #2

      Those warnings are neither from Qt nor from your source code.
      If you want line number you have to install the corresponding debug-packages for e.g libgio, libglib etc. in your case.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      D 1 Reply Last reply 2 Feb 2019, 22:14
      4
      • C Christian Ehrlicher
        1 Feb 2019, 21:17

        Those warnings are neither from Qt nor from your source code.
        If you want line number you have to install the corresponding debug-packages for e.g libgio, libglib etc. in your case.

        D Offline
        D Offline
        Daniel Williams
        wrote on 2 Feb 2019, 22:14 last edited by
        #3

        @Christian-Ehrlicher Thank you.

        1 Reply Last reply
        0

        2/3

        1 Feb 2019, 21:17

        • Login

        • Login or register to search.
        2 out of 3
        • First post
          2/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved