From stdcxx-dev-return-5440-apmail-incubator-stdcxx-dev-archive=incubator.apache.org@incubator.apache.org Thu Oct 11 16:15:13 2007 Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 89808 invoked from network); 11 Oct 2007 16:15:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Oct 2007 16:15:11 -0000 Received: (qmail 90467 invoked by uid 500); 11 Oct 2007 16:14:59 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 90456 invoked by uid 500); 11 Oct 2007 16:14:59 -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 90445 invoked by uid 99); 11 Oct 2007 16:14:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Oct 2007 09:14:59 -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, 11 Oct 2007 16:15:11 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id B6F5771420E for ; Thu, 11 Oct 2007 09:14:50 -0700 (PDT) Message-ID: <12078960.1192119290746.JavaMail.jira@brutus> Date: Thu, 11 Oct 2007 09:14:50 -0700 (PDT) From: "Martin Sebor (JIRA)" To: stdcxx-dev@incubator.apache.org Subject: [jira] Commented: (STDCXX-314) std::valarray unary operators use uninitialized storage In-Reply-To: <31391112.1168027227814.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-314?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12534079 ] Martin Sebor commented on STDCXX-314: ------------------------------------- Doh! It most likely does. I missed it. > std::valarray unary operators use uninitialized storage > ------------------------------------------------------- > > Key: STDCXX-314 > URL: https://issues.apache.org/jira/browse/STDCXX-314 > Project: C++ Standard Library > Issue Type: Bug > Components: 26. Numerics > Affects Versions: 4.1.2, 4.1.3 > Environment: all > Reporter: Martin Sebor > Assignee: Martin Sebor > Fix For: 4.2 > > > The program below is designed to detect memory corruption (such as the use of uninitialized storage) in valarray. When compiled with the latest trunk it aborts at runtime. > $ cat t.cpp && make t && ./t > #include > #include > struct S { > const S* const self; > S (): self (this) { } > S (const S &s): self (this) { assert (&s == s.self); } > ~S () { assert (this == self); } > S operator+ () const { assert (this == self); return *this; } > S operator- () const { assert (this == self); return *this; } > S operator~ () const { assert (this == self); return *this; } > bool operator! () const { assert (this == self); return false; } > void operator= (const S &s) { assert (this == self && &s == s.self); } > }; > int main () > { > const std::valarray a (2); > +a; > -a; > ~a; > !a; > } > gcc -c -I/build/sebor/dev/stdlib/include/ansi -D_RWSTDDEBUG -D_RWSTD_USE_CONFIG -I/build/sebor/dev/stdlib/include -I/build/sebor/gcc-4.1.0-11s/include -I/build/sebor/dev/stdlib/examples/include -pedantic -nostdinc++ -g -W -Wall -Wcast-qual -Winline -Wshadow -Wwrite-strings -Wno-long-long t.cpp > gcc t.o -o t -L/build/sebor/gcc-4.1.0-11s/lib -lstd11s -lsupc++ -lm > Assertion failed: this == self && &s == s.self, file t.cpp, line 15 > Abort (core dumped) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.