pthread_mutex_lock locked but no owner or count set

0

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!

c
locking
pthreads
mutex
deadlock
asked on Stack Overflow Jan 28, 2015 by Thangaraj

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0