arximboldi / immer

Postmodern immutable and persistent data structures for C++ — value semantics at scale
https://sinusoid.es/immer
Boost Software License 1.0
2.51k stars 186 forks source link

Double Free issue #52

Closed nwerensteijn closed 6 years ago

nwerensteijn commented 6 years ago

While working with immer::map I ran into a double free issue.

In immer/detail/hamts/node.hpp the functions _static void delete_values(values_t p, countt n) and _static void delete_collision(node_t p)_ call _destroyn and then _deallocatevalues / _deallocatecollission which then again call _destroyn on the same data.

arximboldi commented 6 years ago

Oh... thanks! That is related to a quick fix for a leak that was recently rushed. Can you provide a small example of the double-free?

I wil fix ASAP.

-- ∿∿∿ https://sinusoid.al ∿∿∿ https://sinusoid.es

nwerensteijn commented 6 years ago

While writing a test case to show the issue, I noticed this bug was actually caused by a fix we did, probably for the leak you mentioned. Very sorry to have wasted your time.

arximboldi commented 6 years ago

No worries! I am glad it is not a problem :smiley_cat: