Modify

Opened 8 years ago

Closed 8 years ago

#2689 closed Bugs (fixed)

Unordered containers: cache_begin not compatible with auto_unlink

Reported by: andysem Owned by: igaztanaga
Milestone: Boost 1.39.0 Component: intrusive
Version: Boost 1.37.0 Severity: Problem
Keywords: unordered cache_begin auto_unlink Cc:

Description

It looks like using cache_begin< true > option with unordered containers with link_mode< auto_unlink > can lead to subtle crashes in run time. Supposedly, the problem appears when the leading node of the container (the one that is pointed to by begin()) is deleted without explicitly erasing the element from the container. In that case begin() returns an iterator to a non-existing element.

This issue is not highlighted in the docs or checked in the code. It would be great if the container checked this options combination and did not compile in the first place.

Attachments (0)

Change History (1)

comment:1 Changed 8 years ago by igaztanaga

  • Milestone changed from Boost 1.38.0 to Boost 1.39.0
  • Resolution set to fixed
  • Status changed from new to closed

Static assertion added to check it at compile time and also a note in the documentation. Revision 51971 in trunk.

Add Comment

Modify Ticket

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