Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 76014 invoked from network); 9 Aug 2007 14:46:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Aug 2007 14:46:06 -0000 Received: (qmail 41012 invoked by uid 500); 9 Aug 2007 14:46:05 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 40992 invoked by uid 500); 9 Aug 2007 14:46:05 -0000 Mailing-List: contact stdcxx-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: stdcxx-dev@incubator.apache.org Delivered-To: mailing list stdcxx-dev@incubator.apache.org Received: (qmail 40848 invoked by uid 99); 9 Aug 2007 14:46:04 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Aug 2007 07:46:04 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Aug 2007 14:46:04 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 1AE5F7141FC for ; Thu, 9 Aug 2007 07:45:43 -0700 (PDT) Message-ID: <28047637.1186670743084.JavaMail.jira@brutus> Date: Thu, 9 Aug 2007 07:45:43 -0700 (PDT) From: "Farid Zaripov (JIRA)" To: stdcxx-dev@incubator.apache.org Subject: [jira] Closed: (STDCXX-514) basic_stringbuf<>::str() deallocating external buffer In-Reply-To: <2352596.1186667742787.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/STDCXX-514?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Farid Zaripov closed STDCXX-514. -------------------------------- The regression test added: http://svn.apache.org/viewvc?view=rev&rev=564228 > basic_stringbuf<>::str() deallocating external buffer > ----------------------------------------------------- > > Key: STDCXX-514 > URL: https://issues.apache.org/jira/browse/STDCXX-514 > Project: C++ Standard Library > Issue Type: Bug > Components: 27. Input/Output > Affects Versions: 4.1.3 > Environment: All > Reporter: Farid Zaripov > Assignee: Farid Zaripov > Fix For: 4.2 > > > The program below aborts due to deallocating the external buffer extbuf. > test.cpp: > ------------------ > #include // for stringbuf > #include // for allocator > #include // for assert() > char extbuf [3]; > struct MyAlloc : std::allocator > { > pointer allocate (size_type __n, std::allocator::const_pointer = 0) { > return new char [__n]; > } > void deallocate (pointer __p, size_type) > { > assert (extbuf != __p); > delete [] __p; > } > }; > int main () > { > std::basic_stringbuf , MyAlloc> sbuf; > sbuf.pubsetbuf (extbuf, sizeof (extbuf)); > const char* str = "abcdef"; > sbuf.str (str); > assert (sbuf.str () == str); > return 0; > } > ------------------ > The test output: > ------------------ > test: test.cpp:16: void MyAlloc::deallocate(char*, unsigned int): Assertion `extbuf != __p' failed. > Aborted > ------------------ -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.