|Syntactic Confectionery Delight|
Re: WMI query with Threadsby BrowserUk (Pope)
|on Feb 13, 2013 at 23:05 UTC||Need Help??|
the script is crashing perl with the following messsage.
Hm. Mixing up the trace output from your program with the error message (and posting it without <code></code> blocks so all the newlines get eaten by the html) makes life difficult for those of whom you are asking for help.
The actual message you are receiving is just:
And the first thing to say about that is it isn't "a crash". This is an informational message issued only when the program has ended and Perl is freeing up the memory used by the program.
Essentially, the program is finished, done and dusted, -- whether it has worked or not is a different matter -- and Perl has detected an anomaly in its usage of memory whilst cleaning up. It is telling you that you may want to look more closely at it, but it isn't actually crashing; and the program may have completely correctly despite that anomaly.
What the message is telling you is that a piece of memory that was allocated by one thread; is being freed within the context of another thread. Whilst that can cause problems within your program; the fact that it is only being detected "during global destruction" often means that it didn't prevent the program from working or completing.
Now to the possible causes of that anomaly.
The usual cause of this cross-over of memory from one thread to another is accidental closure of a thread subroutine over a variable created (explicitly or implicitly) within the main thread code. And there are two main ways for that to happen.
You also have several other variables that you haven't declared with my:
These would all be caught for you by use strict;
So, my suggestions to you are:
Then try re-running your program. The chances are that those two simple changes will make the problem 'go away', but if they do not, come back and post your modified code and we can try to help you further.
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.