Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 22154 invoked from network); 29 May 2007 17:22:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 May 2007 17:22:43 -0000 Received: (qmail 41935 invoked by uid 500); 29 May 2007 17:22:42 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 41925 invoked by uid 500); 29 May 2007 17:22:42 -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 41900 invoked by uid 99); 29 May 2007 17:22:42 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 May 2007 10:22:42 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of Farid_Zaripov@epam.com designates 217.21.63.3 as permitted sender) Received: from [217.21.63.3] (HELO EPMSA009.epam.com) (217.21.63.3) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 May 2007 10:22:37 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [PATCH] RE: [jira] Created: (STDCXX-427) SIGSEGV in istringstream::str() Date: Tue, 29 May 2007 20:22:14 +0300 Message-ID: <7BDB2168BEAEF14C98F1901FD2DE643886952B@epmsa009.minsk.epam.com> In-Reply-To: <465779AD.4020201@roguewave.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH] RE: [jira] Created: (STDCXX-427) SIGSEGV in istringstream::str() Thread-Index: AcefKXzWWvGeMipMScC9BBxm12L/CQC6ml7Q References: <26166494.1179958456146.JavaMail.jira@brutus> <7BDB2168BEAEF14C98F1901FD2DE6438868EBF@epmsa009.minsk.epam.com> <46563921.8030505@roguewave.com> <7BDB2168BEAEF14C98F1901FD2DE6438869047@epmsa009.minsk.epam.com> <465779AD.4020201@roguewave.com> From: "Farid Zaripov" To: X-Virus-Checked: Checked by ClamAV on apache.org > -----Original Message----- > From: Martin Sebor [mailto:sebor@roguewave.com]=20 > Sent: Saturday, May 26, 2007 3:05 AM > To: stdcxx-dev@incubator.apache.org > Subject: Re: [PATCH] RE: [jira] Created: (STDCXX-427) SIGSEGV=20 > in istringstream::str() >=20 > > The bug is in that len calculated as highmark - pbase(),=20 > but pbase()=20 > > =3D=3D 0 when buffer opened only in input mode. The begin of=20 > the buffer is=20 > > always > > this->_C_buffer with any openmode. So len =3D highmark - _C_buffer = is > > correct, I think. >=20 > In input mode (only) the function is supposed to return: >=20 > string(eback(), egptr()); >=20 > In output mode (or input | output) the function must return: >=20 > string(pbase(), high_mark); >=20 > So unless I'm missing something the program below should be a=20 > valid (albeit incomplete) test case. Let me know what you think. Formally the test case is valid, but logically, I think, the buffer pointers and the buffer itself should be in consistency, and in this test eback() and pbase() are changed from the real begin of the buffer of the std::stringbuf. Farid.