- 论坛徽章:
- 0
|
操作系统:solaris 5.7
死锁情况:
用dbx发现是mutex 造成,此mutex 是我们写的代码中的, 地址信息为0x1cb510, 信息显示当前是线程t@48489获得这个mutex. 用thread tid命令查看该线程,发现该线程调用是在调用_tdb_agent时获得mutex的,但我们的程序没有这样的函数,该函数是系统调用吗? 如果是系统调用, 为何它会获取我们代码中的mutex呢?
dbx 信息:
(/../dbx)sync -info 0x1cb510
0x001cb510 (0x1cb510): thread mutex(locked)
Lock owned by t@48489
Threads blocked by this lock are:
>; t@1 (0x00107f9 a l@1 ?() sleep on 0x1cb510 in __lwp_sema_wait()
...
(/../dbx) threads
t@48488 b l@48489 OSThreadMain() running in _poll()
t@48489 b l@48490 ?() running in __lwp_sema_wait()
(/../dbx) thread t@48489
t@48489 (l@48490) stopped in __lwp_sema_wait at 0xfeb99f80
0xfeb99f80: __lwp_sema_wait+0x0008: ta %icc,%g0 + 8
(/../dbx) where
current thread: t@48489
[1] __lwp_sema_wait(0xff143b80, 0xff126f84, 0x15b10, 0x0, 0x0, 0x0), at 0xfeb99f80
=>;[2] _tdb_agent(0x0, 0x0, 0xff143918, 0xff143fa4, 0xff143b80, 0xfeac3dc0), at 0xff126f84
 |
|