<?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>227328</bug_id>
          
          <creation_ts>2010-02-17 10:10:49 +0000</creation_ts>
          <short_desc>Please increase VG_N_THREADS slightly</short_desc>
          <delta_ts>2010-02-22 11:31:26 +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>general</component>
          <version>3.6 SVN</version>
          <rep_platform>Unlisted Binaries</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>0</everconfirmed>
          <reporter name="lool@dooz.org">lool</reporter>
          <assigned_to name="Julian Seward">jseward</assigned_to>
          <cc>konstantin.s.serebryany</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>918871</commentid>
    <comment_count>0</comment_count>
    <who name="lool@dooz.org">lool</who>
    <bug_when>2010-02-17 10:10:49 +0000</bug_when>
    <thetext>Hi there,

Andriy Lesyuk &lt;s-andy@in.if.ua&gt; reported in Debian bug http://bugs.debian.org/514133 that he was hitting the VG_N_THREADS limit with his app:
&quot;&quot;&quot;
Having an application running more than 300 threads. Sometimes (not
always for some reason) when running in valgrind I get:

vg_alloc_ThreadState: no free slots available
Increase VG_N_THREADS, rebuild and try again.

valgrind: the &apos;impossible&apos; happened:
   VG_N_THREADS is too low
==28559==    at 0x3801A41D: report_and_quit (m_libcassert.c:140)
==28559==    by 0x3801A52B: panic (m_libcassert.c:210)
==28559==    by 0x3801A5C2: vgPlain_core_panic_at (m_libcassert.c:215)
==28559==    by 0x3801A600: vgPlain_core_panic (m_libcassert.c:220)
==28559==    by 0x38036F33: vgPlain_alloc_ThreadState (scheduler.c:187)
==28559==    by 0x38078E0A: vgSysWrap_x86_linux_sys_clone_before
(syswrap-x86-linux.c:212)
==28559==    by 0x3803A600: vgPlain_client_syscall (syswrap-main.c:850)
==28559==    by 0x38037768: handle_syscall (scheduler.c:790)
==28559==    by 0x380386FE: vgPlain_scheduler (scheduler.c:984)
==28559==    by 0x3804D2D8: run_a_thread_NORETURN (syswrap-linux.c:89)
==28559==    by 0x3804D5A2: vgModuleLocal_start_thread_NORETURN
(syswrap-linux.c:212)
==28559==    by 0x38074D58: (within /usr/lib/valgrind/x86-linux/memcheck)
==28559==    by 0xA12FEFFE: ???
==28559==    by 0xA12ECFFF: ???
==28559==    by 0x734: ???

sched status:
  running_tid=3

It stopped on thread 299 :)

Can VG_N_THREADS be a little bit increased?
&quot;&quot;&quot;

Would you mind bumping it from 300 to 500 upstream?  Ideally, having that adjusted dynamically, or as a runtime override, or as a configure flag would be fine!

Thanks,</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>918877</commentid>
    <comment_count>1</comment_count>
    <who name="Konstantin Serebryany">konstantin.s.serebryany</who>
    <bug_when>2010-02-17 10:19:22 +0000</bug_when>
    <thetext>In our custom build of valgrind this limit is set to 5000. 
To compare: in PIN this limit is 2048, which is sometimes not enough for us! 

We also had to raise few other limits: see http://code.google.com/p/data-race-test/source/browse/trunk/valgrind_patches/limits.patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>922362</commentid>
    <comment_count>2</comment_count>
    <who name="Julian Seward">jseward</who>
    <bug_when>2010-02-22 11:31:26 +0000</bug_when>
    <thetext>Increased to 500.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>