From owner-freebsd-hackers Wed Jun 10 15:05:18 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id PAA01908 for freebsd-hackers-outgoing; Wed, 10 Jun 1998 15:05:18 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from smtp03.primenet.com (daemon@smtp03.primenet.com [206.165.6.133]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id PAA01837 for ; Wed, 10 Jun 1998 15:04:46 -0700 (PDT) (envelope-from tlambert@usr01.primenet.com) Received: (from daemon@localhost) by smtp03.primenet.com (8.8.8/8.8.8) id PAA16131; Wed, 10 Jun 1998 15:04:32 -0700 (MST) Received: from usr01.primenet.com(206.165.6.201) via SMTP by smtp03.primenet.com, id smtpd016096; Wed Jun 10 15:04:27 1998 Received: (from tlambert@localhost) by usr01.primenet.com (8.8.5/8.8.5) id PAA14301; Wed, 10 Jun 1998 15:04:25 -0700 (MST) From: Terry Lambert Message-Id: <199806102204.PAA14301@usr01.primenet.com> Subject: Re: debugging memory allocation in -stable To: wjw@IAEhv.nl Date: Wed, 10 Jun 1998 22:04:24 +0000 (GMT) Cc: hackers@FreeBSD.ORG In-Reply-To: <199806102001.WAA03724@surf.IAEhv.nl> from "Willem Jan Withagen" at Jun 10, 98 10:01:41 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > Working on some stuff with variant links, crashed became my life. But I > have some code partially working. Only a few symbolic links later, I get a > crash due to having already free'ed some buffer. > > I'm pretty shure I have to release this buffer in my code, but know I'd like > to know where this buffer was malloced in the first place. > How do I figure this out? I have not had a chance yet to look at your code. I *will* look at the code in the near future. From a cursory examination, I have: I think you are not treating symbol expansion as being exactly the same as link expansion. See the "Check for symbolic link" case in namei() in vfs_lookup.c. It is exactly analogous to the "readlink" case. In most cases, an inline expansion is possible. This is my opinion from the code integration location. IMO, you should be wedging the "$" into the cn_hash calaculation, which has to do the traversal anyway (making it two compares -- nearly free). You may want to look at the HASBUF/SAVESTART flags while you are there; after a manipulation, these should probably be reset on the allocated version, and tested for the FREE. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message