public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* How to trap crash or exit in Windows?
@ 2017-04-15  4:33 Daniel Santos
  0 siblings, 0 replies; only message in thread
From: Daniel Santos @ 2017-04-15  4:33 UTC (permalink / raw)
  To: cygwin

I'm hacking expect to try to solve its "broken pipe" problem, but I 
haven't done any serious windows programming/debugging in over 10 
years.  I want to be able to set some type of "trap" after a fork (on 
the child) and then disable it before it calls execvp to catch any 
crashes or normal program exit in between those two points, how can I do 
this on Windows / Cygwin?  Does sigaction work in Cygwin with SIGILL, 
SIGSEGV, et. al.?  I haven't had an atexit function get called yet, so 
I'm hoping that means that I'm never getting a normal exit prior to 
calling exec (I should verify that).  Also, is there a way I can use 
strace with Cygwin to narrow what spams?  This acts like a race 
condition and sometimes I have to run for 5 or 10 minutes before it 
fails, so emitting more spam will likely lower the likelihood of failure.

One very interesting aspect of this is that if I run two separate make 
-kj1 check jobs (gcc's testsuite) then I can still get the failure, but 
never when just running a single make -kj1 job.  Thus, one suspect is 
DLL base address, even though I have rebased the build tree.  Is there a 
nifty way of catching or debugging fork/DLL base address conflicts?  
iiuc, the whole rebasing thing is so that every DLL has a unique 
(non-overlapping) base address so that when we fork, the DLLs are always 
loaded at the same address.

Using debug log spew, I traced the child "going away" to after calling 
an ioctl to set the terminal window size.

Thanks in advance!
Daniel



--
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] only message in thread

only message in thread, other threads:[~2017-04-14 22:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-15  4:33 How to trap crash or exit in Windows? Daniel Santos

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