Opened 10 years ago

Closed 10 years ago

#7471 closed Bugs (fixed)

crash in unordered_multimap::erase(iterator, iterator) function

Reported by: Steven Li <steven.li@…> Owned by: Daniel James
Milestone: To Be Determined Component: unordered
Version: Boost 1.51.0 Severity: Problem
Keywords: Cc:

Description

The above function seems to corrupt the unordered_multimap data structure and eventually crashes the program.

See the attached simple program to show the problem. Run with "unordered_map 1000", I got segfault when running it.

Attachments (3)

unordered_bug.cxx (1.3 KB ) - added by Steven Li <steven.li@…> 10 years ago.
small C++ program to show the crash.
erase.patch (1.6 KB ) - added by Daniel James 10 years ago.
Updated trunk patch
erase-1.51.patch (1.7 KB ) - added by Daniel James 10 years ago.
Updated patch for 1.51

Download all attachments as: .zip

Change History (10)

by Steven Li <steven.li@…>, 10 years ago

Attachment: unordered_bug.cxx added

small C++ program to show the crash.

comment:1 by kdk <kdkomsdev@…>, 10 years ago

Hi,

I tried executing the attached program in my system cygwin(win32/g++ (GCC) 4.5.3/boost 1.51.0) with the input as 1000 but the program did not give any segmentation fault.

comment:2 by John Maddock, 10 years ago

Component: TR1unordered
Owner: changed from John Maddock to Daniel James

comment:3 by soren.soe@…, 10 years ago

Hi,

I have tried this program on my Linux *64* bit platform (-m64) using gcc 4.1.2 and gcc 4.6.2 and it fails for me with both compilers. It does *not* fail when I compile on a 32 bit platform or with -m32. Hope this helps.

Thanks, Soren Soe

comment:4 by Daniel James, 10 years ago

Status: newassigned

I've attached a patch against trunk, will commit a fix with tests soon-ish.

comment:5 by Daniel James, 10 years ago

(In [80894]) Unordered: Fix bug when erasing a range, refs #7471.

by Daniel James, 10 years ago

Attachment: erase.patch added

Updated trunk patch

by Daniel James, 10 years ago

Attachment: erase-1.51.patch added

Updated patch for 1.51

comment:6 by Steven Li <steven.li@…>, 10 years ago

I tried out the patch and it works. Thanks for quick fix!

comment:7 by Daniel James, 10 years ago

Resolution: fixed
Status: assignedclosed

(In [80958]) Unordered: Fix erasing ranges, and some tests. Fixes #7471

Note: See TracTickets for help on using tickets.