delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/02/15/06:08:32

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Fri, 15 Feb 2008 12:07:01 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: signals of type SIGSEGV handled only once (in multithreaded process)
Message-ID: <20080215110701.GW25954@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <20080215083751 DOT 535E978014 AT ems008 DOT s DOT etech DOT sk> <20080215094547 DOT GU25954 AT calimero DOT vinschen DOT de> <20080215094953 DOT GA4511 AT implementation> <20080215100253 DOT GV25954 AT calimero DOT vinschen DOT de> <20080215101116 DOT GB4511 AT implementation>
MIME-Version: 1.0
In-Reply-To: <20080215101116.GB4511@implementation>
User-Agent: Mutt/1.5.16 (2007-06-09)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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

On Feb 15 11:11, Samuel Thibault wrote:
> Corinna Vinschen, le Fri 15 Feb 2008 11:02:53 +0100, a écrit :
> > On Feb 15 10:49, Samuel Thibault wrote:
> > > Corinna Vinschen, le Fri 15 Feb 2008 10:45:47 +0100, a écrit :
> > > > On Feb 15 09:37, klement2 wrote:
> > > > > After excellently quick correction of pthread_kill when the argument
> > > > > signal is zero
> > > > > (by cgf), I have found another problem related to signal handling. The
> > > > > code in attachment
> > > > > demonstrates it ( because of pthread_kill, it must be run with
> > > > > cygwin1-20080213.dll and newer ).
> > > > > It seams that signal handlers for signals like SIGSEGV, SIGFPE are
> > > > > called only once,
> > > > 
> > > > This patch was necessary to get SEHs (and so Cygwin) working correctly
> > > > on Windows 2008 Server.  The new behaviour is covered by POSIX:
> > > > 
> > > > http://www.opengroup.org/onlinepubs/009695399/functions/signal.html
> > > > 
> > > >   "If and when the function returns, if the value of sig was SIGFPE,
> > > >    SIGILL, or SIGSEGV or any other implementation-defined value
> > > >    corresponding to a computational exception, the behavior is undefined.
> > > >    Otherwise, the program shall resume execution at the point it was
> > > >    interrupted."
> > > 
> > > His handler doesn't return, it calls pthread_exit(), thus killing the
> > > thread causing the SIGFPE, SIGILL or SIGSEGV.
> > 
> > ...and then it returns.  Where to?
> 
> who returns ? "The pthread_exit() function cannot return to its caller."

Ok, I'm investigating.  It turns out that prior of the exception
handling patch it didn't work, either, just in another way.  I can
revert to the old behaviour without affecting the ability to run
on Windows 2008, but it still isn't really working as expected.
I'm not overly savvy in terms of exception handling, so I have no
idea if this is completely solvable.  Stay tuned.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

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

- Raw text -


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