Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Perl hangs when leaving the program

by kurre_vaxholm (Acolyte)
on May 09, 2007 at 13:49 UTC ( [id://614390] : perlquestion . print w/replies, xml ) Need Help??

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

I have a really annoying problem. I am about to transafer a system with alot of perl code, from one maschine to another, and I have problems with one of the programs (I did not wrote it). This is what happens:
1. I start the interface in debug mode.
2. I step through every row and it is all fine.
3. The program terminates and leave the perl debugger in the mode were it say's "q to quit and R to restart……."
4. I press q and nothing happens. In top perl goes from 6% usage to 45% in a sec, and it stays like that.
When I do step 1-3 but I press R in 4. Then the interface just restarts and executes again. If I execute step 1-3 press R and quit at the first row perl leaves as it should


Replies are listed 'Best First'.
Re: Perl hangs when leaving the program
by Fletch (Bishop) on May 09, 2007 at 14:42 UTC

    Guess what? No one here writed^Hwrote it either, and without a sample of the code in question all you're going to get is vague guesses as to what the problem is. Perhaps it's using a module which has a buggy destructor. Perhaps it's trying to surreptitiously upload the entire contents of your drive to flickr. Nobody here knows or could know (the troubles you've seen . . . erhm, sorry). Cut it down to the simplest possible code that exhibits the problem, or at the least give a more detailed outline of what it's doing (modules it's using, descriptions of how it's using them) than the vague one you've given above.

    Now having said that, you might try running (OS allowing) something like strace or ktrace and see what system calls it's making under the hood; that may give you a window into what the underlying OS actions it's doing are and point to where the problem lies. But that's just a vague guess.

      Hi there, sorry for the "fuzzy" question, but I have never seen Perl behave like that, meaning going bezerk when leaving the perl interpretor.
      Thanks for the tip concerning buggy destructor's etc... now I at least can start to have a look where it goes wrong. The reason why I did not post any code is that the program is build up of 10 modules a different vendor wrote, approx 5000 lines of code with global vars, dozens of hash pointers, and since it crashes, leaveing the perl interpretor, well it is hard to find the snippet of code that makes perl hang.
      Now at least I have somthing to work with, but it also seems to be a bug in the perl interpretor, it shall not hang/infinite loop, when doing garbage collection.
Re: Perl hangs when leaving the program
by cengineer (Pilgrim) on May 09, 2007 at 14:01 UTC
    Can you post some code? Without that, it's kind of hard to figure out what's going on..