Subject: Re: bug#12327: Signal-handler cleanup for Emacs

From: Eli Zaretskii <[email-masked]>
Date: Thu, 06 Sep 2012 19:46:43 +0300

> Date: Thu, 06 Sep 2012 16:41:27 +0200
> From: martin rudalics <[email-masked]>
> Cc: [email-masked]
> 
> > Crash is in r109893 built on Windows XP using MingGW gcc 4.6.2.
> > 
> > To reproduce it, run "M-x rgrep" using Cygwin grep. The grep
> > output is all displayed in the *grep* buffer, and then emacs aborts.
> 
> With r109905 doing M-x shell and then exit gets me
> 
> Breakpoint 1, emacs_abort () at w32fns.c:7201
> 7201	  button = MessageBox (NULL,
> (gdb) bt
> #0  emacs_abort () at w32fns.c:7201
> #1  0x010345e2 in sys_wait (status=0x82f284) at w32proc.c:462
> #2  0x01031ff0 in record_child_status_change () at process.c:6422
> #3  0x01032315 in handle_child_signal (sig=18) at process.c:6529
> #4  0x010dd5fa in handle_on_main_thread (sig=18, handler=0x1032306 <handle_child_signal>) at sysdep.c:1584
> #5  0x01032334 in deliver_child_signal (sig=18) at process.c:6536
> #6  0x010358ec in sys_select (nfds=4, rfds=0x82f704, wfds=0x0, efds=0x0, timeout=0x82f6f4, ignored=0x0) at w32proc.c:1325

I think I fixed this in revision 109907 on the trunk, please test.  At
least "M-x shell" followed by "exit RET" no longer winds up in
emacs_abort for me.  I cannot test Andrew's recipe, as I don't have
Cygwin installed.