From owner-freebsd-bugs@FreeBSD.ORG Fri Apr 15 16:00:40 2005 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8F86616A4CE for ; Fri, 15 Apr 2005 16:00:40 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6D51E43D46 for ; Fri, 15 Apr 2005 16:00:40 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j3FG0eGZ006757 for ; Fri, 15 Apr 2005 16:00:40 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j3FG0eQU006756; Fri, 15 Apr 2005 16:00:40 GMT (envelope-from gnats) Date: Fri, 15 Apr 2005 16:00:40 GMT Message-Id: <200504151600.j3FG0eQU006756@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Giorgos Keramidas Subject: Re: bin/45478: /bin/sh coredump X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Giorgos Keramidas List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Apr 2005 16:00:40 -0000 The following reply was made to PR bin/45478; it has been noted by GNATS. From: Giorgos Keramidas To: Oliver Fromme Cc: bug-followup@freebsd.org, Oliver Fromme Subject: Re: bin/45478: /bin/sh coredump Date: Fri, 15 Apr 2005 18:52:32 +0300 On 2002-11-19 13:43, Oliver Fromme wrote: > Responsible-Changed-By: tjr > Responsible-Changed-Why: > I believe this is caused by the SIGINT handler longjmp()'ing > out when it's in the middle of a malloc() call. Calls to malloc() > and free() should be bracketed in INTON and INTOFF. > > I haven't had much luck tracking this down in the past, but > I'll try again to find the missing INTON/INTOFF. I just happened to stumble upon this bug today. It's still with us in FreeBSD 6.0-CURRENT. It seems that the inner for loop in the following: while for true; do false; done; do true; done is not stopped by sh(1) when ^C is hit. Even after the interrupt is received, sh consumes at least 5-15% of CPU on my test here, while it appears to be sitting at a PS1 prompt, waiting for more input. PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU CPU COMMAND 2352 keramida 1 5 0 1668K 1192K ttyin 0:03 25.48% 10.79% sh After a few of these commands have been run, sh may reach CPU utilizations of even more: PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU CPU COMMAND 2352 keramida 1 123 0 1672K 1196K RUN 1:11 63.21% 63.18% sh