public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: libstdc++/9507: filebuf::open handles ios_base::ate incorrectly
@ 2003-02-04 18:18 paolo
  0 siblings, 0 replies; 3+ messages in thread
From: paolo @ 2003-02-04 18:18 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, paolo, peturr02

Synopsis: filebuf::open handles ios_base::ate incorrectly

State-Changed-From-To: analyzed->closed
State-Changed-By: paolo
State-Changed-When: Tue Feb  4 18:18:48 2003
State-Changed-Why:
    Fixed for 3.3 and 3.4 (and 3.2.3).

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9507


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: libstdc++/9507: filebuf::open handles ios_base::ate incorrectly
@ 2003-02-01 23:17 paolo
  0 siblings, 0 replies; 3+ messages in thread
From: paolo @ 2003-02-01 23:17 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, paolo, peturr02

Synopsis: filebuf::open handles ios_base::ate incorrectly

Responsible-Changed-From-To: unassigned->paolo
Responsible-Changed-By: paolo
Responsible-Changed-When: Sat Feb  1 23:17:20 2003
Responsible-Changed-Why:
    Fixing.
State-Changed-From-To: open->analyzed
State-Changed-By: paolo
State-Changed-When: Sat Feb  1 23:17:20 2003
State-Changed-Why:
    Confirmed: 27.8.1.3,4

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9507


^ permalink raw reply	[flat|nested] 3+ messages in thread

* libstdc++/9507: filebuf::open handles ios_base::ate incorrectly
@ 2003-01-30 14:46 peturr02
  0 siblings, 0 replies; 3+ messages in thread
From: peturr02 @ 2003-01-30 14:46 UTC (permalink / raw)
  To: gcc-gnats


>Number:         9507
>Category:       libstdc++
>Synopsis:       filebuf::open handles ios_base::ate incorrectly
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 30 14:46:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     peturr02@ru.is
>Release:        gcc-3.2.1
>Organization:
>Environment:
Red Hat Linux 8.0
>Description:
When the flag ios_base::ate is passed to basic_filebuf::open, the filebuf tries to seek to the end of the file (as expected). If this seek fails, the file is closed before open returns (also as expected). However, the return value still indicates that open was successful, even though is_open is false after the call to open.
>How-To-Repeat:
See attachment.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="openseekbug.cc"
Content-Disposition: inline; filename="openseekbug.cc"

#include <fstream>
#include <unistd.h>
#include <signal.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>

#undef NDEBUG
#include <cassert>

int main()
{
	using namespace std;

	signal(SIGPIPE, SIG_IGN);

	unlink("xxx");
	mkfifo("xxx", S_IRWXU);

	if (!fork())
	{
		filebuf fbuf;
		fbuf.open("xxx", ios_base::in);
		fbuf.sgetc();
		fbuf.close();

		exit(0);
	}

	filebuf fbuf;
	filebuf* r = fbuf.open("xxx", ios_base::out | ios_base::ate);
	assert(!fbuf.is_open());
	assert(r == NULL);

	unlink("xxx");
	return 0;
}


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-02-04 18:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-04 18:18 libstdc++/9507: filebuf::open handles ios_base::ate incorrectly paolo
  -- strict thread matches above, loose matches on Subject: below --
2003-02-01 23:17 paolo
2003-01-30 14:46 peturr02

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).