From owner-freebsd-bugs@FreeBSD.ORG Thu Jun 30 21:40:07 2011 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 872191065673 for ; Thu, 30 Jun 2011 21:40:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 64F1B8FC0C for ; Thu, 30 Jun 2011 21:40:07 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p5ULe7oa066959 for ; Thu, 30 Jun 2011 21:40:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p5ULe72n066958; Thu, 30 Jun 2011 21:40:07 GMT (envelope-from gnats) Resent-Date: Thu, 30 Jun 2011 21:40:07 GMT Resent-Message-Id: <201106302140.p5ULe72n066958@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Peter Buhr Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE741106564A for ; Thu, 30 Jun 2011 21:39:48 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id BEBAE8FC14 for ; Thu, 30 Jun 2011 21:39:48 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p5ULdm9n030766 for ; Thu, 30 Jun 2011 21:39:48 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id p5ULdm5p030765; Thu, 30 Jun 2011 21:39:48 GMT (envelope-from nobody) Message-Id: <201106302139.p5ULdm5p030765@red.freebsd.org> Date: Thu, 30 Jun 2011 21:39:48 GMT From: Peter Buhr To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/158541: ITIMER_REAL stops signalling X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jun 2011 21:40:07 -0000 >Number: 158541 >Category: misc >Synopsis: ITIMER_REAL stops signalling >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Jun 30 21:40:07 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Peter Buhr >Release: RELEASE 8.1 >Organization: University of Waterloo >Environment: FreeBSD xxxx.xxx.xxx 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Mon Jul 19 02:55:53 UTC 2010 root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 >Description: The following program stops printing; it hangs spinning in the for loop. The problem appears to be a missed signal for ITIMER_REAL to the program. I have tried 4 versions of the program. Two with durations 9999 and 99999 microseconds, and two different versions to reset the time, one resets the timer in the handler and the other uses the interval times 9999 and 99999 microseconds, respectively. All 4 versions never complete. The only conclusion is that the kernel stops sending signals to the program. The problem does not occur on RELEASE 8.2, so it has been fixed. Nevertheless, I spent several hours tracking this problem down in RELEASE 8.1. After isolating the problem, I searched the bug database and found no reference to this problem. So it should be marked as a bug when searching the bug database so that others do not have to discover the bug again in RELEASE 8.1. >How-To-Repeat: #include #include #include struct itimerval value; int itimer_real = 1; void alarm( int ) { itimer_real += 1; // signal( SIGALRM, alarm ); // setitimer(ITIMER_REAL, &value, 0); if ( itimer_real % 10 == 0 ) printf( "%d\n", itimer_real ); } int main() { value.it_value.tv_sec = 0; value.it_value.tv_usec = 99999; value.it_interval.tv_sec = 0; value.it_interval.tv_usec = 99999; signal( SIGALRM, alarm ); setitimer( ITIMER_REAL, &value, 0 ); for ( ; itimer_real < 1000000; ); } // Local Variables: // // compile-command: "g++ test.cc" // // End: // >Fix: >Release-Note: >Audit-Trail: >Unformatted: