Return-Path: X-Original-To: apmail-stdcxx-issues-archive@minotaur.apache.org Delivered-To: apmail-stdcxx-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CD14D96BF for ; Mon, 6 Feb 2012 03:18:43 +0000 (UTC) Received: (qmail 16114 invoked by uid 500); 6 Feb 2012 03:18:43 -0000 Delivered-To: apmail-stdcxx-issues-archive@stdcxx.apache.org Received: (qmail 16074 invoked by uid 500); 6 Feb 2012 03:18:41 -0000 Mailing-List: contact issues-help@stdcxx.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@stdcxx.apache.org Delivered-To: mailing list issues@stdcxx.apache.org Received: (qmail 16060 invoked by uid 99); 6 Feb 2012 03:18:37 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Feb 2012 03:18:37 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Feb 2012 03:18:32 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id B0A861A50E6 for ; Mon, 6 Feb 2012 03:18:11 +0000 (UTC) Date: Mon, 6 Feb 2012 03:18:11 +0000 (UTC) From: "Stefan Teleman (Updated) (JIRA)" To: issues@stdcxx.apache.org Message-ID: <1842668414.667.1328498291771.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1061005673.662.1328498043843.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (STDCXX-1060) std::basic_string::append(char*, pos) SIGSEGV for pos == std::string::npos MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/STDCXX-1060?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Stefan Teleman updated STDCXX-1060: ----------------------------------- Patch Info: Patch Available > std::basic_string::append(char*, pos) SIGSEGV for pos == std::string::npos > -------------------------------------------------------------------------- > > Key: STDCXX-1060 > URL: https://issues.apache.org/jira/browse/STDCXX-1060 > Project: C++ Standard Library > Issue Type: Bug > Components: 21. Strings > Affects Versions: 4.2.1, 4.2.x, 4.3.x, 5.0.0 > Environment: Solaris 10 and 11 > Red Hat Linux, OpenSuSE Linux > Sun C++ Compiler 12.1, 12.2, 12.3 > Defect is independent of platform/compiler > Reporter: Stefan Teleman > Labels: conformance, segmenation_fault, standards > Fix For: 4.2.2, 4.2.x, 4.3.x, 5.0.0 > > Attachments: stdcxx-1060.patch, test.cc > > > std::basic_string::append(char*, pos) SIGSEGV for pos == std::string::npos: > {code:title=test.cc|borderStyle=solid} > #include > #include > #include > int main() > { > const char* c = "hello"; > std::string s(5, '*'); > std::string t; > int ret; > try > { > t = s.append(c, std::string::npos); > } > catch (std::length_error& e) > { > ret = 0; > } > catch ( ... ) > { > std::cerr << "wrong exception was thrown!" << std::endl; > ret = 1; > } > std::cerr << "t: " << t.c_str() << std::endl; > std::cerr << "s: " << s.c_str() << std::endl; > return ret; > } > {code} > 1. Output from GCC 4.5.0: > {noformat} > [steleman@darthvader][/src/steleman/programming/stdcxx-ss122/bugfixes-sunw/6889785][02/05/2012 21:56:30][2023]>> ./test-gcc > t: > s: ***** > [steleman@darthvader][/src/steleman/programming/stdcxx-ss122/bugfixes-sunw/6889785][02/05/2012 22:04:45][2024]>> echo $status > 0 > {noformat} > 2. Output from Sun C++ 12.2 with stlport: > {noformat} > [steleman@darthvader][/src/steleman/programming/stdcxx-ss122/bugfixes-sunw/6889785][02/05/2012 22:04:47][2025]>> ./test-ss122-stlport > t: > s: ***** > [steleman@darthvader][/src/steleman/programming/stdcxx-ss122/bugfixes-sunw/6889785][02/05/2012 22:04:53][2026]>> echo $status > 0 > {noformat} > 3. Output from Sun C++ 12.2 with our patched stdcxx: > {noformat} > [steleman@darthvader][/src/steleman/programming/stdcxx-ss122/bugfixes-sunw/6889785][02/05/2012 22:04:55][2027]>> ./test-ss122-stdcxx > t: > s: ***** > [steleman@darthvader][/src/steleman/programming/stdcxx-ss122/bugfixes-sunw/6889785][02/05/2012 22:05:00][2028]>> echo $status > 0 > {noformat} > 4. Output from Pathscale 4.0.12.1 (which did not patch stdcxx): > {noformat} > [steleman@darthvader][/src/steleman/programming/stdcxx-ss122/bugfixes-sunw/6889785][02/05/2012 22:05:02][2029]>> ./test-pathscale > Segmentation fault (core dumped) > [steleman@darthvader][/src/steleman/programming/stdcxx-ss122/bugfixes-sunw/6889785][02/05/2012 22:05:08][2030]>> echo $status > 139 > {noformat} > Defect is in file include/string, line 874. > Patch for stdcxx 4.2.1 to follow shortly. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira