X-Spam-Check-By: sourceware.org Date: Sun, 4 Dec 2005 14:29:53 -0500 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: SA_SIGINFO and signal info ? Message-ID: <20051204192952.GA13679@trixie.casa.cgf.cx> Reply-To: cygwin AT cygwin DOT com References: <20051202230909 DOT GM10913 AT bouh DOT residence DOT ens-lyon DOT fr> <20051203001911 DOT GQ10913 AT bouh DOT residence DOT ens-lyon DOT fr> <20051203003415 DOT GR10913 AT bouh DOT residence DOT ens-lyon DOT fr> <20051203023731 DOT GU10913 AT bouh DOT residence DOT ens-lyon DOT fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20051203023731.GU10913@bouh.residence.ens-lyon.fr> User-Agent: Mutt/1.5.11 Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , 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 Sat, Dec 03, 2005 at 03:37:32AM +0100, Samuel Thibault wrote: >Hi, > >Igor Pechtchanski, le Fri 02 Dec 2005 20:16:58 -0500, a ?crit : >> On Sat, 3 Dec 2005, Samuel Thibault wrote: >> >> > [snip] >> > So SI_USER should rather be defined to 0. >> > Mmm, btw, SIGALRM sets 0 in si_code, while it should set SI_KERNEL. >> >> A clear case of ... > >The following patch works. >pthread_kill()'s issue seems trickier. > >Regards, >Samuel > >Index: cygwin/timer.cc >=================================================================== >RCS file: /cvs/src/src/winsup/cygwin/timer.cc,v >retrieving revision 1.19 >diff -u -r1.19 timer.cc >--- cygwin/timer.cc 11 Nov 2005 16:42:15 -0000 1.19 >+++ cygwin/timer.cc 3 Dec 2005 02:38:47 -0000 >@@ -167,6 +167,7 @@ > siginfo_t si; > memset (&si, 0, sizeof (si)); > si.si_signo = tt->evp.sigev_signo; >+ si.si_code = SI_KERNEL; > si.si_sigval.sival_ptr = tt->evp.sigev_value.sival_ptr; > debug_printf ("%p sending sig %d", x, tt->evp.sigev_signo); > sig_send (myself_nowait, si); >Index: cygwin/include/cygwin/signal.h >=================================================================== >RCS file: /cvs/src/src/winsup/cygwin/include/cygwin/signal.h,v >retrieving revision 1.8 >diff -u -r1.8 signal.h >--- cygwin/include/cygwin/signal.h 10 Nov 2005 09:12:22 -0000 1.8 >+++ cygwin/include/cygwin/signal.h 3 Dec 2005 02:38:48 -0000 >@@ -102,7 +102,7 @@ > > enum > { >- SI_USER = 1, /* sent by kill, raise, pthread_kill */ >+ SI_USER = 0, /* sent by kill, raise, pthread_kill */ > SI_ASYNCIO, /* sent by AIO completion (currently > unimplemented) */ > SI_MESGQ, /* sent by real time mesq state change Thank you for the patch, but there are a couple of problems with it. - The value for si_code should be SI_TIMER not SI_KERNEL. - Changing SI_USER could have consequences for existing applications. I'm willing to change SI_USER to zero and then add a workaround later if anyone squawks (since this breaks backwards compatibility) but I'm not willing to change the value of every value in that enum as your change above does. So, anyway, I've checked in a fix which addresses the two problems that you found. The change is in the latest snapshot. As far as pthread_kill is concerned, I'm planning on dealing with issues with threads and signals in 1.5.20. I don't want to destabilize signal handling now that 1.5.19 is imminent. I am not making any guarantees that things will work better with pthread_kill, in cygwin 1.5.20, however. cgf -- 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/