From owner-freebsd-current Sat Feb 8 23:22:45 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id XAA03849 for current-outgoing; Sat, 8 Feb 1997 23:22:45 -0800 (PST) Received: from mail2.uunet.ca (mail2.uunet.ca [142.77.1.15]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id XAA03837 for ; Sat, 8 Feb 1997 23:22:42 -0800 (PST) Received: from why.whine.com ([205.150.249.1]) by mail2.uunet.ca with ESMTP id <123090-27959>; Sun, 9 Feb 1997 02:22:38 -0500 Received: from why (why [205.150.249.1]) by why.whine.com (8.8.5/8.7.3) with SMTP id CAA00548; Sun, 9 Feb 1997 02:22:04 -0500 (EST) Date: Sun, 9 Feb 1997 02:22:03 -0500 From: Andrew Herdman X-Sender: andrew@why To: J Wunsch cc: Andrew Herdman , Poul-Henning Kamp , current@freebsd.org Subject: Re: Make world of Current dies with weird errors. In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Sat, 8 Feb 1997, J Wunsch wrote: > As Andrew Herdman wrote: > > > Core was generated by `make'. > > Program terminated with signal 6, Abort trap. > > Cannot access memory at address 0x654f0. > > #0 0x807de11 in ?? () > > (gdb) bt > > #0 0x807de11 in ?? () > > #1 0x807d6e3 in ?? () > > #2 0x807c232 in ?? () > > #3 0x807c270 in ?? () > > #4 0x807d24b in ?? () > > #5 0x807d432 in ?? () > > #6 0x12731 in Lst_Destroy (l=0x588c0, freeProc=0) > > at /usr/src/usr.bin/make/lst.lib/lstDestroy.c:99 > > Do an ``up 6'', this should get you here. There's most likely a > free() call on line 99. It seems this one is freed multiple times > (for some reason). Ok, here it is.... (gdb) up 6 #6 0x12731 in Lst_Destroy (l=0x588c0, freeProc=0) at /usr/src/usr.bin/make/lst.lib/lstDestroy.c:99 99 free ((Address)ln); (gdb) This is the function: /*- *----------------------------------------------------------------------- * Lst_Destroy -- * Destroy a list and free all its resources. If the freeProc is * given, it is called with the datum from each node in turn before * the node is freed. * * Results: * None. * * Side Effects: * The given list is freed in its entirety. * *----------------------------------------------------------------------- */ void Lst_Destroy (l, freeProc) Lst l; register void (*freeProc) __P((ClientData)); { register ListNode ln; register ListNode tln = NilListNode; register List list = (List)l; if (l == NILLST || ! l) { /* * Note the check for l == (Lst)0 to catch uninitialized static Lst's. * Gross, but useful. */ return; } /* To ease scanning */ if (list->lastPtr != NilListNode) list->lastPtr->nextPtr = NilListNode; else { free ((Address)l); return; } if (freeProc) { for (ln = list->firstPtr; ln != NilListNode; ln = tln) { tln = ln->nextPtr; (*freeProc) (ln->datum); free ((Address)ln); } } else { for (ln = list->firstPtr; ln != NilListNode; ln = tln) { tln = ln->nextPtr; free ((Address)ln); /* This is line 99 */ } } free ((Address)l); } I look at this and my head hurts. I'm afraid pascal was my language of choice during my programming times.... :( Andrew