Opened 12 years ago

Last modified 12 years ago

#4913 new Bugs

file_descriptor_impl::read doesn't handle EINTR

Reported by: Todor Buyukliev <todor@…> Owned by: Jonathan Turkanis
Milestone: To Be Determined Component: iostreams
Version: Boost 1.39.0 Severity: Problem
Keywords: Cc:

Description

when using boost::iostreams::stream_buffer<boost::iostreams::file_descriptor_source>, reads from the stream may unnecessarily set the badbit flag. the reason is that in the underlying call to read() the EINTR condition is not handled. the read() should be restarted in this case.

i'm attaching a non tested patch. it does the same thing that libstdc++ does (function basic_file<char>::xsgetn).

this is easy to reproduce in gdb. here's why: http://sourceware.org/gdb/onlinedocs/gdb/Interrupted-System-Calls.html

Attachments (1)

file_descriptor.patch (665 bytes ) - added by Todor Buyukliev <todor@…> 12 years ago.

Download all attachments as: .zip

Change History (2)

by Todor Buyukliev <todor@…>, 12 years ago

Attachment: file_descriptor.patch added

comment:1 by Marshall Clow, 12 years ago

Component: Noneiostreams
Owner: set to Jonathan Turkanis
Note: See TracTickets for help on using tickets.