Modify

Ticket #7471 (closed Bugs: fixed)

Opened 19 months ago

Last modified 19 months ago

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

Reported by: Steven Li <steven.li@…> Owned by: danieljames
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

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

Change History

Changed 19 months ago by Steven Li <steven.li@…>

small C++ program to show the crash.

comment:1 Changed 19 months ago by kdk <kdkomsdev@…>

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 Changed 19 months ago by johnmaddock

  • Owner changed from johnmaddock to danieljames
  • Component changed from TR1 to unordered

comment:3 Changed 19 months ago by soren.soe@…

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 Changed 19 months ago by danieljames

  • Status changed from new to assigned

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

comment:5 Changed 19 months ago by danieljames

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

Changed 19 months ago by danieljames

Updated trunk patch

Changed 19 months ago by danieljames

Updated patch for 1.51

comment:6 Changed 19 months ago by Steven Li <steven.li@…>

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

comment:7 Changed 19 months ago by danieljames

  • Status changed from assigned to closed
  • Resolution set to fixed

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

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.