#49 Uninitialized pthread mutexes

open
nobody
None
9
2012-12-06
2012-12-06
Pavel Fedin
No

mksquashfs uses mutexes and condition variables for inter-thread synchronization. These variables must be initialized before use. There are special initializers for it: PTHREAD_COND_INITIALIZER and PTHREAD_MUTEX_INITIALIZER. Failure to do so may cause mutexes not to function (because there's no error check after lock/unlock operations). The bug has been discovered on Cygwin, where initializers are not NULL values.

Discussion

  • Pavel Fedin
    Pavel Fedin
    2012-12-06

    • priority: 5 --> 9