Opened 14 years ago

Closed 14 years ago

#2339 closed Bugs (fixed)

segment manager releases memory used for an intrusive node before it's erased from the index

Reported by: Devin Bayer <web@…> Owned by: Ion Gaztañaga
Milestone: Boost 1.37.0 Component: interprocess
Version: Boost 1.36.0 Severity: Showstopper
Keywords: Cc:

Description

If these are true:

(1) use an intrusive index with managed memory segments (2) construct an object and have the constructor throw

Then you will get random segfaults. This is because memory used for the node in the intrusive index is freed before that node is removed from the index. Then that memory may get overwritten (by the allocation node eraser) and when the node is removed unexpected things happen.

The solution is to apply this patch, so that the «value_eraser» is created after the «mem_algo_deallocator» and hence their destructors are called in the proper order.

Attachments (1)

boost-destruction-order-fix.diff (1.2 KB ) - added by Devin Bayer <web@…> 14 years ago.
boost-destruction-order-fix.diff

Download all attachments as: .zip

Change History (2)

by Devin Bayer <web@…>, 14 years ago

boost-destruction-order-fix.diff

comment:1 by Ion Gaztañaga, 14 years ago

Resolution: fixed
Status: newclosed

Fixed in Boost 1.37

Note: See TracTickets for help on using tickets.