[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: libc6 2.2.1 malloc() bug



On Fri, Mar 02, 2001 at 01:31:57PM -0000, Nick Holgate wrote:
> 
> I have just setup a chroot woody installation and have found that the
> hostname utility fails with a seg fault.
> 
> sparks:/# hostname
> (null)
> sparks:/# hostname -f
> Segmentation fault
> 
> After a little investigation I have tracked it down to the first call to
> malloc() always setting errno even when it succeeds. The hostname utility
> relies on errno remaining zero  after a successful malloc().

Interesting; the errno man page on my Mandrake 7.2 system says errno
is only defined when a call has failed, and that it is valid for the
library to change it when a call succeeds.  That agrees with my understanding
of errno behaviour too.  So I'd say this was a hostname bug.

Richard



Reply to: