in reply to what causes a segmentation violation
What is happening with a segfault is that the CPU is trying to use an invalid address. While this can potentially have many causes, the two most common are:
Dereferencing an invalid pointer (typically a null pointer). You need to think in C rather tham perl. Buggy code that tries to dereference a null pointer results in a segfault and core dump. This doesn't happen with perl references as they maintain their own integrity. But if you are calling out to C libraries via XS, problems with the XS code or external C library could give you this behaviour.
Overwriting memory. Examples are the buffer overflow attacks one reads about in security journals. If something unexpected has been written over data structures, this may result in invalid pointers (see above), or worse, something may have overwritten code, though this may result in a different exception to segfault.
Coming back to your problem, it will almost certainly be in one of two places: external C code or perl itself. I recommend that you follow the debugging guidelines given by BrowserUK, and try and isolate the line of perl code where the segfault is happening.
Once you have this information, report a bug to http://rt.cpan.org if it's in a module's XS code, or use perlbug to report the bug if it's in perl itself.
--
wetware hacker
(Qualified NLP Practitioner and Hypnotherapist)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: what causes a segmentation violation
by fhew (Beadle) on May 14, 2007 at 13:27 UTC |