bin/55346: /bin/sh eats memory and CPU infinitely
Eugene Grosbein
eugen at kuzbass.ru
Sat Aug 16 21:00:20 PDT 2003
The following reply was made to PR bin/55346; it has been noted by GNATS.
From: Eugene Grosbein <eugen at kuzbass.ru>
To: Doug White <dwhite at gumbysoft.com>
Cc: stable at freebsd.org, bug-followup at freebsd.org
Subject: Re: bin/55346: /bin/sh eats memory and CPU infinitely
Date: Sun, 17 Aug 2003 11:50:54 +0800
Doug White wrote:
> Ah, OK, I follow you there. send-pr away.
It seems that patch replaces memory leak with double-free bug:
waitforjob() will call freejob() just after dowait().
This corrected version removes extra freejob() call.
--- jobs.c.orig Mon Aug 4 11:48:00 2003
+++ jobs.c Sun Aug 17 11:20:55 2003
@@ -889,8 +889,6 @@
#endif
else
st = WTERMSIG(status) + 128;
- if (! JOBS || jp->state == JOBDONE)
- freejob(jp);
if (int_pending()) {
if (WIFSIGNALED(status) && WTERMSIG(status) == SIGINT)
kill(getpid(), SIGINT);
@@ -960,10 +958,8 @@
if (jp->state != state) {
TRACE(("Job %d: changing state from %d
to %d\n", jp -
jobtab + 1, jp->state, state));
jp->state = state;
-#if JOBS
if (done)
- deljob(jp);
-#endif
+ freejob(jp);
}
}
}
Eugene Grosbein
More information about the freebsd-bugs
mailing list