public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: libstdc++/7111: cout of null pointer causes core dump
@ 2002-07-03 10:46 Phil Edwards
  0 siblings, 0 replies; 4+ messages in thread
From: Phil Edwards @ 2002-07-03 10:46 UTC (permalink / raw)
  To: bkoz; +Cc: gcc-prs

The following reply was made to PR libstdc++/7111; it has been noted by GNATS.

From: Phil Edwards <phil@jaj.com>
To: rdhunt@sandia.gov
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: libstdc++/7111: cout of null pointer causes core dump
Date: Wed, 3 Jul 2002 13:45:41 -0400

 On Mon, Jun 24, 2002 at 10:20:23PM -0000, rdhunt@sandia.gov wrote:
 > >Description:
 > Trying to print a null character pointer causes this program to core dump.
 > This works fine under GCC 2.95.  I know null pointers are sensitive and
 > am not completely sure if this is truly a bug or what the correct way of
 > handling this is.
 
 It's undefined behavior, so coredumping is strictly allowed (while annoying,
 and obviously not friendly).  As bkoz mentioned, the sources have been changed
 to notice and throw an exception.
 
 GCC 2.x used a completely different library as 3.x.
 
 
 > >How-To-Repeat:
 > Compile it and run it.  If I change the char* to be void* it works fine.
 
 For void* I think you'd be getting a pointer address.
 
 Phil
 
 -- 
 If ye love wealth greater than liberty, the tranquility of servitude greater
 than the animating contest for freedom, go home and leave us in peace.  We seek
 not your counsel, nor your arms.  Crouch down and lick the hand that feeds you;
 and may posterity forget that ye were our countrymen.            - Samuel Adams


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

* Re: libstdc++/7111: cout of null pointer causes core dump
@ 2002-07-04 10:01 bkoz
  0 siblings, 0 replies; 4+ messages in thread
From: bkoz @ 2002-07-04 10:01 UTC (permalink / raw)
  To: bkoz, gcc-bugs, gcc-prs, rdhunt

Synopsis: cout of null pointer causes core dump

State-Changed-From-To: feedback->closed
State-Changed-By: bkoz
State-Changed-When: Thu Jul  4 10:01:57 2002
State-Changed-Why:
    Situation resolved in current branch and mainline sources.

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


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

* Re: libstdc++/7111: cout of null pointer causes core dump
@ 2002-07-03 10:02 bkoz
  0 siblings, 0 replies; 4+ messages in thread
From: bkoz @ 2002-07-03 10:02 UTC (permalink / raw)
  To: bkoz, gcc-bugs, gcc-prs, nobody, rdhunt

Synopsis: cout of null pointer causes core dump

Responsible-Changed-From-To: unassigned->bkoz
Responsible-Changed-By: bkoz
Responsible-Changed-When: Wed Jul  3 10:02:45 2002
Responsible-Changed-Why:
    Mine.
State-Changed-From-To: open->feedback
State-Changed-By: bkoz
State-Changed-When: Wed Jul  3 10:02:45 2002
State-Changed-Why:
    Cannot reproduce with gcc-3_1-branch or mainline gcc. It's been fixed in both with:
    
    2002-05-24  Benjamin Kosnik  <bkoz@redhat.com>
    
    	PR libstdc++/6750
    	* include/bits/ostream.tcc (ostream::operator<<(const char*)): Fix
    	for empty string literal.
    	(ostream::operator<<(const _CharT*)): Same.
    	(ostream<char>::operator<<(const char*)): Same.
    	(ostream<char>::operator<<(streambuf*)): Same.
    	* testsuite/27_io/ostream_inserter_char.cc (test08): Add tests.
    	* testsuite/27_io/ostream_inserter_other.cc (test02): Modify.
    
    
    -benjamin

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


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

* libstdc++/7111: cout of null pointer causes core dump
@ 2002-06-24 15:35 rdhunt
  0 siblings, 0 replies; 4+ messages in thread
From: rdhunt @ 2002-06-24 15:35 UTC (permalink / raw)
  To: gcc-gnats


>Number:         7111
>Category:       libstdc++
>Synopsis:       cout of null pointer causes core dump
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jun 24 15:26:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     rdhunt@sandia.gov
>Release:        gcc version 3.1
>Organization:
>Environment:
Sun SunOS 5.8
>Description:
Trying to print a null character pointer causes this program to core dump.  This works fine under GCC 2.95.  I know null pointers are sensitive and am not completely sure if this is truly a bug or what the correct way of handling this is.
>How-To-Repeat:
Compile it and run it.  If I change the char* to be void* it works fine.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="checknull.cpp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="checknull.cpp"

CiNpbmNsdWRlIDxpb3N0cmVhbS5oPgoKaW50IG1haW4oKQp7CiAgIGNoYXIgKm15bnVsbD1OVUxM
OwogICBjb3V0IDw8ICJteW51bGwgcmVzdWx0OiAiIDw8IG15bnVsbCA8PCBlbmRsOwp9Cg==


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

end of thread, other threads:[~2002-07-04 17:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-03 10:46 libstdc++/7111: cout of null pointer causes core dump Phil Edwards
  -- strict thread matches above, loose matches on Subject: below --
2002-07-04 10:01 bkoz
2002-07-03 10:02 bkoz
2002-06-24 15:35 rdhunt

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