쓰레드들이 록에 의해 멈춘 것 같은데요...
안녕하세요?
두 개의 쓰레드 (메인과 생성한 쓰레드) 로 구성된 프로그램의 동작이 멈춰 있는 것 같아,
gdb로 확인하니 다음과 같습니다.
(동작환경 : Linux RedHat EL-4 AS)
1. 쓰레드 #1
(gdb) bt
#0 0x009867a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1 0x00a7666e in __lll_mutex_lock_wait () from /lib/tls/libc.so.6
#2 0x00a0933b in _L_mutex_lock_3239 () from /lib/tls/libc.so.6
#3 0x00005a54 in ?? ()
#4 0x00000000 in ?? ()
2. 쓰레드 #2
(gdb) bt
#0 0x009867a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1 0x00a7666e in __lll_mutex_lock_wait () from /lib/tls/libc.so.6
#2 0x00a1f409 in _L_mutex_lock_1772 () from /lib/tls/libc.so.6
#3 0x00000003 in ?? ()
#4 0x00000028 in ?? ()
#5 0xb776f200 in ?? ()
#6 0x00000063 in ?? ()
#7 0x00001025 in ?? ()
#8 0xb776f148 in ?? ()
#9 0xb776f290 in ?? ()
#10 0x096c7b60 in ?? ()
#11 0x00ac7ff4 in ?? () from /lib/tls/libc.so.6
#12 0xb776f280 in ?? ()
#13 0x096c6554 in ?? ()
#14 0xb776f158 in ?? ()
#15 0x00a1d480 in localtime () from /lib/tls/libc.so.6
#16 0x00a1d480 in localtime () from /lib/tls/libc.so.6
#17 0x080a5615 in DateTime::getDateTimeFields ()
#18 0x080a5a2f in DateTime::getDateStr ()
#19 0x0804f8d1 in HdsrDataExSyncThr::makeDataFileList ()
#20 0x0804fed2 in HdsrDataExSyncThr::run ()
#21 0x00be93ae in start_thread () from /lib/tls/libpthread.so.0
#22 0x00a69aee in clone () from /lib/tls/libc.so.6
정확히 알 수는 없지만,
__lll_mutex_lock_wait 부분으로 보아
록을 기다리면서 hang 되어 있는 상태인 것 같습니다.
localtime()이 두 번 호출된 것처럼 보이는데,
localtime_r()을 사용하지 않아서 그런 것인지요?
만약 그렇다면, 재진입 가능한 라이브러리들을 사용해야 될 것 같은데
혹시 그러한 라이브러리 목록들을 찾을 수 있을지요?
참고로, lsstack 로 확인한 내용은 다음과 같습니다.
% lsstack 14195
0x009867a2 in (0xb2131a28 ,0xb2500010 ,0xb4580418 ,0xbffc58a8)
0x00a1e715 in tzset_internal (0x00ac7ff4)
0x00a1f16e in tzset (0x001a05a1 ,0x00ac7ff4 ,0x00abea0c ,0xb45603f8)
0x00a23b9e in strftime_l (0x096c8a74 ,0x00001ffc ,0x00abd5b7 ,0xbffc5c48)
0x00a659db in vsyslog (0x00000003 ,0x00abe9a0 ,0xbffc5d94 ,0xb2500810)
0x009fdf1f in __libc_message (0x00000002 ,0x00abe9a0 ,0x00abea54 ,0xbffc5e00)
0x00a044f8 in _int_free (0xb2500010 ,0xb2131a40 ,0xb2511088 ,0xb7f448e4)
0x00a04aca in free (0xb2131a40 ,0xbffc6460 ,0x00000007 ,0x00000000)
0x0805395a in _ZN14HdsrDataExHist12makePointMapEv (0xb7770008 ,0xb7e476e4 ,0x00000000 ,0x00000000)
0x08053f64 in _ZN14HdsrDataExHist4initEi (0xb7770008 ,0x44a68df5 ,0x080a7eb0 ,0x080a55d3)
0x080541ad in _ZN14HdsrDataExHist4syncEi (0xb7770008 ,0x44a68df5 ,0x080a6e80 ,0x0804b5c5)
0x0804b710 in _ZN10HdsrDataEx20syncEventDataProcessEv (0xbffc6680 ,0x080d23de ,0xbffc6628 ,0x0809cf3e)
0x0804b78d in _ZN10HdsrDataEx15syncDataProcessEPKcS1_ (0xbffc6680 ,0x080d23a2 ,0x080d23de ,0x06dd7498)
0x0804b807 in _ZN10HdsrDataEx13syncDataFilesEh (0xbffc6680 ,0x00000000 ,0x080a73dc ,0x00000001)
0x0804cd26 in _ZN10HdsrDataEx3runEv (0xbffc6680 ,0x096c64d8 ,0x0804b584 ,0xb7fe2e60)
0x0804d438 in main (0x00000001 ,0xbffc68b4 ,0xbffc68bc ,0x00991b46)
0x009b7e33 in __libc_start_main
의견 부탁 드립니다.
좋은 한 주 되세요... 감사합니다.
댓글 달기