bin/45478: /bin/sh coredump
Giorgos Keramidas
keramida at freebsd.org
Fri Apr 15 09:00:40 PDT 2005
The following reply was made to PR bin/45478; it has been noted by GNATS.
From: Giorgos Keramidas <keramida at freebsd.org>
To: Oliver Fromme <olli at secnetix.de>
Cc: bug-followup at freebsd.org, Oliver Fromme <olli at fromme.com>
Subject: Re: bin/45478: /bin/sh coredump
Date: Fri, 15 Apr 2005 18:52:32 +0300
On 2002-11-19 13:43, Oliver Fromme <olli at secnetix.de> 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
More information about the freebsd-bugs
mailing list