ls -l segfault + [PATCH]

Jan Evert van Grootheest Jan-Evert.van.Grootheest at Vialis.nl
Mon Mar 19 05:49:46 PDT 2007


> On Mon, Mar 19, 2007 at 01:26:15PM +0100, Jan Evert van 
> Grootheest wrote:
> > 
> > It is reproducable with this small test program.
> > Leave out the fork or the first printf and things work.
> 
> It works always, in Fedora Core 6; it fails with or without 
> fork() in Rehat 7.3.
> 
> If works in Redhat 7.3 without the first printf. So it's a 
> bug in glibc stdio functions, on older glibcs.
> 
> Also, a fflush(stdout) before setvbuf didn't fix it, but 
> letting stdio allocate its own buffer (setvbuf(stdout, NULL, 
> ...)) did.

I know about the fflush. Tried it as well.
I found the manual page a bit confusing, because it first says, just above the flags section, that setvbuf may be used on any open stream. While later on, at the end of the first paragraph below the flags section, it is said that it must be done between opening the stream and the first action on it.

I guess the issue is the internal state of the libc I/O. After the first action it has been fully initialized.

-- Jan Evert 
 
The information contained in this communication is confidential and may be legally privileged. It is intended solely for the use of the individual or entity to whom it is addressed and others authorised to receive it. If you are not the intended recipient you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this information is strictly prohibited and may be unlawful. Vialis is neither liable for the proper and complete transmission of the information contained in this communication nor for any delay in its receipt. 
 


More information about the busybox mailing list