From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 622 invoked by alias); 4 Apr 2006 05:33:31 -0000 Received: (qmail 611 invoked from network); 4 Apr 2006 05:33:29 -0000 Received: from unknown (69.17.117.4) by sourceware.org with QMTP; 4 Apr 2006 05:33:29 -0000 Received: (qmail 23425 invoked from network); 4 Apr 2006 05:33:28 -0000 Received: from cpe-66-68-145-131.austin.res.rr.com (HELO [172.16.1.8]) (andy@raitechnology.com@[66.68.145.131]) (envelope-sender ) by mail2.sea5.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 4 Apr 2006 05:33:28 -0000 Message-ID: <44320508.7060202@raitechnology.com> Date: Tue, 04 Apr 2006 05:33:00 -0000 From: Andy Howell Reply-To: AndyHowell@raitechnology.com User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: Daniel Jacobowitz , gdb@sources.redhat.com Subject: Re: GDB is not trapping SIGINT References: <4430AB93.4050004@raitechnology.com> <20060403132125.GA5007@nevyn.them.org> In-Reply-To: <20060403132125.GA5007@nevyn.them.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-04/txt/msg00015.txt.bz2 Daniel Jacobowitz wrote: > On Sun, Apr 02, 2006 at 11:58:59PM -0500, Andy Howell wrote: >> Hello, >> >> I'm having problems getting GDB to not pass SIGINT to my program. In my >> main thread I do a sigwait for SIGINT. When I'm debugging, I don't want >> this called. "info handle" shows that SIGINT should not be being passed >> to my app. >> >> I using GDB 6.3 on RH Linux. > > But how are you using it? :-) An example, please. > You also did not mention what kernel version you are using; at least > one sigwait-related kernel bug has been reported. And it looks like > it is still present in current 2.6 kernels, so you may want to report > this to the kernel developers. sys_rt_sigtimedwait calls > dequeue_signal, but never lets ptrace see it. Maybe the bits from > get_signal_to_deliver can be moved into dequeue_signal now. > Daniel, Sorry for previous lack of details. It does seem to be Linux specific. I see the same behavior in Redhat Linux 2.4.21-4.EL and 2.6.9-22.0.2.EL, as well as Fedora 3 2.6.12. On solaris 2.8 it works fine. It sounds like without a kernel patch, I'm out of luck. Thanks for your help. For what its worth, my program first creates a signal set, block new threads from seeing them, and then the main thread waits for a signal: ::sigemptyset( &set ); ::sigaddset( &set, SIGINT ); ::sigaddset( &set, SIGQUIT ); ::sigaddset( &set, SIGUSR2 ); .... more signals // Block new threads from getting signals pthread_sigmask( SIG_BLOCK &set, NULL ); // Create a bunch of threads ..... // wait for signal do { sigErr = sigwait( &set, &sig ); if( sig == SIGUSR2 ) { doSomething(...) } while( sig = SIGUSR2 ) // Do cleanup and exit Thanks, Andy