in reply to Re^3: 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?

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..

Replies are listed 'Best First'.
Re^5: perl crashes parsing huge script - how to find a line that crashes it?
by syphilis (Archbishop) on Feb 19, 2008 at 12:34 UTC
    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