Bug 10063 - [3.4 Regression] stdio_filebuf broken
Summary: [3.4 Regression] stdio_filebuf broken
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 3.4.0
: P1 normal
Target Milestone: 3.4.0
Assignee: Benjamin Kosnik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-13 19:36 UTC by Pétur Runólfsson
Modified: 2004-01-17 04:22 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2003-12-05 03:24:26


Attachments
stdiobug.cc (444 bytes, text/plain)
2003-05-21 15:17 UTC, Pétur Runólfsson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pétur Runólfsson 2003-03-13 19:36:00 UTC
stdio_filebuf on current mainline now bypasses the FILE* used to construct it and uses the underlying file descriptor. This breaks any program that does I/O on a FILE* before constructing a stdio_filebuf from it.

Release:
gcc 3.4 cvs from 20030312

Environment:
Red Hat Linux 8.0

How-To-Repeat:
See attachment.
Comment 1 Paolo Carlini 2003-03-29 13:36:22 UTC
Responsible-Changed-From-To: unassigned->paolo
Responsible-Changed-Why: I broke it!
Comment 2 Paolo Carlini 2003-03-29 13:36:22 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: Confirmed.
Comment 3 Paolo Carlini 2003-05-23 08:59:03 UTC
Benjamin, I'm tentatively assigning this to you as the guy currently working on
those issues.

Personally, I don't know what should we really do in order to be able to
intermix flawlessly the current stdio_filebuf - which, at variance with the old
situation ends up always issuing direct non blocking I/O syscalls, i.e., read,
write, lseek and so on - with stdio. Perhaps we should just hit the bullet and
declare that this is now possible only with stdio_sync_filebuf?

What do you think?

Paolo.
Comment 4 Pétur Runólfsson 2003-07-01 09:48:59 UTC
Paolo Carlini wrote:
> Personally, I don't know what should we really do in order to be able to
> intermix flawlessly the current stdio_filebuf - which, at variance with the old
> situation ends up always issuing direct non blocking I/O syscalls, i.e., read,
> write, lseek and so on - with stdio.

Since this class doesn't use stdio any more, it should be named something other
than stdio_filebuf.

> Perhaps we should just hit the bullet and
> declare that this is now possible only with stdio_sync_filebuf?

Sounds good. stdio_filebuf was never really well suited for this purpose.

Petur
Comment 5 GCC Commits 2003-12-10 17:37:29 UTC
Subject: Bug 10063

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	bkoz@gcc.gnu.org	2003-12-10 17:37:25

Modified files:
	libstdc++-v3   : ChangeLog 
	libstdc++-v3/config/io: basic_file_stdio.cc 
Added files:
	libstdc++-v3/testsuite/ext/stdio_filebuf/char: 10063-1.cc 
	                                               10063-2.cc 

Log message:
	2003-12-10  Benjamin Kosnik  <bkoz@redhat.com>
	
	PR libstdc++/10063
	* config/io/basic_file_stdio.cc (__basic_file::sys_open): Sync.
	* testsuite/ext/stdio_filebuf/char/10063-1.cc: New.
	* testsuite/ext/stdio_filebuf/char/10063-2.cc: New.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&r1=1.2148&r2=1.2149
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/config/io/basic_file_stdio.cc.diff?cvsroot=gcc&r1=1.24&r2=1.25
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/ext/stdio_filebuf/char/10063-1.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/ext/stdio_filebuf/char/10063-2.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1

Comment 6 Andrew Pinski 2003-12-10 18:41:02 UTC
Fixed.