From owner-freebsd-bugs Sat Aug 9 09:10:05 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id JAA29909 for bugs-outgoing; Sat, 9 Aug 1997 09:10:05 -0700 (PDT) Received: (from gnats@localhost) by hub.freebsd.org (8.8.5/8.8.5) id JAA29903; Sat, 9 Aug 1997 09:10:02 -0700 (PDT) Resent-Date: Sat, 9 Aug 1997 09:10:02 -0700 (PDT) Resent-Message-Id: <199708091610.JAA29903@hub.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@FreeBSD.ORG, dima@tejblum.dnttm.rssi.ru Received: from main.hq.cti.ru (main.hq.cti.ru [194.67.85.27]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id JAA29865 for ; Sat, 9 Aug 1997 09:09:53 -0700 (PDT) Received: (from uucp@localhost) by main.hq.cti.ru (8.8.5/8.8.5) with UUCP id UAA19139 for FreeBSD-gnats-submit@freebsd.org; Sat, 9 Aug 1997 20:09:48 +0400 (MSD) Received: (from dima@localhost) by tejblum.dnttm.rssi.ru (8.8.7/8.8.5) id UAA18642; Sat, 9 Aug 1997 20:07:55 +0400 (MSD) Message-Id: <199708091607.UAA18642@tejblum.dnttm.rssi.ru> Date: Sat, 9 Aug 1997 20:07:55 +0400 (MSD) From: Dmitrij Tejblum Reply-To: dima@tejblum.dnttm.rssi.ru To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: bin/4254: make in free(): warning: chunk is already free Sender: owner-freebsd-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >Number: 4254 >Category: bin >Synopsis: make in free(): warning: chunk is already free >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Aug 9 09:10:01 PDT 1997 >Last-Modified: >Originator: Dmitrij Tejblum >Organization: >Release: FreeBSD 3.0-CURRENT-src-cur-2995 i386 >Environment: >Description: When all transformation rules to or from a suffix disappeared, make tries to free the suffix. I think, it is a very strange idea. (Or, maybe, it is a POSIX requirement?) And it is done incorrectly. Apparently, it even don't update the list of known suffixes (but it is an other bug). >How-To-Repeat: Try following Makefile: -----------------------cut here---------- .SUFFIXES: .xxx .xxx.c: aaaa: bbbbb ------------------------cut here--------- >Fix: --- suff.c.00 Wed Mar 12 12:44:53 1997 +++ suff.c Sat Aug 9 19:26:04 1997 @@ -160,7 +160,6 @@ static int SuffSuffHasNameP __P((ClientData, ClientData)); static int SuffSuffIsPrefix __P((ClientData, ClientData)); static int SuffGNHasNameP __P((ClientData, ClientData)); -static void SuffUnRef __P((ClientData, ClientData)); static void SuffFree __P((ClientData)); static void SuffInsert __P((Lst, Suff *)); static void SuffRemove __P((Lst, Suff *)); @@ -327,20 +326,6 @@ /*********** Maintenance Functions ************/ -static void -SuffUnRef(lp, sp) - ClientData lp; - ClientData sp; -{ - Lst l = (Lst) lp; - - LstNode ln = Lst_Member(l, sp); - if (ln != NILLNODE) { - Lst_Remove(l, ln); - ((Suff *) sp)->refCount--; - } -} - /*- *----------------------------------------------------------------------- * SuffFree -- @@ -383,8 +368,7 @@ * None * * Side Effects: - * The reference count for the suffix is decremented and the - * suffix is possibly freed + * The reference count for the suffix is decremented *----------------------------------------------------------------------- */ static void @@ -392,9 +376,11 @@ Lst l; Suff *s; { - SuffUnRef((ClientData) l, (ClientData) s); - if (s->refCount == 0) - SuffFree((ClientData) s); + LstNode ln = Lst_Member(l, (ClientData)s); + if (ln != NILLNODE) { + Lst_Remove(l, ln); + s->refCount--; + } } /*- >Audit-Trail: >Unformatted: