linux系統,多線程,隨機有線程掛死。
一般引起線程的原因有哪些呢?程序內部malloc分配的內存很大,不知道是否有影響。
gdb進去看分別看每個線程bt,沒有什麼頭緒,
(gdb) bt
#0 0x00002b60e7f920fb in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00002b60e7f15231 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#2 0x00002b60e7f12f87 in malloc () from /lib/x86_64-linux-gnu/libc.so.6
#3 0x00002b60e73fd900 in ?? () from /lib64/ld-linux-x86-64.so.2
#4 0x00002b60e74038a9 in ?? () from /lib64/ld-linux-x86-64.so.2
#5 0x00002b60e73ff176 in ?? () from /lib64/ld-linux-x86-64.so.2
#6 0x00002b60e740331a in ?? () from /lib64/ld-linux-x86-64.so.2
#7 0x00002b60e7fc0d42 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#8 0x00002b60e73ff176 in ?? () from /lib64/ld-linux-x86-64.so.2
#9 0x00002b60e7fc0e04 in __libc_dlopen_mode () from /lib/x86_64-linux-gnu/libc.so.6
#10 0x00002b60e7f9b035 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#11 0x00002b60e7c7d400 in pthread_once () from /lib/x86_64-linux-gnu/libpthread.so.0
#12 0x00002b60e7f9b154 in backtrace () from /lib/x86_64-linux-gnu/libc.so.6
#13 0x00002b60e7f043af in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#14 0x00002b60e7f0eb96 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#15 0x00002b60e7f10d5b in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#16 0x00002b60e7f12f95 in malloc () from /lib/x86_64-linux-gnu/libc.so.6
#17 0x00002b60e7eff20b in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#18 0x0000000000438c8e in _BCI_OutFileOpen (index=
, new_file_flag=) at BuildCsvIF.c:825
#19 0x00000000004390a9 in BCI_OutFileUpdate (index=21, new_file_flag=) at BuildCsvIF.c:843
#20 BCI_OutFileUpdate (index=21, new_file_flag=) at BuildCsvIF.c:834
#21 0x0000000000439249 in BCI_CDRPthreadHandle (index=) at BuildCsvIF.c:916
#22 0x00002b60e7c77e9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#23 0x00002b60e7f843fd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#24 0x0000000000000000 in ?? ()
(gdb)
其中 _BCI_OutFileOpen裡面沒有malloc調用,有一些fopen fclose等操作,求指導。這個bt感覺沒有什麼用。