renodino has asked for the wisdom of the Perl Monks concerning the following question:
My problem relates to a large scale multithreaded Perl app running on Linux (RHAS4, perl 5.8.7). (FWIW: Its sortof like a web server, but for other protocols.) After 16-20 hours of moderate use, one of the threads hangs in a 100% CPU loop. My hope was I could force a coredump, and then use a tool (like Devel::CoreStack) that could easily locate the stacks of each thread, and I could see where all the threads are executing at the coredump.
I was hoping to avoid the overhead of running with -d if possible, tho the method described by Re: Techniques for isolating bugs in perl may be one solution.
Is there a more current version of Devel::CoreStack (or equivalent) available ?
Update:
After some reflection, I think I've got a reasonable
solution derived from Devel::DProf +
IPC::ShareLite Sys::Mmap. Basically, I'll create a ring buffer in shared memory an mmap'ed file, 1 ring per thread, w/ fixed
size slots to which I store
"sprintf package::method::line timestamp"
package, sub, line number, and timestamp
in DB::DB, then use an external script to view
the ring buffers while the profiled app is running.
Is there a module that already does this ? Everything I found just saved a big buffer and dumped it to a file at exit. Assuming there isn't such a module, does anyone have any recommendations for a namespace ? Current working title is "Devel::MmapProf", but I'm thinking "Devel::STrace" may make more sense, since thats essentially what the module does - strace for perl apps.
Update 2:
Done. See Devel::STrace and Devel::STrace: strace for Perl scripts (with some seedlings) for details.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl coredump analysis tool ?
by planetscape (Chancellor) on Apr 01, 2006 at 21:11 UTC | |
|
Re: Perl coredump analysis tool ?
by hv (Prior) on Apr 01, 2006 at 19:29 UTC | |
|
Re: Perl coredump analysis tool ?
by moklevat (Priest) on Apr 01, 2006 at 21:21 UTC |