Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Feb 2005 11:55:57 +0300
From:      Gleb Smirnoff <glebius@freebsd.org>
To:        current@freebsd.org
Subject:   deadlock and LOR with threads
Message-ID:  <20050220085557.GA87007@cell.sick.ru>

next in thread | raw e-mail | index | archive | help
  Today I've upgraded my edsktop to the new CURRENT and experienced
the following problem.
I'm running gkrellm (linked against libpthread) with gkrellmms plugin.
When I started xmms using gkrellmms button, gkrellm freezed. After
gkrellm was killed with SIGKILL, new instances of gkrellm freezed on start
before drawing a window. I tried to gdb gkrellm with the followin result:

glebius@morannon:~:|>gdb `which gkrellm`
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd"...(no debugging symbols found)...
(gdb) run
Starting program: /usr/X11R6/bin/gkrellm 
(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...^C
Program received signal SIGINT, Interrupt.
[Switching to Thread 2 (LWP 100150)]
0x282ba38b in pthread_testcancel () from /usr/lib/libpthread.so.1
(gdb) 

Then I looked into dmesg and found this LOR:
lock order reversal
 1st 0xc07bdd80 sched lock (sched lock) @ /usr/src/sys/kern/sys_process.c:657
 2nd 0xc07c1ac4 sleepq chain (sleepq chain) @ /usr/src/sys/kern/subr_sleepqueue.c:219
KDB: stack backtrace:
kdb_backtrace(c075c7bd,c07c1ac4,c075b8d7,c075b8d7,c075b8e4) at kdb_backtrace+0x2e
witness_checkorder(c07c1ac4,9,c075b8e4,db,c15964b4) at witness_checkorder+0x6aa
_mtx_lock_spin_flags(c07c1ac4,0,c075b8e4,db,d1a22b74) at _mtx_lock_spin_flags+0x8d
sleepq_lock(c15964b4,c1da57f0,c1da5858,c1955060,d1a22b98) at sleepq_lock+0x39
wakeup(c15964b4,1,c0756e2e,5ad,c1e60000) at wakeup+0x12
thread_continued(c1da57f0,0,c075d149,291,a) at thread_continued+0x9c
kern_ptrace(c1e37190,7,8cc,1,0) at kern_ptrace+0xadf
ptrace(c1e37190,d1a22d14,10,3ff,4) at ptrace+0xf0
syscall(2f,2f,2f,0,1871d) at syscall+0x270
Xint0x80_syscall() at Xint0x80_syscall+0x1f
--- syscall (26, FreeBSD ELF32, ptrace), eip = 0x28346fff, esp = 0xbfbfdf2c, ebp = 0xbfbfdfe8 ---

-- 
Totus tuus, Glebius.
GLEBIUS-RIPN GLEB-RIPE



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050220085557.GA87007>