nim-lang / threading

New atomics, thread primitives, atomic refcounting for --gc:arc/orc.
MIT License
73 stars 12 forks source link

Test and Fixed for SharedPtr leak #46

Closed elcritch closed 1 year ago

elcritch commented 1 year ago

See #45.

elcritch commented 1 year ago

@Araq any word on this?

It'd be nice to get the standard repo stable since I am also getting memory allocator corruption when using the master branch.

I suspect use after frees. I don't have the time to prove it, but this branch works like a charm.

There's probably a sequence where one thread gets 0 thinking its ready to free, but before doing so another takes it's first copy that'd lead to a double free or use-after-free.

Araq commented 1 year ago

Rename it back to val please.

elcritch commented 1 year ago

Rename it back to val please.

Ah, that was my favorite part. Ok done.