[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: slapd deadlocked in test008 (hdb) (ITS#2580)
Someone kick me, please...
I didn't even notice the two latest threads, doing select().
'truss -p' shows that slapd is looping, doing the system calls
poll(0xFE001108, 20, 0) = 0
yield() = 0
time() = 1054845428
A select() loop with no timeout and no intervening sleep().
Here is another GDB session with the same process. All but the two
bottom thread were the same. These two were doing yield().
Thread 2 (Thread 4 (LWP 1)):
#0 0xfef9c3a0 in yield () from /usr/lib/libc.so.1
#1 0x00080c64 in ldap_pvt_thread_yield () at thr_posix.c:183
#2 0x0002e670 in slapd_daemon_task (ptr=0x3edfacd7) at daemon.c:1892
Thread 1 (LWP 1 ):
#0 0xfef9c3a0 in yield () from /usr/lib/libc.so.1
#1 0x00080c64 in ldap_pvt_thread_yield () at thr_posix.c:183
#2 0x0002e670 in slapd_daemon_task (ptr=0x3edfacd7) at daemon.c:1892
#0 0xfef9c3a0 in yield () from /usr/lib/libc.so.1
(gdb) n
Single stepping until exit from function yield,
which has no line number information.
ldap_pvt_thread_yield () at thr_posix.c:199
199 }
(gdb) n
slapd_daemon_task (ptr=0x3edfacd7) at daemon.c:1258
1258 now = slap_get_time();
(gdb)
1260 if( ( global_idletimeout > 0 ) &&
(gdb)
1266 tv = idle;
(gdb) p idle
$1 = {tv_sec = 0, tv_usec = 0}
(gdb) n
1269 if( slapd_gentle_shutdown ) {
(gdb) n
1289 FD_ZERO( &writefds );
(gdb) n
1290 FD_ZERO( &readfds );
(gdb)
1292 at = 0;
(gdb)
1294 ldap_pvt_thread_mutex_lock( &slap_daemon.sd_mutex );
(gdb)
1306 AC_MEMCPY( &readfds, &slap_daemon.sd_readers, sizeof(fd_set) );
(gdb)
1307 AC_MEMCPY( &writefds, &slap_daemon.sd_writers, sizeof(fd_set) );
(gdb)
1310 FD_SET( wake_sds[0], &readfds );
(gdb) p readfds
$2 = {fds_bits = {268434496, 0 <repeats 31 times>}}
(gdb) set radix 16
Input and output radices now set to decimal 16, hex 10, octal 20.
(gdb) p readfds
$3 = {fds_bits = {0xffffc40, 0x0 <repeats 31 times>}}
(gdb) p writefds
$4 = {fds_bits = {0x0 <repeats 32 times>}}
(gdb) n
1312 for ( l = 0; slap_listeners[l] != NULL; l++ ) {
(gdb) p wake_sds[0]
$5 = 0x4
(gdb) p readfds
$6 = {fds_bits = {0xffffc50, 0x0 <repeats 31 times>}}
(gdb) n
1313 if ( slap_listeners[l]->sl_sd == AC_SOCKET_INVALID )
(gdb)
1315 if ( slap_listeners[l]->sl_is_mute )
(gdb)
1318 if (!FD_ISSET(slap_listeners[l]->sl_sd, &readfds))
(gdb)
1323 nfds = slap_daemon.sd_nfds;
(gdb)
1327 if ( global_idletimeout && slap_daemon.sd_nactives )
(gdb)
1330 ldap_pvt_thread_mutex_unlock( &slap_daemon.sd_mutex );
(gdb)
1332 if ( !at ) {
(gdb)
1333 at = ldap_pvt_thread_pool_backload(&connection_pool) -
(gdb)
1337 tvp = at ? &tv : NULL;
(gdb) p at
$7 = 0x12
(gdb) p tv
$8 = {tv_sec = 0x0, tv_usec = 0x0}
(gdb) n
1340 ldap_pvt_thread_mutex_lock( &syncrepl_rq.rq_mutex );
(gdb) n
1341 rtask = ldap_pvt_runqueue_next_sched( &syncrepl_rq, &cat );
(gdb) n
1342 while ( cat && cat->tv_sec && cat->tv_sec <= now ) {
(gdb)
1355 ldap_pvt_thread_mutex_unlock( &syncrepl_rq.rq_mutex );
(gdb)
1357 if ( cat != NULL ) {
(gdb)
1394 NULL, tvp ))
(gdb) n
1892 ldap_pvt_thread_yield();
(gdb) detach
--
Hallvard