From owner-freebsd-bugs@FreeBSD.ORG Fri Aug 1 10:00:11 2014 Return-Path: Delivered-To: freebsd-bugs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 08523E25 for ; Fri, 1 Aug 2014 10:00:11 +0000 (UTC) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E50B625D8 for ; Fri, 1 Aug 2014 10:00:10 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.8/8.14.8) with ESMTP id s71A0Av9085326 for ; Fri, 1 Aug 2014 10:00:10 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 192303] New: C++11 std::list<>::remove_if() visits elements multiple times Date: Fri, 01 Aug 2014 10:00:11 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 10.0-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: kamikaze@bsdforen.de X-Bugzilla-Status: Needs Triage X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Aug 2014 10:00:11 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=192303 Bug ID: 192303 Summary: C++11 std::list<>::remove_if() visits elements multiple times Product: Base System Version: 10.0-STABLE Hardware: amd64 OS: Any Status: Needs Triage Severity: Affects Many People Priority: --- Component: bin Assignee: freebsd-bugs@FreeBSD.org Reporter: kamikaze@bsdforen.de Created attachment 145205 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=145205&action=edit Bug demo When calling std::list<>::remove_if() with a lambda for the condition (I did not test without lambdas), it visits the list entry *following* a delete twice. Attached is a demo of the bug. The number of visits should be 10: # ./main Initial list: 0 1 2 3 4 5 6 7 8 9 Remove odd numbers ... | val | remove |-----|-------- | 0 | | 1 | X | 2 | | 2 | | 3 | X | 4 | | 4 | | 5 | X | 6 | | 6 | | 7 | X | 8 | | 8 | | 9 | X Updated list: 0 2 4 6 8 Visits: 14 Build the test program with: # make CXX="c++ -std=c++11" main -- You are receiving this mail because: You are the assignee for the bug.