Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

davehorner's scratchpad

by davehorner (Scribe)
on Nov 26, 2013 at 00:15 UTC ( [id://1064342]=scratchpad: print w/replies, xml ) Need Help??

Ever experienced frustration from hanging perl processes?
https://rt.cpan.org/Public/Bug/Display.html?id=64319

I am trying to capture calls to exit /b 1 from batch files.
I've had to go to extreme measures to capture it:
calling a batch file which just does:
CALL %*; EXIT %ERRORLEVEL%
I am setting PERL_CAPTURE_TINY_DEBUG=1, PERL_CAPTURE_TINY_TIMEOUT=1

cmd.exe /A /C "win32-catcher.bat $cmdlineargs"

$programtorun=cmd.exe
$args = " /A /C "win32-catcher.bat $cmdlineargs" (in array form, just for demo purposes)

the code to execute is passed through
my $die_occurred = eval{
my ($so,$se,$exit_code) = tee( sub { systemx(EXIT_ANY,$programtorun,$args) } ) ;
};
The programs run and I can capture the exit /b with the batch file which returns the errorlevel.... But using this combination, I find that I have two perl interpreters under my cmd.exe process. The tee in my parent perl process shows the endlocal and exit 0, letting me know that the script we are running has completed... But then I have to use system explorer to kill one of the two perl processes. which then allows the parent process to proceed as if everything went ok.


I'm reaching, and trying, just wondering if you might have any suggestions on how to attach a debugger to these hung processes or any other ideas.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-04-18 05:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found