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

No error message from perl. I just get standard "application has crashed and was terminated" window.
  • Comment on Re^2: perl crashes parsing huge script - how to find a line that crashes it?

Replies are listed 'Best First'.
Re^3: perl crashes parsing huge script - how to find a line that crashes it?
by syphilis (Archbishop) on Feb 19, 2008 at 10:43 UTC
    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
      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
Re^3: perl crashes parsing huge script - how to find a line that crashes it?
by stiller (Friar) on Feb 19, 2008 at 11:42 UTC
    Is this some gui-application, or a commandline program started by clicking an icon? Anyway, try to start it from a Dos command shell, i.e. Start->Run->cmd
    look at the properties for the shortcut and cd to the right drive / directory accordingly. Starting from a commandline will leave you at the commandline with the possibility that you get some more information when it chrashes.
    hth