public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: libstdc++/5268: More fun with global stream destruction semantics
@ 2002-04-02 18:37 bkoz
0 siblings, 0 replies; 5+ messages in thread
From: bkoz @ 2002-04-02 18:37 UTC (permalink / raw)
To: bkoz, gcc-bugs, gcc-prs, kenny.simpson, nobody, theonetruekenny
Synopsis: More fun with global stream destruction semantics
Responsible-Changed-From-To: unassigned->bkoz
Responsible-Changed-By: bkoz
Responsible-Changed-When: Tue Apr 2 18:37:17 2002
Responsible-Changed-Why:
Mine.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5268
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: libstdc++/5268: More fun with global stream destruction semantics
@ 2002-04-03 12:35 bkoz
0 siblings, 0 replies; 5+ messages in thread
From: bkoz @ 2002-04-03 12:35 UTC (permalink / raw)
To: bkoz, gcc-bugs, gcc-prs, kenny.simpson, theonetruekenny
Synopsis: More fun with global stream destruction semantics
State-Changed-From-To: feedback->closed
State-Changed-By: bkoz
State-Changed-When: Wed Apr 3 12:35:49 2002
State-Changed-Why:
Fixed....
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5268
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: libstdc++/5268: More fun with global stream destruction semantics
@ 2002-01-09 14:46 Simpson, Kenny
0 siblings, 0 replies; 5+ messages in thread
From: Simpson, Kenny @ 2002-01-09 14:46 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR libstdc++/5268; it has been noted by GNATS.
From: "Simpson, Kenny" <Kenny.Simpson@gs.com>
To: "'paolo@gcc.gnu.org'" <paolo@gcc.gnu.org>,
"'gcc-bugs@gcc.gnu.org'" <gcc-bugs@gcc.gnu.org>,
"'gcc-prs@gcc.gnu.org'" <gcc-prs@gcc.gnu.org>,
"Simpson, Kenny" <Kenny.Simpson@gs.com>,
"'nobody@gcc.gnu.org'" <nobody@gcc.gnu.org>,
"'theonetruekenny@yahoo.com'" <theonetruekenny@yahoo.com>,
"'gcc-gnats@gcc.gnu.org'" <gcc-gnats@gcc.gnu.org>
Cc:
Subject: RE: libstdc++/5268: More fun with global stream destruction semantics
Date: Wed, 9 Jan 2002 17:37:02 -0500
Ok, here is a better (compilable) test:
#include <iostream> // for std::cout
#include <ostream> // for std::ostream
#include <sstream> // for basic_stringbuf and stringbuf typedef
int main()
{
std::stringbuf b1;
std::cout.rdbuf( &b1 );
std::cout << "hello\n";
return 0;
}
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: libstdc++/5268: More fun with global stream destruction semantics
@ 2002-01-09 14:21 paolo
0 siblings, 0 replies; 5+ messages in thread
From: paolo @ 2002-01-09 14:21 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, kenny.simpson, nobody, theonetruekenny
Synopsis: More fun with global stream destruction semantics
State-Changed-From-To: open->feedback
State-Changed-By: paolo
State-Changed-When: Wed Jan 9 14:21:32 2002
State-Changed-Why:
Could you please attach to your report a testcase actually
compilable?
Thanks,
Paolo.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5268
^ permalink raw reply [flat|nested] 5+ messages in thread
* libstdc++/5268: More fun with global stream destruction semantics
@ 2002-01-03 14:36 theonetruekenny
0 siblings, 0 replies; 5+ messages in thread
From: theonetruekenny @ 2002-01-03 14:36 UTC (permalink / raw)
To: gcc-gnats; +Cc: kenny.simpson
>Number: 5268
>Category: libstdc++
>Synopsis: More fun with global stream destruction semantics
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Jan 03 14:36:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Kenny Simpson
>Release: cvs - probably also in 3.0
>Organization:
>Environment:
source
>Description:
Similar to PR 3045, in fact same example used.
The problem is that in ios.cc lines [190, 192] and [197, 199]
the flush method is called on the global stream objects cout, cerr, clog, etc
The reason this is a problem is that this will call methods on the
underlying stream buffer, which may no longer exist at this point.
(e.g. is the stream were redirected)
>How-To-Repeat:
// mostly copied from PR 3045
#include <fstream>
#include <iostream>
std::basic_filebuf b1;
int main()
{
b1.open("foo");
cout.rdbuf( b1 );
std::cout << "hello\n";
return 0;
}
// order of events:
// magic std::ios_base::Init object is constructed causing
// std::buf_cout constructed - BTW should this even be in std?
// std::cout constructed to point at std::buf_cout
// b1 is created
// main begins
// std::cout is redirected to b1
// main ends
// b1 is destroyed
// magic std::ios_base::Init object destroyed causing
// std::cout.flush, which in turn calls pubsync on b1 - oops
>Fix:
Don't call .flush on cout, cerr, clog, etc..
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2002-04-03 20:35 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-02 18:37 libstdc++/5268: More fun with global stream destruction semantics bkoz
-- strict thread matches above, loose matches on Subject: below --
2002-04-03 12:35 bkoz
2002-01-09 14:46 Simpson, Kenny
2002-01-09 14:21 paolo
2002-01-03 14:36 theonetruekenny
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).