Movatterモバイル変換


[0]ホーム

URL:


CN103092746A - Positioning method and system for thread anomaly - Google Patents

Positioning method and system for thread anomaly
Download PDF

Info

Publication number
CN103092746A
CN103092746ACN2013100468750ACN201310046875ACN103092746ACN 103092746 ACN103092746 ACN 103092746ACN 2013100468750 ACN2013100468750 ACN 2013100468750ACN 201310046875 ACN201310046875 ACN 201310046875ACN 103092746 ACN103092746 ACN 103092746A
Authority
CN
China
Prior art keywords
thread
abnormal
monitored
monitored thread
dump file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN2013100468750A
Other languages
Chinese (zh)
Other versions
CN103092746B (en
Inventor
林三龙
程晓龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Datang Mobile Communications Equipment Co Ltd
Original Assignee
Datang Mobile Communications Equipment Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Datang Mobile Communications Equipment Co LtdfiledCriticalDatang Mobile Communications Equipment Co Ltd
Priority to CN201310046875.0ApriorityCriticalpatent/CN103092746B/en
Publication of CN103092746ApublicationCriticalpatent/CN103092746A/en
Application grantedgrantedCritical
Publication of CN103092746BpublicationCriticalpatent/CN103092746B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Landscapes

Abstract

The invention discloses a positioning method and a positioning system for thread anomaly. The positioning method for the thread anomaly comprises the following steps. Running states of monitored threads are monitored, and whether the monitored threads run abnormally is judged; when the monitored threads are judged to be abnormal, a dump file is generated, and the dump file comprises internal storage and stack information of the threads in a process; by debugging the dump file, a code position of the anomaly of the monitored threads is positioned. According to the positioning method and the positioning system for the thread anomaly, not only can the running states of the threads be monitored, but also when the threads run abnormally, due to the fact that the dump file automatically records the currently running internal storage and the stack information of the threads, developers can rapidly position the code position causing the anomaly of the threads according to the recorded internal storage and the stack information.

Description

The localization method that thread is abnormal and system
Technical field
The present invention relates to field of computer technology, relate in particular to the abnormal localization method of a kind of thread and system.
Background technology
Thread is the elementary cell of operating system distribution processor time, and a plurality of threads run time version simultaneously can be arranged in process.Each thread maintenance abnormality handling procedure, dispatching priority and a group system are used for preserving the structure of thread context before this thread of scheduling.The method of existing monitoring thread running status has two kinds:
Heartbeat detection: whether set up a monitoring thread, monitoring each thread has heartbeat, if in a period of time, certain thread does not have heartbeat, thinks that this thread is abnormal;
Status poll: set up a monitoring thread, inquire about at set intervals the running status of each thread, if find that certain thread operation stops, and thinks that this thread is abnormal;
The total major defect of above two kinds of prior aries is:
State that can only monitoring thread is if thread can not be determined the particular location that thread is abnormal extremely;
When carrying out the complicated and time consumption computing, adopt above two kinds of technology may have the situation of erroneous judgement thread running status when thread.
Summary of the invention
The technical matters that (one) will solve
The technical problem to be solved in the present invention is: the abnormal localization method of a kind of thread and system are provided, cause with quick location the code position that thread is abnormal.
(2) technical scheme
For addressing the above problem, on the one hand, the invention provides the abnormal localization method of a kind of thread, comprising:
Monitor the running status of each monitored thread, judge whether monitored thread operation is abnormal;
Generate dump file when judgement obtains monitored thread abnormal, described dump file comprises internal memory, the stack information of in-process each thread;
By debugging described dump file, locate the code position at the abnormal place of monitored thread.
Preferably, also comprise the step that increases monitoring thread before the step of the running status of the monitored thread of described monitoring, monitor the running status of each monitored thread by described monitoring thread.
Preferably, monitor the running status of each monitored thread by described monitoring thread, judge whether abnormal step comprises in monitored thread operation:
Described each monitored thread is registered to described monitoring thread when initialization, and sets initial value and the abnormal number of times limit value of the time-out time of each monitored thread, the initial value of counter, abnormal number of times;
Each monitored thread upgrades the counter of self in normal course of operation;
If monitoring thread is found certain monitored thread and do not upgrade the counter of self in the time-out time of described setting, adds 1 for the abnormal number of times of this monitored thread;
If abnormal number of times corresponding to monitored thread be greater than the abnormal number of times limit value of described setting, judgement this monitored thread abnormal, and the counter that this monitored thread is corresponding and extremely number of times reset to the initial value of correspondence.
Preferably, if abnormal number of times corresponding to described monitored thread is greater than the abnormal number of times limit value of described setting, the step that judges this monitored thread abnormal comprises: if continuous abnormal number of times corresponding to monitored thread greater than the abnormal number of times limit value of described setting, this monitored thread abnormal of judgement.
Preferably, if monitoring thread is found certain monitored thread and do not upgrade the counter of self in previous time-out time, but upgraded the counter of self in current time-out time, the abnormal number of times that described monitored thread is corresponding resets to corresponding initial value.
Preferably, also be included in daily record after the step of this monitored thread abnormal of judgement in the step of identifier of recording exceptional thread.
Preferably, the step of described debugging dump file comprises: find corresponding abnormal thread according to the identifier of described abnormal thread.
Preferably, described dump file is the dmp file.
On the other hand, the present invention also provides a kind of thread abnormal positioning system, comprising:
Monitoring module for the running status of each monitored thread of monitoring, judges whether monitored thread operation is abnormal;
The dump file generation module is used for generating dump file when judgement obtains monitored thread abnormal, and described dump file comprises internal memory, the stack information of in-process each thread;
Abnormal locating module is used for locating the code position at the abnormal place of monitored thread by the described dump file of debugging.
(3) beneficial effect
The present invention can not only the monitoring thread running status, and when the thread operation exception, internal memory and stack information by the current operation of the automatic record thread of dump file, the developer is according to internal memory and the stack information of record, just the code position that causes that thread is abnormal be can locate fast, debugging and the reparation of thread facilitated.
Continuous abnormal number of times corresponding to the monitored thread of the present invention just judges this monitored thread abnormal during greater than the abnormal number of times limit value of described setting, can reduce the probability of some thread erroneous judgement complicated and consuming time.
Method of the present invention increases monitoring thread can be completed, and the scope of application is wider, also applicable to announced software.
Description of drawings
Fig. 1 is the schematic flow sheet of the localization method abnormal according to a kind of thread of the embodiment of the present invention;
Fig. 2 is the schematic flow sheet of the localization method abnormal according to a kind of thread of the embodiment of the present invention;
Fig. 3 is according to the sequential chart between embodiment of the present invention monitoring thread and monitored thread;
Fig. 4 is the structural representation block diagram of the abnormal positioning system of thread a kind of according to the embodiment of the present invention.
Embodiment
That the present invention is described in detail is as follows below in conjunction with drawings and Examples.
Embodiment one:
Figure 1 shows that the schematic flow sheet of the localization method that a kind of thread of the present embodiment record is abnormal, described method comprises:
S110: monitor the running status of each monitored thread, judge whether monitored thread operation is abnormal;
S120: generate dump file when judgement obtains monitored thread abnormal;
S130: by debugging described dump file, locate the code position at the abnormal place of monitored thread.
In the present embodiment, described dump file comprises internal memory, the stack information of in-process each thread.
The method of the present embodiment can not only the monitoring thread running status, and when the thread operation exception, internal memory and stack information by the current operation of the automatic record thread of dump file, the developer is according to internal memory and the stack information of record, just the code position that causes that thread is abnormal be can locate fast, debugging and the reparation of thread facilitated.
Embodiment two:
Figure 2 shows that the schematic flow sheet of the localization method that the another kind of thread of the present embodiment record is abnormal, described method comprises:
S210: increase monitoring thread in application;
S220: described each monitored thread is registered to described monitoring thread when initialization, and sets initial value and the abnormal number of times limit value of the time-out time of each monitored thread, the initial value of counter, abnormal number of times;
S230: each monitored thread upgrades the counter of self in normal course of operation;
S240: do not upgrade the counter of self if monitoring thread is found certain monitored thread in the time-out time of described setting, add 1 for the abnormal number of times of this monitored thread;
S250: if continuous abnormal number of times corresponding to monitored thread is greater than the abnormal number of times limit value of described setting, judge this monitored thread abnormal, generate described dump file, and corresponding counter and the abnormal number of times of this monitored thread reset to corresponding initial value, the identifier of recording exceptional thread in daily record; Wherein, in order to obtain the continuous abnormal number of times of monitored thread, if monitoring thread is found certain monitored thread and do not upgrade the counter of self in previous time-out time, but upgraded the counter of self in current time-out time, the abnormal number of times that described monitored thread is corresponding resets to corresponding initial value; The identifier of described abnormal thread is used for finding according to the identifier of described abnormal thread the abnormal thread of correspondence when the debugging dump file;
S260: by debugging described dump file, locate the code position at the abnormal place of monitored thread.
In the present embodiment, described dump file is the dmp file, when determining monitored thread abnormal, generates described dmp file by calling MiniDump WriteDump function in the present embodiment; After generating the dmp file, by WinDBG instrument debugging dmp file, can locate fast abnormal thread operation code position.
Fig. 3 is the sequential chart between the present embodiment monitoring thread and monitored thread, as shown in Figure 3, comprises a monitoring thread Monitor and three monitored thread ThreadA, ThreadB and ThreadC in this implementation.Wherein, the monitored thread ThreadA of the first two and ThreadB successively pass through initialization, are registered to described monitoring thread, and have set time-out time Ti, counter C1iInitial value, abnormal number of times C2iInitial value and abnormal number of times limit value; Monitored thread ThreadC does not also carry out initialization.
Constantly upgrade the counter C1 of self in the operational process of two monitored thread ThreadA and ThreadBi, monitoring thread finds that certain monitored thread in the time-out time Ti that sets, fails to upgrade its counter C1i, thinks that this thread is abnormal, its abnormal number of times C2iAdd 1;
At monitored thread continuous abnormal number of times C2iDuring greater than the abnormal number of times limit value set, generate described dmp file, and counter reset C1iWith abnormal number of times C2iBe initial value.
Continuous abnormal number of times corresponding to monitored thread just judges this monitored thread abnormal during greater than the abnormal number of times limit value of described setting, can reduce the probability of some thread erroneous judgement complicated and consuming time.
Embodiment three:
Figure 4 shows that the structural representation block diagram of the positioning system that a kind of thread of the present embodiment record is abnormal, described system comprises:
Monitoring module 410 for the running status of each monitored thread of monitoring, judges whether monitored thread operation is abnormal;
Dumpfile generation module 420 is used for generating dump file when judgement obtains monitored thread abnormal, and described dump file comprises internal memory, the stack information of in-process each thread;
Abnormal locating module 430 is used for locating the code position at the abnormal place of monitored thread by the described dump file of debugging.
The system of the present embodiment can not only the monitoring thread running status, and when the thread operation exception, internal memory and stack information by the current operation of the automatic record thread of dump file, the developer is according to internal memory and the stack information of record, just the code position that causes that thread is abnormal be can locate fast, debugging and the reparation of thread facilitated.
Above embodiment only is used for explanation the present invention; and be not limitation of the present invention; the those of ordinary skill in relevant technologies field; without departing from the spirit and scope of the present invention; can also make a variety of changes and modification; therefore all technical schemes that are equal to also belong to category of the present invention, and scope of patent protection of the present invention should be defined by the claims.

Claims (9)

CN201310046875.0A2013-02-052013-02-05The localization method of thread exception and systemActiveCN103092746B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201310046875.0ACN103092746B (en)2013-02-052013-02-05The localization method of thread exception and system

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201310046875.0ACN103092746B (en)2013-02-052013-02-05The localization method of thread exception and system

Publications (2)

Publication NumberPublication Date
CN103092746Atrue CN103092746A (en)2013-05-08
CN103092746B CN103092746B (en)2015-12-02

Family

ID=48205347

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201310046875.0AActiveCN103092746B (en)2013-02-052013-02-05The localization method of thread exception and system

Country Status (1)

CountryLink
CN (1)CN103092746B (en)

Cited By (27)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN103810099A (en)*2013-11-212014-05-21北京奇虎科技有限公司Code tracing method and code tracing system
CN103984898A (en)*2014-05-292014-08-13北京神州绿盟信息安全科技股份有限公司Detection method and detection device for attack in spray pattern
CN104932964A (en)*2014-03-172015-09-23无锡天脉聚源传媒科技有限公司Monitoring processing method and apparatus of computer functional programs
CN105740080A (en)*2016-03-112016-07-06深圳市茁壮网络股份有限公司Program sticking detection method and processor
CN105824749A (en)*2016-03-092016-08-03上海博达数据通信有限公司Method for analyzing abnormality of user-mode progress under linux system
CN106445769A (en)*2015-08-112017-02-22腾讯科技(深圳)有限公司Computer operation monitoring method, device and system
CN106708710A (en)*2015-11-122017-05-24高德软件有限公司Thread jamming identification method and apparatus
CN106980555A (en)*2017-03-242017-07-25山东浪潮商用系统有限公司A kind of overtime thread processing method and device
CN107479986A (en)*2017-07-032017-12-15阿里巴巴集团控股有限公司The control method and device of service traffics
CN107704356A (en)*2017-06-122018-02-16平安科技(深圳)有限公司Exception stack information acquisition method, device and computer-readable recording medium
CN108153651A (en)*2016-12-062018-06-12阿里巴巴集团控股有限公司The slow abnormal localization method of card, electronic equipment and system
CN108243056A (en)*2016-12-272018-07-03大唐移动通信设备有限公司A kind of method and device for obtaining exception information
CN108415806A (en)*2018-02-072018-08-17深圳市亿联智能有限公司A kind of high efficiency thread life monitoring mode
CN108959015A (en)*2017-05-192018-12-07北京京东尚科信息技术有限公司Judge system or the method and apparatus whether system module blocks
CN109542632A (en)*2018-11-302019-03-29郑州云海信息技术有限公司A kind of method and device handling access request
CN109947636A (en)*2017-12-202019-06-28浙江宇视科技有限公司 Exception thread location method and device
CN110032435A (en)*2019-03-252019-07-19北京和利时系统工程有限公司The method and apparatus of thread are managed in control system
CN110413432A (en)*2019-07-022019-11-05Oppo广东移动通信有限公司 An information processing method, electronic device and storage medium
CN111125008A (en)*2019-12-202020-05-08浪潮电子信息产业股份有限公司Dynamic repairing method and system of abnormal inode and related components
CN111475322A (en)*2020-03-052020-07-31中国平安人寿保险股份有限公司Method and device for positioning stuck thread, computer equipment and readable storage medium
CN112948158A (en)*2021-02-192021-06-11山东英信计算机技术有限公司File sharing method, device, equipment and computer readable storage medium
CN113407368A (en)*2020-03-162021-09-17广东龙芯中科电子科技有限公司Process management method and device and electronic equipment
CN113672449A (en)*2021-07-072021-11-19浙江大华技术股份有限公司Intelligent operation and maintenance abnormity monitoring method and device, computer equipment and storage medium
CN113886142A (en)*2021-10-182022-01-04北京达佳互联信息技术有限公司File generation control method, device, server and storage medium
CN114003390A (en)*2021-11-162022-02-01平安养老保险股份有限公司 A method, apparatus, computer equipment and storage medium for determining abnormal thread
CN114625428A (en)*2020-12-102022-06-14荣耀终端有限公司Application exception processing method and electronic equipment
CN120429122A (en)*2025-07-022025-08-05国核自仪系统工程有限公司Thread debugging method, device, control system and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US5930470A (en)*1996-09-031999-07-27Kabushiki Kaisha ToshibaDebugging system and debugging method
CN1996257A (en)*2006-12-262007-07-11华为技术有限公司Method and system for monitoring process
CN102855160A (en)*2012-08-222013-01-02北京奇虎科技有限公司 Software restoration method, device and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US5930470A (en)*1996-09-031999-07-27Kabushiki Kaisha ToshibaDebugging system and debugging method
CN1996257A (en)*2006-12-262007-07-11华为技术有限公司Method and system for monitoring process
CN102855160A (en)*2012-08-222013-01-02北京奇虎科技有限公司 Software restoration method, device and system

Cited By (41)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN103810099B (en)*2013-11-212017-05-24北京奇虎科技有限公司Code tracing method and code tracing system
CN103810099A (en)*2013-11-212014-05-21北京奇虎科技有限公司Code tracing method and code tracing system
CN104932964A (en)*2014-03-172015-09-23无锡天脉聚源传媒科技有限公司Monitoring processing method and apparatus of computer functional programs
CN103984898B (en)*2014-05-292017-02-01北京神州绿盟信息安全科技股份有限公司Detection method and detection device for attack in spray pattern
CN103984898A (en)*2014-05-292014-08-13北京神州绿盟信息安全科技股份有限公司Detection method and detection device for attack in spray pattern
CN106445769A (en)*2015-08-112017-02-22腾讯科技(深圳)有限公司Computer operation monitoring method, device and system
CN106445769B (en)*2015-08-112020-12-15腾讯科技(深圳)有限公司Computer operation monitoring method, device and system
CN106708710A (en)*2015-11-122017-05-24高德软件有限公司Thread jamming identification method and apparatus
CN105824749B (en)*2016-03-092019-06-25上海博达数据通信有限公司The analysis method of User space process exception under a kind of Linux system
CN105824749A (en)*2016-03-092016-08-03上海博达数据通信有限公司Method for analyzing abnormality of user-mode progress under linux system
CN105740080B (en)*2016-03-112019-02-22深圳市茁壮网络股份有限公司A kind of stuck detection method of program and processor
CN105740080A (en)*2016-03-112016-07-06深圳市茁壮网络股份有限公司Program sticking detection method and processor
CN108153651A (en)*2016-12-062018-06-12阿里巴巴集团控股有限公司The slow abnormal localization method of card, electronic equipment and system
CN108243056A (en)*2016-12-272018-07-03大唐移动通信设备有限公司A kind of method and device for obtaining exception information
CN106980555A (en)*2017-03-242017-07-25山东浪潮商用系统有限公司A kind of overtime thread processing method and device
CN106980555B (en)*2017-03-242020-04-07山东浪潮商用系统有限公司Overtime thread processing method and device
CN108959015A (en)*2017-05-192018-12-07北京京东尚科信息技术有限公司Judge system or the method and apparatus whether system module blocks
CN107704356A (en)*2017-06-122018-02-16平安科技(深圳)有限公司Exception stack information acquisition method, device and computer-readable recording medium
US11010227B2 (en)2017-06-122021-05-18Ping An Technology (Shenzhen) Co., Ltd.Exception stack information acquisition method and device and computer-readable storage medium
CN107704356B (en)*2017-06-122019-06-28平安科技(深圳)有限公司Exception stack information acquisition method, device and computer readable storage medium
CN107479986A (en)*2017-07-032017-12-15阿里巴巴集团控股有限公司The control method and device of service traffics
CN109947636B (en)*2017-12-202022-11-04浙江宇视科技有限公司 Exception thread location method and device
CN109947636A (en)*2017-12-202019-06-28浙江宇视科技有限公司 Exception thread location method and device
CN108415806A (en)*2018-02-072018-08-17深圳市亿联智能有限公司A kind of high efficiency thread life monitoring mode
CN109542632A (en)*2018-11-302019-03-29郑州云海信息技术有限公司A kind of method and device handling access request
CN110032435A (en)*2019-03-252019-07-19北京和利时系统工程有限公司The method and apparatus of thread are managed in control system
CN110032435B (en)*2019-03-252021-06-08北京和利时系统工程有限公司Method and device for managing threads in control system
CN110413432A (en)*2019-07-022019-11-05Oppo广东移动通信有限公司 An information processing method, electronic device and storage medium
CN110413432B (en)*2019-07-022023-09-01Oppo广东移动通信有限公司Information processing method, electronic equipment and storage medium
CN111125008A (en)*2019-12-202020-05-08浪潮电子信息产业股份有限公司Dynamic repairing method and system of abnormal inode and related components
US11650875B2 (en)2019-12-202023-05-16Inspur Electronic Information Industry Co., Ltd.Abnormal inode dynamic repair method and system, and related component
CN111125008B (en)*2019-12-202022-04-22浪潮电子信息产业股份有限公司Dynamic repairing method and system of abnormal inode and related components
CN111475322A (en)*2020-03-052020-07-31中国平安人寿保险股份有限公司Method and device for positioning stuck thread, computer equipment and readable storage medium
CN113407368A (en)*2020-03-162021-09-17广东龙芯中科电子科技有限公司Process management method and device and electronic equipment
CN114625428B (en)*2020-12-102024-03-26荣耀终端有限公司Application exception processing method and electronic equipment
CN114625428A (en)*2020-12-102022-06-14荣耀终端有限公司Application exception processing method and electronic equipment
CN112948158A (en)*2021-02-192021-06-11山东英信计算机技术有限公司File sharing method, device, equipment and computer readable storage medium
CN113672449A (en)*2021-07-072021-11-19浙江大华技术股份有限公司Intelligent operation and maintenance abnormity monitoring method and device, computer equipment and storage medium
CN113886142A (en)*2021-10-182022-01-04北京达佳互联信息技术有限公司File generation control method, device, server and storage medium
CN114003390A (en)*2021-11-162022-02-01平安养老保险股份有限公司 A method, apparatus, computer equipment and storage medium for determining abnormal thread
CN120429122A (en)*2025-07-022025-08-05国核自仪系统工程有限公司Thread debugging method, device, control system and electronic equipment

Also Published As

Publication numberPublication date
CN103092746B (en)2015-12-02

Similar Documents

PublicationPublication DateTitle
CN103092746B (en)The localization method of thread exception and system
CN114328102B (en) Equipment status monitoring method, device, equipment and computer-readable storage medium
WO2015169199A1 (en)Anomaly recovery method for virtual machine in distributed environment
CN103415840A (en)Error management across hardware and software layers
CN102394791A (en)Downtime recovery method and system
US20210109800A1 (en)Method and apparatus for monitoring device failure
CN116820820A (en) Server fault monitoring method and system
WO2017220013A1 (en)Service processing method and apparatus, and storage medium
CN117032974A (en)Dynamic scheduling method and terminal based on resource application
CN112905375A (en)Self-recovery method and device of double-core intelligent ammeter management unit and computer equipment
CN117573306A (en)Batch task scheduling system, method, device, computer equipment and storage medium
US8230446B2 (en)Providing a computing system with real-time capabilities
US8984333B2 (en)Automatic computer storage medium diagnostics
CN104834584A (en)Method and system for monitoring host computer hardware loads
CN119690754A (en) A memory fault processing method, device, medium and server
US20140164851A1 (en)Fault Processing in a System
JP6880961B2 (en) Information processing device and log recording method
CN104158843A (en)Storage unit invalidation detecting method and device for distributed file storage system
CN116955072A (en)Container abnormality monitoring method, monitoring device, storage medium and server
CN120086053B (en)Server and processor error processing method, device, medium and program product
JP3596744B2 (en) Resource use status monitoring control method and recording medium recording the program
US20140047102A1 (en)Network monitoring
KR102781009B1 (en)Smart led display device capable of active failure prediction and response using failure prediction data
CN119645773B (en) A flexible scheduling method for log data collection
CN117743008B (en) Multi-core processor fault diagnosis and exception handling method, main control board and equipment

Legal Events

DateCodeTitleDescription
C06Publication
PB01Publication
C10Entry into substantive examination
SE01Entry into force of request for substantive examination
C14Grant of patent or utility model
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp