in reply to Re^2: perl crashes parsing huge script - how to find a line that crashes it?
in thread perl crashes parsing huge script - how to find a line that crashes it?

I just get standard "application has crashed and was terminated" window

I think that indicates that the program has compiled successfully - and that you're getting a segfault (ie runtime error) before any other output has been produced.

Some print "Got to here\n"; statements sprinkled throughout should help determine where the error is occurring.

Cheers,
Rob
  • Comment on Re^3: perl crashes parsing huge script - how to find a line that crashes it?
  • Download Code

Replies are listed 'Best First'.
Re^4: perl crashes parsing huge script - how to find a line that crashes it?
by Anonymous Monk on Feb 19, 2008 at 12:10 UTC
    It's a commandline script.

    It even crash perl if run with perl -c script.pl - i.e. it crashes during parsing, not during execution.

    I'll insert

    BEGIN { print STDERR "still alive at line " . __LINE__ . "\n";}
    in every 1000th line, this seems to be the best solution so far..
      It even crash perl if run with perl -c script.pl - i.e. it crashes during parsing, not during execution.

      The logic is a little dubious. With the -c switch, any code that's inside a BEGIN block gets *executed*. You're probably aware of that - it is, after all, the basis of using the BEGIN inserts you've chosen :-)

      Consider, therefore, the possibility that the segfault is caused by code that's being executed inside an existing BEGIN block (either in the script, or perhaps in one of the modules that's being loaded). It would be quite extraordinary if the error really is a parsing/compiling one.

      Good luck with it - sounds really nasty.

      Cheers,
      Rob