delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2013/11/14/09:01:39

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:subject:date:message-id:references
:in-reply-to:content-type:content-transfer-encoding
:mime-version; q=dns; s=default; b=d3p1ZT3m46ca1XpIRM4vnDC1OKzpi
Z3RFw9x+6MJtwCl8uk0BIic2IMjgy9OV9996qOFrkdxnRaxA1RzA84oVnLfaE04x
3xFF0Bv2f9GGmx50iIzy2+WOINVwthDAmd6Mw7wVbdO8E0W/yptOXngQ3ckoTryB
ci/62KQybtXEN4=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:subject:date:message-id:references
:in-reply-to:content-type:content-transfer-encoding
:mime-version; s=default; bh=shO1UZVqgMxWILwMpe5Bk0ttDAg=; b=vFG
5mzVeqqtIqWmPwfJxPyWOYweeQKaE4vzlMAFQ9VdReP3JFWZqQyTvn+LxQv0DyI3
k1COiI2zEC9SskoRtO7HKhh7Zjzx9pYQ8usLdBiM31K22nnB+Ob1/mu4jilkfGGh
ZOYoZt/xxDvrEm9BGS9mAKRRxHqojh/AOS+UwyMw=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=4.1 required=5.0 tests=AWL,BAYES_50,RDNS_NONE autolearn=no version=3.3.2
X-HELO: mail02.voiceboxtechnologies.com
From: Jim Cant <jimc AT voicebox DOT com>
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Subject: Can't trigger system debugger when program launched (via backticks) by Cygwin's Perl crashes
Date: Thu, 14 Nov 2013 14:01:00 +0000
Message-ID: <9B03E68568EAB74A93EB698EB537B20D0269E2F6@mail02.voiceboxtechnologies.com>
References: <wzYq642xi0000ebb4 AT col0-omc1-s10 DOT col0 DOT hotmail DOT com>,<COL125-W4257C2C2D6DE20C4630FA1E6270 AT phx DOT gbl>,<COL125-W14558F6F9E27BB86D6C667E6F80 AT phx DOT gbl> <COL125-W5236B6F87CE852B2E74E51E6F80 AT phx DOT gbl>
In-Reply-To: <COL125-W5236B6F87CE852B2E74E51E6F80@phx.gbl>
MIME-Version: 1.0
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id rAEE1ZWE006004

If a program started by Cygwin's Perl using backticks fails do to a divide-by-zero, the Windos system debugger is not called; it is called if another Perl (ActiveState) is used.

I have Perl  scripts that launch arbitrary processes using backticks. Occasionally, a crash will occur (zero divide, for example) and  I need to get a core dump for analysis when that happens.  These scripts run unattended and a core dump needs to be generated automatically.

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.  We use Cygwin's Perl on a lot of testing machines and are reluctant to change to another perl implementation.

Here's an example that uses ActiveState perl that triggers the crash handler and produces a core dump
 C:> \tools\Perl\bin\perl.exe -e "`Crasher.exe`;" 
But using Cygwin does not 
C:> \cygwin\bin\perl.exe -e "`Crasher.exe`;" 

Also, if I start Crasher.exe directly in Cygwin's shell (rather than a Windows console window), the crash handler is not called; neither is it called if started via backticks using either Cygwin or ActriveState Perl in the Cygwin shell. 

I thank you in advance for any help or suggestions!. 

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019