fclose bug causes hang in nonthreaded apps

Paul Brook paul at codesourcery.com
Tue Jan 30 17:16:22 PST 2007


I'm seeing a hang in applications that open and close files with a 
non-threaded uClibc.  There is code in fclose() to remove a file handle from 
_stdio_openlist however it's commented out, allegedly because it is dead.
_stdio_openlist is used in several places, including _stdio_term when a 
program exits. fclose() frees the struct, so I don't see how the code can 
possibly be redundant.

In the __UCLIBC_HAS_THREADS__ && __STDIO_BUFFERS case the file is removed from 
_stdio_openlist by __STDIO_OPENLIST_DEC_USE.

The attached patch fixes this bug be re-enabling the code.

Paul

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.uclibc_stdio_free
Type: text/x-diff
Size: 1835 bytes
Desc: not available
Url : http://busybox.net/lists/uclibc/attachments/20070131/1a1c1121/attachment.bin 


More information about the uClibc mailing list