[Bug libc/394] wierd I/O-error handling in libio

peak at argo dot troja dot mff dot cuni dot cz sourceware-bugzilla@sources.redhat.com
Thu Oct 7 21:07:00 GMT 2004


------- Additional Comments From peak at argo dot troja dot mff dot cuni dot cz  2004-10-07 21:07 -------
Created an attachment (id=223)
 --> (http://sources.redhat.com/bugzilla/attachment.cgi?id=223&action=view)
fmemopen() testcase

This programs creates a memory stream with a buffer 10 chars long and checks
what happens when too much data are written to it.

Case 1: 100 successful putc's, fflush after putc #100 fails, ferror not set
$ ./ts
fflush #100 failed: no err
final status: no err
INCORRECT (error detected by fflush but ferror not set)

Case 2: 100 successful putc's, no fflush, ferror not set, fclose fails
$ ./ts 100 100
final status: no err
fclose failed
CORRECT (error detected during implicit fflush in fclose)

Case 3: lots of putc's, no fflush, putc #8193 fails, ferror not set--WRONG
$ ./ts 100000 100000
putc #8193 failed: no err
final status: no err
INCORRECT (error detected by putc #8193 but ferror not set)

Any stream implemented using fopencookie() and using the documented way
(libc.info: Hook Functions) to report errors from cookie functions (return -1)
would exhibit similar errors.


-- 


http://sources.redhat.com/bugzilla/show_bug.cgi?id=394

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.



More information about the Glibc-bugs mailing list