|
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 |
|
|