public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/9158: ostrstream dumps core with gcc 3.1
@ 2003-01-06 14:42 paolo
  0 siblings, 0 replies; 3+ messages in thread
From: paolo @ 2003-01-06 14:42 UTC (permalink / raw)
  To: etienne_frejaville, gcc-bugs, gcc-prs, nobody

Synopsis: ostrstream dumps core with gcc 3.1

State-Changed-From-To: feedback->closed
State-Changed-By: paolo
State-Changed-When: Mon Jan  6 06:42:24 2003
State-Changed-Why:
    In the light of some private exchanges with submitter, I
    think I can close it.

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


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

* Re: c++/9158: ostrstream dumps core with gcc 3.1
@ 2003-01-03 18:28 paolo
  0 siblings, 0 replies; 3+ messages in thread
From: paolo @ 2003-01-03 18:28 UTC (permalink / raw)
  To: etienne_frejaville, gcc-bugs, gcc-prs, nobody

Synopsis: ostrstream dumps core with gcc 3.1

State-Changed-From-To: open->feedback
State-Changed-By: paolo
State-Changed-When: Fri Jan  3 10:28:58 2003
State-Changed-Why:
    Could you possibly consider upgrading to the current
    release, gcc-3.2.1? Now your problem cannot be reproduced.

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


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

* c++/9158: ostrstream dumps core with gcc 3.1
@ 2003-01-03 18:06 etienne_frejaville
  0 siblings, 0 replies; 3+ messages in thread
From: etienne_frejaville @ 2003-01-03 18:06 UTC (permalink / raw)
  To: gcc-gnats

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2427 bytes --]


>Number:         9158
>Category:       c++
>Synopsis:       ostrstream dumps core with gcc 3.1
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jan 03 10:06:02 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Etienne Fréjaville
>Release:        3.1
>Organization:
>Environment:
Linux RH 7.3
>Description:
Although clearly indicated as deprecated, it is very dangerous to let compile sources with the old ostrstreams as it clearly DOESN'T WORK :

~/C++> g++ -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.1/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --host=i386-redhat-linux --with-system-zlib
Thread model: posix
gcc version 3.1 20020604 (Red Hat Linux 7.3 3.1-5)
~/C++> cat bugostrstream.cxx 
#include <strstream.h>
main()
{
  ostrstream o;
}
~/C++> g++ bugostrstream.cxx 
In file included from /usr/include/g++-v3/backward/strstream:51,
                 from /usr/include/g++-v3/backward/strstream.h:33,
                 from bugostrstream.cxx:1:
/usr/include/g++-v3/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <sstream> instead of the deprecated header <strstream.h>. To disable this warning use -Wno-deprecated.
~/C++> a.out 
Segmentation fault (core dumped)
~/C++> 

Although here the behaviour is cleary due to ostrstreams
(it fails in the destructor), I discovered that bad behaviour problem in a much more complex situation :
I had a core dump in a malloc not immediately following a free on a string returned by the str() function. (Required by the old interface).

If clearly ostrstreams (and strstreams) provoke such a behaviour, I thing that it should be much safer to
issue an ERROR at compile time rather than a WARNING.
As clearly, who can use such a class ???
Thanks for all the future users that will save time
when recompîling their code from gcc 2.96 to gcc 3.1 ...
BTW thanks for GCC it's generally quite reliable.
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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

end of thread, other threads:[~2003-01-06 14:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-06 14:42 c++/9158: ostrstream dumps core with gcc 3.1 paolo
  -- strict thread matches above, loose matches on Subject: below --
2003-01-03 18:28 paolo
2003-01-03 18:06 etienne_frejaville

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).