From owner-freebsd-stable Tue May 1 18:37: 2 2001 Delivered-To: freebsd-stable@freebsd.org Received: from areilly.bpc-users.org (CPE-144-132-234-126.nsw.bigpond.net.au [144.132.234.126]) by hub.freebsd.org (Postfix) with SMTP id B37BD37B423 for ; Tue, 1 May 2001 18:36:59 -0700 (PDT) (envelope-from areilly@bigpond.net.au) Received: (qmail 1853 invoked by uid 1000); 2 May 2001 01:36:59 -0000 From: "Andrew Reilly" Date: Wed, 2 May 2001 11:36:59 +1000 To: "Chad R. Larson" Cc: Gregory Bond , bc979@lafn.org, stable@FreeBSD.ORG, kris@obsecurity.org Subject: Re: Illegal Instruction in libm - Problem solved.... Message-ID: <20010502113659.B1059@gurney.reilly.home> References: <200104280139.LAA01281@lightning.itga.com.au> <200104301434.HAA27894@freeway.dcfinc.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200104301434.HAA27894@freeway.dcfinc.com>; from chad@DCFinc.com on Mon, Apr 30, 2001 at 07:34:35AM -0700 Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Mon, Apr 30, 2001 at 07:34:35AM -0700, Chad R. Larson wrote: > As I recall, Gregory Bond wrote: > >> It may always have been a bug in FreeBSD, and still is. > > > > No, the bug is in your code, not FreeBSD. > > > >> The concept of being able to replace a library module with one from > >> your code is fairly common in SVR4, and SunOS. > > > > Even if true (and the C standard makes no such promises), this is not > > what you did. You replaced a standard library function free() with an > > int called free. That is in no way shape or form "replacing a library > > module". This is just plain wrong, and the fact it happened to work > > in previous versions of the FreeBSD C library is just luck. > > On the other hand, it doesn't seem unreasonable that the loader > should issue a warning in that instance. I introduced a similarly bizarre bug one day by creating an int variable called "end". I don't know of any standard C library function called "end", but there is apparently a part of the loader that wants to know where the program ends, and uses this name to label that address. I now know about end,etext,edata(3), and have changed the code to not use that variable name. Seemed like a pretty reasonable name at the time. Didn't produce any compile or link errors. DID produce completely insane run-time behaviour. I think that lack of warnings or messages in this situation is indeed a FreeBSD bug, but I don't know whether it is _really_ a bug, and don't know how I would file it in a PR. Maybe this is the best argument _for_ hungarian notation: all of the good, short names are already used somewhere in global context in the system. :-( -- Andrew To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message