Jenda has asked for the wisdom of the Perl Monks concerning the following question:

I have a program using XML::Simple 1.06 to parse some files. I have XML::Parser 2.34, Perl 5.8.0 ActiveState build 805, Win2kServer, I use PDK's PerlApp to package the program into an executable.

On one server the program works fine, on another it crashes when I call the $parser->XMLIn(). Without any error messages or whatever, even though the XMLIn is in an eval{}.

Does anyone have any idea what could be wrong?

Update: the libexpat.dll is the same on both servers. I also tried to remove the doctype declaration from the XML file, still crashes.

Jenda
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
   -- Rick Osborne

Replies are listed 'Best First'.
Re: XML::Simple crashes
by borisz (Canon) on Aug 24, 2004 at 15:41 UTC
    Just a guess, are the expat libraries the same on both computers? libexpat.so on linux. libexpat.dylib for os x.
    Boris

      This is Windows so I guess you mean libexpat.dll or libexpatw.dll :-)
      Yes they are the same on both servers. I tried to delete it on the failing server and copy the files from the working one and it did not make any difference at all.</>

      Still it stops for a few seconds and exits without any messages.

      Jenda
      Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
         -- Rick Osborne

Re: XML::Simple crashes
by bart (Canon) on Aug 24, 2004 at 19:10 UTC
    Could you have another perl, or another XML DLL, of the same name, loaded at the same time? Windows tends to load the same file twice, even if you specify a full path. If they're not compatible, that might cause a crash.

      You were right. After I copied the Perl I have on my PC to the server everything started working fine.

      This is really rather silly, the EXEcutable's supposed to be selfcontained. I know I need to have the libexpat.dll outside, but that was NOT the problem. There was just one on the computer, not two different ones. Anyway, thanks, it works now.

      Jenda
      Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
         -- Rick Osborne

Re: XML::Simple crashes
by BrowserUk (Patriarch) on Aug 24, 2004 at 17:03 UTC

    You might try using a debugger (like PeBrowse or similar).

    If you put a <STDIN> near the top of the script to pause it, then use the "file->attach to process..." menu option and hit enter to let the script run on, it will often (though not always) drop you into somewhere recognisible when the trap occurs.

    Without rebuilding with the appropriate debug info, it leaves you looking at assembler, but often with enough clues from globals and stuff to track down the problem.


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
    "Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon
Re: XML::Simple crashes
by borisz (Canon) on Aug 24, 2004 at 16:17 UTC
    My next guess is that your process get a uncatched signal and die. use sigtrap; may catch that. But I have no knowlage of windows.
    Boris