readlink -f still segfaults

Rich Felker dalias at aerifal.cx
Sat May 6 00:38:56 UTC 2006


On Fri, May 05, 2006 at 05:02:35PM -0400, Rob Landley wrote:
> On Friday 05 May 2006 6:54 am, Natanael Copa wrote:
> > It looks to me that it always needs to be free'd.
> > The previous way realpath(..., NULL) gnu extension allocates for you
> > when buffer is NULL.
> 
> Which is smaller.  You're saying that uClibc 0.9.28 doesn't do this, though?
> 
> Hmmm...  Sounds like we're getting into platform.c territory.  The bb_strlen() 
> thing really should be in libbb/platform.c rather than xfuncs.c because 
> substituting our own strlen() function to force uninlining is a workaround 
> for a broken compiler that can't be told _NOT_ to inline something that's 
> used over 500 times in the code.

Can't be told not to? Did you ever rtfm -fno-builtin? :)

> This is another case where using the gnu extension in glibc's realpath() is 
> smaller when we can do that, but we need our own bb_realpath() that calls 
> xmalloc() when that's not available.

Definitely. The GNU behavior should not be added to uClibc, BTW,
because it adds a dependency on malloc to realpath (thus making a tiny
static binary that uses realpath include all of malloc...).

Rich




More information about the busybox mailing list