mirror of
https://github.com/mutouyun/cpp-ipc.git
synced 2025-12-06 16:56:45 +08:00
- Problem: calling h2.release() followed by shm::remove(id) causes use-after-free - h2.release() internally calls shm::release(id) which frees the id structure - shm::remove(id) then accesses the freed id pointer -> crash - Solution: detach the id from handle first, then call shm::remove(id) - h2.detach() returns the id without releasing it - shm::remove(id) can then safely clean up both memory and disk file - This completes the fix for all ShmTest double-free issues |
||
|---|---|---|
| .. | ||
| archive | ||
| CMakeLists.txt | ||
| test_buffer.cpp | ||
| test_condition.cpp | ||
| test_ipc_channel.cpp | ||
| test_locks.cpp | ||
| test_mutex.cpp | ||
| test_semaphore.cpp | ||
| test_shm.cpp | ||