Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Apr 2001 11:48:29 -0700
From:      Doug Hardie <bc979@lafn.org>
To:        Gregory Bond <gnb@itga.com.au>
Cc:        stable@FreeBSD.ORG, Kris Kennaway <kris@obsecurity.org>
Subject:   Re: Illegal Instruction in libm - Problem solved....
Message-ID:  <f04330102b70f6e3cd0bd@[10.0.1.100]>
In-Reply-To: <200104271024.UAA18292@lightning.itga.com.au>
References:  <200104271024.UAA18292@lightning.itga.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help
At 20:24 +1000 4/27/01, Gregory Bond wrote:
>  > There is an interesting difference in malloc.  It defines the symbol
>>  free and if you use that symbol in your program then it tends to
>>  write over some part of your program.  By changing the symbol in my
>>  program (an int) to a different name, the problem goes away and it
>>  works properly.  I believe this behavior is new because it didn't
>>  have this problem in FreeBSD 4.2-RELEASE.
>
>Free() has been part of the malloc() package for as long as the C language has
>existed (more or less).  Redefining standard library names in your code is and
>always has been a bug.  The difference might be that under 4.2 the bug has
>repeatable consequences due to different code layout in the library or
>whatever.
>

It may always have been a bug in FreeBSD, and still is.  The concept 
of being able to replace a library module with one from your code is 
fairly common in SVR4, and SunOS.  I have used that many times on 
projects where the library module needed to be modified for a 
specific application.  That worked under FreeBSD 2.2.x, 3.5, and 4.2 
also.  With 4.3 if there is no change in "size" of the object, you 
get no warning that the code is flawed.  It just crashes in some 
arbritary location unrelated to the symbol issue.  Only if the sizes 
are different do you get an interesting warning that the size of the 
object has been changed.
-- 
-- Doug

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?f04330102b70f6e3cd0bd>