- 论坛徽章:
- 0
|
多线程程序中,某一个线程调用了system函数,导致了程序core,具体信息如下:
Trace/BPT trap in _internal_error at 0x90000000049b4f8 ($t1)
0x90000000049b4f8 (_internal_error+0x8 e8410028 ld r2,0x28(r1)
(dbx) where
_internal_error(??, ??, ??) at 0x90000000049b4f8
_event_notify_locked_31_23(??, ??, ??, ??, ??) at 0x9000000004a643c
_event_notify(??, ??, ??) at 0x9000000004a5e88
_unlock_wakeup(??) at 0x900000000494afc
pthread_mutex_unlock(??) at 0x9000000004a1248
forkchild()(), line 15 in "test.cpp"
_atfork_child() at 0x9000000004b3e6c
__fork() at 0x9000000000a1c0c
system(??) at 0x90000000017e53c
程序中有一个static线程锁,初始化为PTHREAD_MUTEX_INITIALIZER,但程序在启动时,就设置成了PTHREAD_MUTEX_RECURSIVE属性。
程序中注册了pthread_atfork函数处理fork操作,注册的_atfork_prepare函数对线程锁进行加锁,parent和child分别对该线程锁进行解锁。
但现在程序就是在pthread_atfork的_atfork_child解锁时core。因此很不能理解具体原因,求解中... |
|