BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001440 [uClibc] Stdio minor always 07-24-07 13:09 07-24-07 13:10
Reporter Dwight Engen View Status public  
Assigned To uClibc
Priority normal Resolution open  
Status assigned   Product Version 0.9.28.1
Summary 0001440: fputc sets invalid stream->__bufpos when __WRITE fails
Description Attached is a test case and a fix for a bug in uclibc fputc when write(2) returns an error. The internal stream->__bufpos is set incorrectly. This could happen on a real system when for example the disk is full. We simulate it here by setting RLIMIT_FSIZE very small. The stream must be in line buffered mode.
  
The reasoning for the fix is that __stdio_WRITE already has reduced stream->__bufpos for the \n so there is no need for fputc to __STDIO_STREAM_BUFFER_UNADD.

Note that with glibc, it appears the stream gets purged when an error on
write occurs, uclibc's attempt to buffer the data in the stream is
nicer.
Additional Information
Attached Files  testit.c [^] (1,551 bytes) 07-24-07 13:09
 fputc.patch [^] (438 bytes) 07-24-07 13:10

- Relationships

There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
07-24-07 13:09 Dwight Engen New Issue
07-24-07 13:09 Dwight Engen Status new => assigned
07-24-07 13:09 Dwight Engen Assigned To  => uClibc
07-24-07 13:09 Dwight Engen File Added: testit.c
07-24-07 13:10 Dwight Engen File Added: fputc.patch


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker