<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>444487</bug_id>
          
          <creation_ts>2021-10-27 14:13:36 +0000</creation_ts>
          <short_desc>hginfo test detects an extra lock inside data symbol &quot;_rtld_local&quot;</short_desc>
          <delta_ts>2023-04-20 10:48:25 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>6</classification_id>
          <classification>Developer tools</classification>
          <product>valgrind</product>
          <component>helgrind</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mark Wielaard">mark</reporter>
          <assigned_to name="Julian Seward">jseward</assigned_to>
          <cc>philippe.waroquiers</cc>
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2072682</commentid>
    <comment_count>0</comment_count>
    <who name="Mark Wielaard">mark</who>
    <bug_when>2021-10-27 14:13:36 +0000</bug_when>
    <thetext>This is with valgrind 3.18.1 and glibc 2.34:

gdbserver_tests/hginfo/stderrB.diff:

  Lock ga 0x........ {
   Address 0x........ is 2440 bytes inside data symbol &quot;_rtld_local&quot;
     kind   mbRec
  }</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2223754</commentid>
    <comment_count>1</comment_count>
    <who name="Mark Wielaard">mark</who>
    <bug_when>2023-04-19 12:16:46 +0000</bug_when>
    <thetext>This comes from pthread_create:

(gdb) monitor accesshistory 0x4035a58
==30485== ---Thread-Announcement------------------------------------------
==30485== 
==30485== Thread #1 is the program&apos;s root thread
==30485== 
==30485== ---Thread-Announcement------------------------------------------
==30485== 
==30485== Thread #1 is the program&apos;s root thread
==30485== 
read of size 4 at 0x4035A58 by thread #1 tid 1
==30485== Locks held: none
==30485==    at 0x48FFC72: lll_mutex_unlock_optimized (pthread_mutex_unlock.c:43)
==30485==    by 0x48FFC72: __pthread_mutex_unlock_usercnt (pthread_mutex_unlock.c:68)
==30485==    by 0x484BD2C: mutex_unlock_WRK (hg_intercepts.c:1182)
==30485==    by 0x484FF3E: pthread_mutex_unlock (hg_intercepts.c:1200)
==30485==    by 0x4011CDD: _dl_allocate_tls_init (dl-tls.c:620)
==30485==    by 0x48FBCFE: allocate_stack (allocatestack.c:423)
==30485==    by 0x48FBCFE: pthread_create@@GLIBC_2.34 (pthread_create.c:650)
==30485==    by 0x484E5D4: pthread_create_WRK (hg_intercepts.c:445)
==30485==    by 0x484FAF5: pthread_create@* (hg_intercepts.c:478)
==30485==    by 0x40125D: main (hg01_all_ok.c:41)

So I propose to run the test with --ignore-thread-creation=yes

diff --git a/gdbserver_tests/hginfo.vgtest b/gdbserver_tests/hginfo.vgtest
index 5d00e1e21..0ea8ab4b3 100644
--- a/gdbserver_tests/hginfo.vgtest
+++ b/gdbserver_tests/hginfo.vgtest
@@ -1,7 +1,7 @@
 # test helgrind monitor command
 # test &apos;v.info location&apos; monitor command
 prog: ../helgrind/tests/hg01_all_ok
-vgopts: --tool=helgrind --vgdb=yes --vgdb-error=0 --vgdb-prefix=./vgdb-prefix-hginfo -q 
+vgopts: --tool=helgrind  --ignore-thread-creation=yes --vgdb=yes --vgdb-error=0 --vgdb-prefix=./vgdb-prefix-hginfo -q 
 prereq: test -e gdb.eval
 stdout_filter: filter_make_empty
 stderr_filter: filter_stderr

$ perl tests/vg_regtest gdbserver_tests/hginfo.vgtest 
hginfo:          valgrind   --tool=helgrind  --ignore-thread-creation=yes --vgdb=yes --vgdb-error=0 --vgdb-prefix=./vgdb-prefix-hginfo -q  ./../helgrind/tests/hg01_all_ok  (progB: ./gdb --quiet -l 60 --nx ../helgrind/tests/hg01_all_ok)

== 1 test, 0 stderr failures, 0 stdout failures, 0 stderrB failures, 0 stdoutB failures, 0 post failures ==</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2223969</commentid>
    <comment_count>2</comment_count>
    <who name="Mark Wielaard">mark</who>
    <bug_when>2023-04-20 10:48:25 +0000</bug_when>
    <thetext>commit 6effd73e9071efde14cf55c6b04c1217cc4c8515
Author: Mark Wielaard &lt;mark@klomp.org&gt;
Date:   Wed Apr 19 15:53:53 2023 +0200

    gdbserver_tests/hginfo.vgtest: Use --ignore-thread-creation=yes
    
    The testcase might notice an extra lock created by pthread_create.
    
    https://bugs.kde.org/show_bug.cgi?id=444487</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>