This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/14958] Concurrent reader deadlock in pthread_rwlock_rdlock()


http://sourceware.org/bugzilla/show_bug.cgi?id=14958

--- Comment #1 from Daniel Stodden <daniel.stodden at gmail dot com> 2012-12-13 23:21:36 UTC ---
Here are snippets from a GDB session investigating the blocked program.

(gdb) thread apply all bt

Thread 5 (Thread 0x7ffff5ffc700 (LWP 8428)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at
../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162
#1  0x0000000000400a4a in R1 () at rwlock.c:56
#2  0x0000000000400a11 in loop (data=0x400a1b) at rwlock.c:116
#3  0x00007ffff7bc4e9a in start_thread (arg=0x7ffff5ffc700) at
pthread_create.c:308
#4  0x00007ffff78f24bd in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#5  0x0000000000000000 in ?? ()

Thread 4 (Thread 0x7ffff67fd700 (LWP 8427)):
#0  pthread_rwlock_rdlock () at
../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S:85
#1  0x0000000000400a77 in R0 () at rwlock.c:36
#2  0x0000000000400a11 in loop (data=0x400a69) at rwlock.c:116
#3  0x00007ffff7bc4e9a in start_thread (arg=0x7ffff67fd700) at
pthread_create.c:308
#4  0x00007ffff78f24bd in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#5  0x0000000000000000 in ?? ()

Thread 3 (Thread 0x7ffff6ffe700 (LWP 8426)):
#0  pthread_rwlock_wrlock () at
../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S:83
#1  0x0000000000400acc in W1 () at rwlock.c:75
#2  0x0000000000400a11 in loop (data=0x400abe) at rwlock.c:116
#3  0x00007ffff7bc4e9a in start_thread (arg=0x7ffff6ffe700) at
pthread_create.c:308
#4  0x00007ffff78f24bd in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#5  0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7ffff77ff700 (LWP 8425)):
#0  pthread_rwlock_wrlock () at
../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S:83
#1  0x0000000000400aef in W0 () at rwlock.c:67
#2  0x0000000000400a11 in loop (data=0x400ae2) at rwlock.c:116
#3  0x00007ffff7bc4e9a in start_thread (arg=0x7ffff77ff700) at
pthread_create.c:308
#4  0x00007ffff78f24bd in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#5  0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7ffff7fe0700 (LWP 8422)):
#0  0x00007ffff7bc6148 in pthread_join (threadid=140737328961280,
thread_return=0x0) at pthread_join.c:89
#1  0x00000000004008a7 in main (argc=<optimized out>, argv=<optimized out>) at
rwlock.c:143

(gdb) #
(gdb) # Note thread 4 (R0) blocked inside pthread_rwlock_rdlock(),
(gdb) # while rdlock is available, but held by R1 exclusively.
(gdb) #
(gdb) print rwlock
$3 = {__data = {__lock = 0, __nr_readers = 1, __readers_wakeup = 209,
__writer_wakeup = 1186, __nr_readers_queued = 1, __nr_writers_queued = 2,
__writer = 0, __shared = 0, __pad1 = 0, __pad2 = 0, __flags = 0}, __size =
"\000\000\000\000\001\000\000\000\321\000\000\000\242\004\000\000\001\000\000\000\002",
'\000' <repeats 34 times>, __align = 4294967296}

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]