莫飞侠 2017-06-16 07:25 采纳率: 0%
浏览 2195

linux进程收到ctrl c信号后卡住

#0 0x00007f266befc0fc in lll_lock_wait_private () from /lib64/libc.so.6
#1 0x00007f266be79f93 in _L_lock_14932 () from /lib64/libc.so.6
#2 0x00007f266be77013 in malloc () from /lib64/libc.so.6
#3 0x00007f266c94b0cd in operator new(unsigned long) () from /lib64/libstdc++.so.6
#4 0x00007f266c9a9c79 in std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator const&) () from /lib64/libstdc++.so.6
#5 0x00007f2671216bb1 in std::string::_S_construct (
beg=0x7fffe42ee440 "20170616",
__end=0x7fffe42ee448 "", __a=...) at /usr/include/c++/4.8.2/bits/basic_string.tcc:138
#6 0x00007f266c9ab968 in std::basic_string, std::allocator >::basic_string(char const*, std::allocator const&) () from /lib64/libstdc++.so.6
#7 0x00007f2670983dea in CNGLogAsynMgr::SetNorLogFile (this=0xedd090, tLogSection=...) at NGLog.cpp:3300
#8 0x00007f2670982f85 in CNGLogAsynMgr::SetLogFile (this=0xedd090, tLogSection=...) at NGLog.cpp:3083
#9 0x00007f2670982da0 in CNGLogAsynMgr::WriteToFile (this=0xedd090, tLogSection=...) at NGLog.cpp:3046
#10 0x00007f267098110e in CNGLog::SendLog (this=0xe09460, tLogSection=...,
szBuffer=0x7fffe42ffe90 "recevie signo 2.....") at NGLog.cpp:2207
#11 0x00007f2670981b35 in CNGLog::SendLog (this=0xe09460, iLogType=1, iLogLevel=4, iErrCode=4,
szModule=0x7f26709a528e "", pszTransId=0x7f26709a528e "", bMsgFlag=false,
fmt=0x401ff0 "recevie signo 2.....", pVaList=0x7fffe430ff88) at NGLog.cpp:2542
#12 0x00007f267097dbca in CNGLog::SendLog (this=0xe09460, iLogLevel=4, iErrCode=4,
fmt=0x401ff0 "recevie signo 2.....", pVaList=0x7fffe430ff88) at NGLog.cpp:1178
#13 0x00007f267098f919 in CBillLog::Log (this=0x6035a0 , iLogCode=4,
fmt=0x401ff0 "recevie signo 2.....") at CBillLog.cpp:451
#14 0x0000000000401375 in sig_handler (signo=2) at app_testlog.cpp:26
#15
#16 0x00007f266be76fd2 in malloc () from /lib64/libc.so.6
#17 0x00007f266c94b0cd in operator new(unsigned long) () from /lib64/libstdc++.so.6
#18 0x00007f266c94b1c9 in operator new () from /lib64/libstdc++.so.6
#19 0x00007f2670bc4a4b in CStrDispose::RTrim (pszStr=0x7fffe4310700 "EPAY_THRESHOLD", bIsAbsTrim=false)
at StrDispose.cpp:297
#20 0x00007f2670bc4f0e in CStrDispose::Trim (pszStr=0x7fffe4310700 "EPAY_THRESHOLD", bIsAbsTrim=false)
at StrDispose.cpp:465
#21 0x00007f2670bc70d1 in Trim (str=0x7fffe4310700 "EPAY_THRESHOLD") at StringInterface.cpp:77
#22 0x00007f2670726749 in CParamVisit::fnSetParamId (this=0xeb2b50) at CParamVisit.cpp:268
#23 0x00007f2670725c52 in CParamVisit::GetParamValue (this=0xeb2b50, pParamValue=@0x7fffe43142a0: 0x0,
---Type to continue, or q to quit---
bEncrypt=true) at CParamVisit.cpp:137
#24 0x00007f267120be0e in CLogParamVisit::GetParamValue (this=0xe09f50,
iLogParamNum=LOG_PARAM_WARN_FILE, pszParam=0x7f26709a5bd8 "log.warn_filename",
pszParamValue=@0x7fffe43142a0: 0x0) at ShmLogParam.cpp:223
#25 0x00007f26709831f1 in CNGLogAsynMgr::WriteOneLog (this=0xedd090, tLogSection=...) at NGLog.cpp:3149
#26 0x00007f2670982dc4 in CNGLogAsynMgr::WriteToFile (this=0xedd090, tLogSection=...) at NGLog.cpp:3049
#27 0x00007f267098110e in CNGLog::SendLog (this=0xe09460, tLogSection=...,
szBuffer=0x7fffe4325ab0 '1' ) at NGLog.cpp:2207
#28 0x00007f2670981b35 in CNGLog::SendLog (this=0xe09460, iLogType=1, iLogLevel=3, iErrCode=3,
szModule=0x7f26709a528e "", pszTransId=0x7f26709a528e "", bMsgFlag=false,
fmt=0x402028 '1' , pVaList=0x7fffe4335ba8) at NGLog.cpp:2542
#29 0x00007f267097dbca in CNGLog::SendLog (this=0xe09460, iLogLevel=3, iErrCode=3,
fmt=0x402028 '1' , pVaList=0x7fffe4335ba8) at NGLog.cpp:1178
#30 0x00007f267098fad2 in CBillLog::Warning (this=0x6035a0 , iWarningCode=3,
fmt=0x402028 '1' ) at CBillLog.cpp:562
#31 0x0000000000401502 in main (argc=1, argv=0x7fffe4336da8) at app_testlog.cpp:49
(gdb) i threads
Id Target Id Frame
2 Thread 0x7f26679e4700 (LWP 82742) "testlog" 0x00007f266bee5ba3 in select () from /lib64/libc.so.6

  • 1 Thread 0x7f267161e740 (LWP 82725) "testlog" 0x00007f266befc0fc in __lll_lock_wait_private () from /lib64/libc.so.6
  • 写回答

2条回答 默认 最新

  • 长白山石 2017-06-16 07:38
    关注

    这是在进程new过程中收到了信号,信号处理里又有new调用,结果锁住了。实现应该避免这种情况,信号处理里不用动态分配内存就可以避免这个问题。

    评论

报告相同问题?

悬赏问题

  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥15 stable diffusion
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条