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: | 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.
boost-destruction-order-fix.diff