Hi there, Andriy Lesyuk <s-andy@in.if.ua> reported in Debian bug http://bugs.debian.org/514133 that he was hitting the VG_N_THREADS limit with his app: """ 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 'impossible' 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? """ 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,
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
Increased to 500.