4 ms·
One of the trickiest segfaults I tracked down: We had this old and stable code that was writing and reading from some shared memory. One day out of the blue it
by mindvirus 6y ago
One of the trickiest segfaults I tracked down:
We had this old and stable code that was writing and reading from some shared memory. One day out of the blue it started deadlocking and segfaulting, even with no recent changes to it.
It turned out to be an educational sequence of events:
- the library for daemonizing processes had a bug - it closed stdout but didn't open to /dev/null.
- our shared memory then got stdout's file number.
- independently, a shared library had some code that started writing to stdout... now our shared memory.
- so the logs clobbered the shared memory
Was hard to track down until I used xxd to look at the shared memory.