Welcome to the Monastery | |
PerlMonks |
Debugging tips for segmentation faults?by Tanktalus (Canon) |
on Jul 12, 2005 at 21:43 UTC ( [id://474400]=perlquestion: print w/replies, xml ) | Need Help?? |
Tanktalus has asked for the wisdom of the Perl Monks concerning the following question: Does anyone have some general tips for debugging segmentation faults that they'd like to share? Most of the time, perl -d is sufficient for debugging, but here, since the debugger and debuggee are in the same process, that segmentation fault kinda brings both down at the same time. And my manager is kinda finicky that we don't check in anything that causes a segmentation fault :-) I'm trying to narrow it down, but as I said, I can usually use perl -d, so I can much more easily get stack traces at warnings and the like, so I don't have nearly the experience at dealing with these as I'd like. I'm sure I'm doing something wrong, but I must be doing it wrong in such a way that the perl virtual machine gets really confused... Update: And it doesn't help that the program hangs on filesystem calls every once in a while... (e.g., we have a driver that runs over NFS which has proved less than perfectly reliable on Linux where I'm testing this... as if NFS wasn't unreliable enough...) Update 2: I should have said so at the beginning, but Anonymonk is reminding me so I'll say that I've had similar experiences moving from perl 5.6.1 to perl 5.8.0 solving a number of problems I had integrating XML::Twig into this same project (that requirement then went away). So I'm now testing/developing/going into production with perl 5.8.6. It took us nearly a year to get them to upgrade to 5.8.6, I'm not going to be able to convince them to move up again for at least another year, possibly two. However, I'm pretty convinced that I should be able to work around this segfault as this section of code was working just two weeks ago (last time I tested it), so I must have done something to twist perl's understanding of what to do. Further, to hv's comment, I don't get core. I'm running as root. And my code won't work without root privileges. :-) But compiling a debugging perl may be an option. Thanks.
Back to
Seekers of Perl Wisdom
|
|