On Mon, 2012-06-25 at 11:03 +0200, Julian Seward wrote: > > Is there any eay how to 'iterate' over all the current threads (let us > > say that we know their thread id's - we do) and print their stack > > traces? That would help us a lot. > > One hack that might be worth a try is this. Your SIGTERM is sent by > the kernel first to Valgrind, which then sends it onwards to the app. > It's easier if you deal with it on the Valgrind side, before it gets > forwarded to the app. > > In coregrind/m_signals.c there is async_signalhandler(). In there, > add a test for sigNo==15 (sigterm) and if so make a call to > VG_(show_sched_status), which is in m_libcassert.c. This shows the > stacks for all threads, which is what you want. If you use Valgrind version >= 3.7.0, you can also print the list of threads and their stack traces from a shell command line, using: vgdb v.info scheduler
You need to activate the Valgrind gdbserver for that, using options --vgdb=yes (and possible give --vgdb-prefix=.... to point at a file system supporting FIFOs). Philippe ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Valgrind-users mailing list Valgrind-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-users