in reply to Re: Hard to Debug windows memory error
in thread Hard to Debug windows memory error

The very last line of my script is a print statement that does print under several tested environments.

I suspect the problem is in the perl garbage collection. The difficulty is the module I'm writing using the script is is complex and multi-layered. I was hoping to get some debugging advice/techniques that I could use so that I could narrow it down to a simple script that reliably fails.

  • Comment on Re^2: Hard to Debug windows memory error

Replies are listed 'Best First'.
Re^3: Hard to Debug windows memory error
by kennethk (Abbot) on Dec 31, 2015 at 20:24 UTC
    Try putting some print statements in END blocks: BEGIN, UNITCHECK, CHECK, INIT and END in perlmod

    That might help you debug the unwind. You can also create some objects with controlled scope and put diagnostics in their Destructors.


    #11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

      kennethk thank you for your suggestion. I did already try BEGIN blocks but I had forgotten to try END blocks. When retesting a simple print statement in an END block didn't even execute. I interpret that to mean that windows killed the general perl interpreter prior to reaching the END block. I hope I read that right.

        I'd modify your statement to say Windows killed the general perl interpreter prior to reaching that END block. The previously provided link shows order of execution of END blocks. See what happens when you put your END block right before the end of your master script. You may still be able to track down the problem via bisection. An object at the package level of your problematic module may also yield useful information via its DESTROY.

        #11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.