[Bug c++/17012] std::list's function, remove, looks like it is reading memory that has been freed.

pcarlini at suse dot de gcc-bugzilla@gcc.gnu.org
Thu Aug 12 20:11:00 GMT 2004


------- Additional Comments From pcarlini at suse dot de  2004-08-12 20:11 -------
Hummm, I can "confirm" this on x86 with Valgrind:

==28990== Invalid read of size 4
==28990==    at 0x8048F73: std::list<int, std::allocator<int> >::remove(int
const&) (list.tcc:181)
==28990==    by 0x8048BFA: main (17012.cc:22)
==28990==    by 0x40365E45: __libc_start_main (libc-start.c:225)
==28990==    by 0x8048850: ??? (start.S:102)
==28990==    Address 0x4187C0A4 is 8 bytes inside a block of size 12 free'd
==28990==    at 0x4002BDED: __builtin_delete (vg_replace_malloc.c:244)
==28990==    by 0x4002BE18: operator delete(void*) (vg_replace_malloc.c:253)
==28990==    by 0x804923C: __gnu_cxx::new_allocator<std::_List_node<int>
>::deallocate(std::_List_node<int>*, unsigned) (new_allocator.h:86)
==28990==    by 0x8049195: std::_List_base<int, std::allocator<int>
>::_M_put_node(std::_List_node<int>*) (stl_list.h:313)


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-08-12 20:11:36
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17012



More information about the Gcc-bugs mailing list