|Keep It Simple, Stupid|
Can't trigger system debugger to dump core when Cygwin's Perl launches program with backticksby jimcant (Initiate)
|on Sep 14, 2013 at 13:46 UTC||Need Help??|
jimcant has asked for the
wisdom of the Perl Monks concerning the following question:
I have scripts that launch arbitrary processes using backticks. Occasionally, a crash will occur (zero divide, for example) and need to get a core dump for analysis when that happens.
I have registered a perl script as crash handler with the operating system (this in Windows 7 – I knew you wanted to know) which gets called with the PID of the crash; the handler attaches Microsoft’s ‘cdb’ debugger which creates the needed dump. My test ‘crasher’ program is a C++ executable that does a divide-by-zero (Crasher.exe).
The problem: When I use Cygwin’s Perl implementation, the program crash never triggers the crash handler. My suspicion is that Perl is catching the problem and silently dropping it. All works fine with a Perl from ActiveState.
The Question: How can I get Cygwin’s Perl to get out of the way and let the error propagate all the way back to the system.
Here’s an example that uses ActiveState perl that triggers the crash handler and produces a core dump
Also, if I start Crasher.exe directly in Cygwin’s shell, the crash handler is not called; neither is it called if started via backticks in either Cygwin or ActriveState Perl.
I thank you in advance for any help or suggestions!.