Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Aug 2003 21:00:19 -0700 (PDT)
From:      Eugene Grosbein <eugen@kuzbass.ru>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/55346: /bin/sh eats memory and CPU infinitely
Message-ID:  <200308170400.h7H40JP4075705@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/55346; it has been noted by GNATS.

From: Eugene Grosbein <eugen@kuzbass.ru>
To: Doug White <dwhite@gumbysoft.com>
Cc: stable@freebsd.org, bug-followup@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


Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200308170400.h7H40JP4075705>