in reply to segmentation violations

Well, if you don't know at all where the segmentation violation is happening, you could always try running the program in a debugger. For instance, with gdb or with valgrind. But that will require some knowledge of perl to make sense of the output.

There are some known cases of segmentation violation in Perl. Out of memory, and compilation of syntactically unvalid regexes are two things I know. But there can be a million unknown cases. Unless you can isolate the problem to a small piece of code, there isn't much we can do.

Of course, one of the things you can do is to see whether you get the segmentation violation with 5.6.1 or 5.8.0. If not, then the problem was already solved.

Abigail

Replies are listed 'Best First'.
Re: Re: segmentation violations
by Phomer (Novice) on Sep 11, 2003 at 19:50 UTC
    Thanks for the reply.

    I'll put the code through gdb. I've had limited experience with the perl source, as I did managed to get a Perl 4 version running on VMS many years ago.

    I'd forgetton about 'out of memory' as a cause, I will definitely look into that. Its also really helpful to know that regexes can cause problems as well, although in this case I would think the segmentation violation would be 'repeatable'.

    Unfortunately, the smaller/shorter versions of the code all work correctly. If I re-run the code when the underlying data is exactly identical the segmentation violation is repeatable, but any type of change to the code or the input causes it to significantly move to earlier or later parts of the code.

    The code is portable, I've run it on ActiveState's 5.6.1 for NT, and it worked correctly. That's one of the reasons why I think its compiled code that sits inside of one of the modules, but that could also imply that the problem is with 5.6.0. I use a large number of Perl modules, Storable being one, and an older version (2.x) of Berkeley DB.I haven't had any problems with the shorter smaller versions, its only whe it all comes together and runs for a long period of time.

    Thanks.
      I checked memory and its appears the script is just slightly over 11Mbs when it dies (which for my machine is very small). I am actually surprised to see the usage so low. Similar scripts that I've written for the same problem often exceed 40Mbs.

      I can't shorted the code and get the segmentation violation but I've found a set of data (and circumstances) that causes the crash to occur about 10 mins.