public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Where can I look for an answer to a problem with Cygwin's Perl‏?
@ 2013-12-09 14:39 Jim Cant
  2013-12-09 16:52 ` bartels
       [not found] ` <52A5F2BC.7010506@mailme.ath.cx>
  0 siblings, 2 replies; 3+ messages in thread
From: Jim Cant @ 2013-12-09 14:39 UTC (permalink / raw)
  To: cygwin

I have a problem with Cygwin's Perl.  If a process started by Perl
(system(), `` (backticks) ) crashes, the system debugger never getsww
called so I can't get a dump.

I have submitted the problem (see
below) to this list but got no responses.  Can anyone suggest somewhere
else I might look for an answer?  Googling around the web, stackoverflow
 uncovered nothing.

Is there possibly some Cygwin configuration or installation options that might affect this issue?

Thanks in advance
Cheers,

Jim Cant


++++ Original Posting ++++
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!. 		 	   		  

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Where can I look for an answer to a problem with Cygwin's Perl‏?
  2013-12-09 14:39 Where can I look for an answer to a problem with Cygwin's Perl‏? Jim Cant
@ 2013-12-09 16:52 ` bartels
       [not found] ` <52A5F2BC.7010506@mailme.ath.cx>
  1 sibling, 0 replies; 3+ messages in thread
From: bartels @ 2013-12-09 16:52 UTC (permalink / raw)
  To: cygwin.com

On 12/09/2013 03:39 PM, Jim Cant wrote:
> I have a problem with Cygwin's Perl.  If a process started by Perl
> (system(), `` (backticks) ) crashes, the system debugger never getsww
> called so I can't get a dump.

Have you tried perl dump?
http://perldoc.perl.org/functions/dump.html

-- 
- Bartels


--
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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Where can I look for an answer to a problem with Cygwin's Perl‏?
       [not found]   ` <COL130-W2995DECECDD42A93849246E6D30@phx.gbl>
@ 2013-12-10  9:52     ` bartels
  0 siblings, 0 replies; 3+ messages in thread
From: bartels @ 2013-12-10  9:52 UTC (permalink / raw)
  To: cygwin.com

On 12/09/2013 06:54 PM, Jim Cant wrote:
> Thanks.  Unfortunately, this dump() isn't what I need.  I need to produce a dump of arbitrary program that has failed somewhere out of my 
> control in the system.  The system debugger as specified by the 'AeDebug' registry key needs to get called when the arbitrary programs fails.  
> The system debugger (which I specify in the AeDebug key) get called and passed the PID of the failed program and creates the dump I need by 
> invoking cdb.  (cdb.exe is a command line version of WInDbg
>
> My problem is the system never invoked the system debugger in cases where the arbitrary program that fails was launched by Cygwin's version of 
> perl.

I have only two suggestions:

1) please don't top post on this list

2) run gdb and see what causes perl to (not) coredump

But I cannot help wonder if the perl crash on activeperl is intentional.
Have you tried other ports? Native linux does not dump.
Why would it? Dumping any interpreter sounds like a pretty
stupid plan.

Your brother might at this very moment be logging a bug against
activeperl for that particular behaviour.

The only good approach I can think of is to re-define the backticks to
explicitely dump. That is straightforward and possibly even portable.

-- 
- Bartels


--
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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-12-10  9:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-09 14:39 Where can I look for an answer to a problem with Cygwin's Perl‏? Jim Cant
2013-12-09 16:52 ` bartels
     [not found] ` <52A5F2BC.7010506@mailme.ath.cx>
     [not found]   ` <COL130-W2995DECECDD42A93849246E6D30@phx.gbl>
2013-12-10  9:52     ` bartels

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).