There was a deadlock and found that pthread_mutex_lock is waiting to get the lock but the mutex lock is already locked with owner set to zero.
p *(*spinLock)->lock
$47 = {__data = {__lock = 1, __count = 0, __owner = 0, __kind = 0, __nusers = 0, {__spins = 0, __list = {__next = 0x0}}}, __size = "\001", '\000' <repeats 22 times>, __align = 1}
I was wondered here, only lock and __align set to one but reset including owner and count set to zero. Initially I thought of corruption but when I checked the size of allocation it was correct.
(gdb) p (*spinLock)->lock
$49 = (pthread_mutex_t *) 0x2df7a764
(gdb) x/2x 0x2df7a764-4
0x2df7a760: 0x0000001c 0x00000001
(gdb) p/x sizeof(*(*spinLock)->lock)+4
$51 = 0x1c
I try to figure out what could leads to this condition but I could not. Any pointer would really. Thanks!
User contributions licensed under CC BY-SA 3.0