Skip to content

Fixed locking issues reported by valgrind --tool=helgrind

Petter Reinholdtsen requested to merge ogg123-segfault-locking into master

The ogg123 tool would segfault on machines with hardware backed POSIX mutexes when trying to unlock an unlocked lock. This patch avoid the problem by changing the mutex-es used to resurcive mutexes and dropping the call to status_reset_output_lock() during exit which can trigger the segfault. The real problem seem to be a thread holding the output_lock mutex can be killed without releasing. Not sure how to address this.

helgrind would also warn about execute_actions() reading and writing to memory without holding a lock that the other thread was holding when using that part of memory. Adding a lock would deadlock the process as the actions tried to get the lock again. Switching to recursive locks seem to solve this issue to. I'm not sure if this is really needed.

Bug-Debian: https://bugs.debian.org/835070 Bug-Debian: https://bugs.debian.org/842796

Merge request reports

Loading