User account creation filtered due to spam.

Bug 8347 - empty vector range used in string construction causes core dump.
Summary: empty vector range used in string construction causes core dump.
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 3.2
: P3 normal
Target Milestone: ---
Assignee: Paolo Carlini
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-10-25 01:46 UTC by adamwilkshire
Modified: 2003-07-25 17:33 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description adamwilkshire 2002-10-25 01:46:02 UTC
templated constructor using empty vector range for string class causes a core dump.

Release:
gcc version 3.2

Environment:
solaris

How-To-Repeat:
see the simple file attachment - run it without options.
Comment 1 Paolo Carlini 2002-10-25 02:56:07 UTC
Responsible-Changed-From-To: unassigned->paolo
Responsible-Changed-Why: Analyzing.
Comment 2 Paolo Carlini 2002-10-25 02:56:07 UTC
State-Changed-From-To: open->feedback
State-Changed-Why: For some reason the attachment got lost. Could you possibly
    provide it again?
    Thanks, Paolo.
Comment 3 Paolo Carlini 2002-10-25 03:38:26 UTC
State-Changed-From-To: feedback->analyzed
State-Changed-Why: Attachment provided.
Comment 4 adamwilkshire 2002-10-25 10:09:05 UTC
From: "Adam Wilkshire" <adamwilkshire@hotmail.com>
To: paolo@gcc.gnu.org, adamwilkshire@hotmail.com, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: c++/8347: empty vector range used in string construction causes core dump.
Date: Fri, 25 Oct 2002 10:09:05 +0000

 This is a multi-part message in MIME format.
 
 ------=_NextPart_000_38b4_2e69_7e42
 Content-Type: text/html
 
 <html><div style='background-color:'><DIV>
 <P>Ok, here as text and attachment. </P>
 <P><BR>#include &lt;iostream&gt;<BR>#include &lt;vector&gt;<BR>#include &lt;string&gt;</P>
 <P>int main(int argc,char** argv){<BR>&nbsp; std::vector&lt;char&gt; empty;<BR>&nbsp; std::string empty2(empty.begin(),empty.end());<BR>&nbsp; std::cout&lt;&lt;"done"&lt;&lt;std::endl;<BR>}</P></DIV>
 <DIV></DIV></div><br clear=all><hr>Unlimited Internet access -- and 2 months free!  Try MSN. <a href="http://g.msn.com/8HMDEN/2020">Click Here</a> </html>
 ------=_NextPart_000_38b4_2e69_7e42
 Content-Type: application/octet-stream; name="temp7.cc"
 Content-Transfer-Encoding: base64
 Content-Disposition: attachment; filename="temp7.cc"
 
 I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVk
 ZSA8c3RyaW5nPgoKaW50IG1haW4oaW50IGFyZ2MsY2hhcioqIGFyZ3Ypewog
 IHN0ZDo6dmVjdG9yPGNoYXI+IGVtcHR5OwogIHN0ZDo6c3RyaW5nIGVtcHR5
 MihlbXB0eS5iZWdpbigpLGVtcHR5LmVuZCgpKTsKICBzdGQ6OmNvdXQ8PCJk
 b25lIjw8c3RkOjplbmRsOwp9Cg==
 
 
 ------=_NextPart_000_38b4_2e69_7e42--
Comment 5 pcarlini 2002-10-25 12:47:49 UTC
From: Paolo Carlini <pcarlini@unitus.it>
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: libstdc++/8347: empty vector range used in string construction
 causes core dump.
Date: Fri, 25 Oct 2002 12:47:49 +0200

 #include <iostream>
 #include <vector>
 #include <string>
 
 int main(int argc,char** argv){
    std::vector<char> empty;
    std::string empty2(empty.begin(),empty.end());
    std::cout<<"done"<<std::endl;
 }
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8347
 

Comment 6 Paolo Carlini 2002-10-27 07:35:07 UTC
From: paolo@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: libstdc++/8347
Date: 27 Oct 2002 07:35:07 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Changes by:	paolo@gcc.gnu.org	2002-10-27 00:35:07
 
 Modified files:
 	libstdc++-v3   : ChangeLog 
 	libstdc++-v3/testsuite/21_strings: ctor_copy_dtor.cc 
 	libstdc++-v3/include/bits: basic_string.tcc 
 
 Log message:
 	2002-10-27  Paolo Carlini  <pcarlini@unitus.it>
 	
 	PR libstdc++/8347
 	* include/bits/basic_string.tcc
 	(string::_S_construct(_InIter, _InIter, const _Alloc&,
 	forward_iterator_tag)): Do not throw logic error if
 	__beg == NULL && __end == __beg.
 	(string::string(const _CharT*, const _Alloc&)): Tweak.
 	* testsuite/21_strings/ctor_copy_dtor.cc: Add test05 from PR.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&r1=1.1403&r2=1.1404
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/21_strings/ctor_copy_dtor.cc.diff?cvsroot=gcc&r1=1.10&r2=1.11
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/basic_string.tcc.diff?cvsroot=gcc&r1=1.25&r2=1.26
 
Comment 7 Paolo Carlini 2002-10-29 00:10:02 UTC
State-Changed-From-To: analyzed->closed
State-Changed-Why: Fixed for 3.2.1 and 3.3.
Comment 8 Paolo Carlini 2002-10-29 08:08:40 UTC
From: paolo@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: libstdc++/8347
Date: 29 Oct 2002 08:08:40 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Branch: 	gcc-3_2-branch
 Changes by:	paolo@gcc.gnu.org	2002-10-29 00:08:40
 
 Modified files:
 	libstdc++-v3   : ChangeLog 
 	libstdc++-v3/testsuite/21_strings: ctor_copy_dtor.cc 
 	libstdc++-v3/include/bits: basic_string.tcc 
 
 Log message:
 	2002-10-29  Paolo Carlini  <pcarlini@unitus.it>
 	
 	PR libstdc++/8347
 	* include/bits/basic_string.tcc
 	(string::_S_construct(_InIter, _InIter, const _Alloc&,
 	forward_iterator_tag)): Do not throw logic error if
 	__beg == NULL && __end == __beg.
 	(string::string(const _CharT*, const _Alloc&)): Tweak.
 	* testsuite/21_strings/ctor_copy_dtor.cc: Add test05 from PR.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.1057.2.159.2.38&r2=1.1057.2.159.2.39
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/21_strings/ctor_copy_dtor.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.8.14.2&r2=1.8.14.2.2.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/basic_string.tcc.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.20.2.5&r2=1.20.2.5.2.1