[Bug libstdc++/35969] GLIBCXX_DEBUG: list::merge triggers bad assert
--- Comment #7 from paolo at gcc dot gnu dot org 2008-04-24 17:03 --- Subject: Bug 35969 Author: paolo Date: Thu Apr 24 17:03:13 2008 New Revision: 134642 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=134642 Log: 2008-04-24 Paolo Carlini [EMAIL PROTECTED] PR libstdc++/35969 * include/debug/list (merge): Use _M_transfer_iter, consistently with the splice members. * testsuite/23_containers/list/operations/35969.cc: New. * testsuite/23_containers/list/operators: Rename to testsuite/23_containers/list/operations. Added: trunk/libstdc++-v3/testsuite/23_containers/list/operations/ - copied from r134503, trunk/libstdc++-v3/testsuite/23_containers/list/operators/ trunk/libstdc++-v3/testsuite/23_containers/list/operations/35969.cc Removed: trunk/libstdc++-v3/testsuite/23_containers/list/operators/ Modified: trunk/libstdc++-v3/ChangeLog trunk/libstdc++-v3/include/debug/list -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35969
[Bug libstdc++/35969] GLIBCXX_DEBUG: list::merge triggers bad assert
--- Comment #8 from pcarlini at suse dot de 2008-04-24 17:05 --- Fixed for 4.4.0. -- pcarlini at suse dot de changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED Target Milestone|--- |4.4.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35969
[Bug libstdc++/35969] GLIBCXX_DEBUG: list::merge triggers bad assert
--- Comment #6 from pcarlini at suse dot de 2008-04-21 00:46 --- According to the resolution of DR 250, http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#250 indeed splicing doesn't really invalidate iterators. Therefore, the debug-mode merge should be consistent with that behavior. The fix seems easy... -- pcarlini at suse dot de changed: What|Removed |Added AssignedTo|unassigned at gcc dot gnu |pcarlini at suse dot de |dot org | Status|UNCONFIRMED |ASSIGNED Ever Confirmed|0 |1 Last reconfirmed|-00-00 00:00:00 |2008-04-21 00:46:07 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35969
[Bug libstdc++/35969] GLIBCXX_DEBUG: list::merge triggers bad assert
--- Comment #1 from greened at obbligato dot org 2008-04-18 03:12 --- Created an attachment (id=15493) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15493action=view) Preprocessed source -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35969
[Bug libstdc++/35969] GLIBCXX_DEBUG: list::merge triggers bad assert
--- Comment #2 from greened at obbligato dot org 2008-04-18 03:13 --- Created an attachment (id=15494) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15494action=view) Unpreprocessed source Includes comments describing the problem. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35969
[Bug libstdc++/35969] GLIBCXX_DEBUG: list::merge triggers bad assert
--- Comment #3 from pinskia at gcc dot gnu dot org 2008-04-18 03:23 --- I don't know if the SGI website has been updated to take into account what the C++ standard says. Since STL was originally from HP/SGI, that page is old and might not reflect reality any more. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35969
[Bug libstdc++/35969] GLIBCXX_DEBUG: list::merge triggers bad assert
--- Comment #4 from greened at obbligato dot org 2008-04-18 03:26 --- Subject: Re: GLIBCXX_DEBUG: list::merge triggers bad assert pinskia at gcc dot gnu dot org wrote: --- Comment #3 from pinskia at gcc dot gnu dot org 2008-04-18 03:23 --- I don't know if the SGI website has been updated to take into account what the C++ standard says. Since STL was originally from HP/SGI, that page is old and might not reflect reality any more. Sure. But not everyone has a copy of the standard. :) Can we get a ruling on this? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35969
[Bug libstdc++/35969] GLIBCXX_DEBUG: list::merge triggers bad assert
--- Comment #5 from greened at obbligato dot org 2008-04-18 04:16 --- Ok, the closest thing I could find is the 1998 draft standard: http://www.kuzbass.ru:8086/docs/isocpp/lib-containers.html#lib.sequences It says that splice invalidates only the iterators and references to the spliced elements. There is no statement about iterators for merge. So it seems like the testcase is invalid not due to the merge but due to the splices. GLIBCXX_DEBUG mode doesn't catch the problem with the splices since the iterator is still considered valid after the splice. For example, the second splce doesn't assert on an invalid iterator being passed to it. Perhaps this was changed in the final standard. It seems odd to me that splice and merge would invalidate iterators as iterator stability is a prime reason for using std::list and these operations don't destroy any sequence values. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35969