Return-Path: Delivered-To: apmail-stdcxx-issues-archive@locus.apache.org Received: (qmail 39231 invoked from network); 16 Mar 2008 23:13:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Mar 2008 23:13:09 -0000 Received: (qmail 59025 invoked by uid 500); 16 Mar 2008 23:13:06 -0000 Delivered-To: apmail-stdcxx-issues-archive@stdcxx.apache.org Received: (qmail 59013 invoked by uid 500); 16 Mar 2008 23:13:06 -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 59004 invoked by uid 99); 16 Mar 2008 23:13:06 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 16 Mar 2008 16:13:06 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 16 Mar 2008 23:12:26 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 47A62234C099 for ; Sun, 16 Mar 2008 16:11:24 -0700 (PDT) Message-ID: <97622036.1205709084278.JavaMail.jira@brutus> Date: Sun, 16 Mar 2008 16:11:24 -0700 (PDT) From: "Farid Zaripov (JIRA)" To: issues@stdcxx.apache.org Subject: [jira] Commented: (STDCXX-769) __rw_debug_iter iterators are partially invalidated after swap() operation In-Reply-To: <321070025.1205645904370.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-769?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12579276#action_12579276 ] Farid Zaripov commented on STDCXX-769: -------------------------------------- Then we should eliminate the debugging iterators at all, because all checks in it's members are using pointer to associated container and this pointer becomes invalid after swap operation. > __rw_debug_iter iterators are partially invalidated after swap() operation > -------------------------------------------------------------------------- > > Key: STDCXX-769 > URL: https://issues.apache.org/jira/browse/STDCXX-769 > Project: C++ Standard Library > Issue Type: Bug > Components: 24. Iterators > Affects Versions: 4.1.2, 4.1.3, 4.1.4, 4.2.0 > Environment: All > Reporter: Farid Zaripov > Priority: Minor > > The __rw_debug_iter class contains pointer to associated container. After swap() operation the __rw_debug_iter iterators, obtained from container method (i.e. begin()) are associated with another container variable. Due to this any operation between iterators, obtained before swap and after swap will fail on assert (except operator==(), maybe some others). > The testcase: > {code:title=test.cpp} > #include > #include > int main () > { > typedef std::vector Vector; > typedef Vector::iterator Iter; > Vector v1, v2; > v1.push_back (1); > Iter v1_begin = v1.begin (); > v1.swap (v2); > assert (v1_begin == v2.begin ()); > assert (0 == v1_begin - v2.begin ()); > return 0; > }; > {code} > The testcase result: > {noformat} > rw/_iterbase.h:527: int __thiscall __rw::__rw_debug_iter >,int *,int *>::operator -(const class __rw::__rw_debug_iter >,int *,int *> &) const: Assertion '_C_cont && _C_cont == __rhs._C_cont' failed. > This application has requested the Runtime to terminate it in an unusual way. > Please contact the application's support team for more information. > {noformat} -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.