Will Your Code Survive the Attack of the Zombie Pointers?
summary
C and C++ currently make any pointer to an object invalid at the end of that object’s lifetime, which breaks long‑standing concurrent patterns such as Smith and Brown 1973 LIFO and lock‑free push/pop sequences that rely on ABA and pointer reuse. Examples include a push/pop/pop_all sequence that produces a resurrected address and hazard‑pointer readers that observe reclaimed memory. Compilers disagree (GCC 8.1, Intel 19, Clang 6 produced different results at -O2), and proposed fixes range from limiting to allocated storage duration to C11 atomics/inline asm exemptions, annotations, or tool‑level workarounds; practical advice: hide allocators, use inline asm, and add detection tools.
AI-written summary · about
related talks
01h 11mLock-Free Programming (or, Juggling Razor Blades), Part II
52mCuriously Recurring C++ Bugs at Facebook
51mMemory Model: Get your shared data under control
55m“A lock-free concurrency toolkit for deferred reclamation and optimistic speculation"
01h 11mProgramming language memory models: Problems, solutions, and directions
01h 03mSafety: off --- How not to shoot yourself in the foot with C++ atomics
40mImmutable Data Structures in C++
01h 28mC++ Memory Model: from C++11 to C++23
