Date: Wed, 2 May 2001 11:36:59 +1000 From: "Andrew Reilly" <areilly@bigpond.net.au> To: "Chad R. Larson" <chad@DCFinc.com> Cc: Gregory Bond <gnb@itga.com.au>, bc979@lafn.org, stable@FreeBSD.ORG, kris@obsecurity.org Subject: Re: Illegal Instruction in libm - Problem solved.... Message-ID: <20010502113659.B1059@gurney.reilly.home> In-Reply-To: <200104301434.HAA27894@freeway.dcfinc.com>; from chad@DCFinc.com on Mon, Apr 30, 2001 at 07:34:35AM -0700 References: <200104280139.LAA01281@lightning.itga.com.au> <200104301434.HAA27894@freeway.dcfinc.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010502113659.B1059>