Modify

Opened 5 years ago

Closed 5 years ago

#7471 closed Bugs (fixed)

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 (3)

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

Download all attachments as: .zip

Change History (10)

Changed 5 years ago by Steven Li <steven.li@…>

small C++ program to show the crash.

comment:1 Changed 5 years 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 5 years ago by johnmaddock

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

comment:3 Changed 5 years 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 5 years 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 5 years ago by danieljames

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

Changed 5 years ago by danieljames

Updated trunk patch

Changed 5 years ago by danieljames

Updated patch for 1.51

comment:6 Changed 5 years ago by Steven Li <steven.li@…>

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

comment:7 Changed 5 years ago by danieljames

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

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

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain danieljames.
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.