CN101593147A - Abnormal information dump method based on symbol file - Google Patents
Abnormal information dump method based on symbol file Download PDFInfo
- Publication number
- CN101593147A CN101593147A CNA2009100493440A CN200910049344A CN101593147A CN 101593147 A CN101593147 A CN 101593147A CN A2009100493440 A CNA2009100493440 A CN A2009100493440A CN 200910049344 A CN200910049344 A CN 200910049344A CN 101593147 A CN101593147 A CN 101593147A
- Authority
- CN
- China
- Prior art keywords
- abnormal information
- symbol
- method based
- dump
- abnormal
- 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.)
- Pending
Links
Abstract
The present invention relates to the abnormal information dump method based on symbol file, this method comprises: catching exception; Determine abnormal module; The location out-of-the way position; Obtain symbolic information; The dump abnormal information.Compared with prior art, advantage of the present invention comprises: directly read information the process address space from internal memory, again based on symbol file, directly abnormal information is dumped in the journal file, simplified the abnormal information view procedure; Can customize output format, for example export XML file, Syslog file, or write in the database.
Description
Technical field
The present invention relates to the abnormal information dump method, relate in particular to abnormal information dump method based on symbol file.
Background technology
When software systems are moved,, may cause system crash if gross error takes place.At this moment, if not by aid, be difficult to find the reason that causes program crashing.
Current most of software systems at first generate the DUMP file when program crashing, this document has comprised the internal memory binary data in the process address space, be written into the DUMP file by the WinDbg instrument then, and check required abnormal information by importing relevant order.Although this technology has solved the position of finder collapse, process is comparatively complicated.In order to check abnormal information simply and easily, a kind of abnormal information dump technology has been proposed, realized that the binary message in the internal memory is formatted into character directly to be dumped in the journal file.Find there is not the method for this respect at present through the file retrieval.
Summary of the invention
Purpose of the present invention is exactly in order to overcome the defective that above-mentioned prior art exists, the abnormal information dump method of a kind of high-efficiency reliable based on symbol file to be provided.
Purpose of the present invention can be achieved through the following technical solutions: the abnormal information dump method based on symbol file is characterized in that this method comprises:
(1) catching exception;
(2) determine abnormal module;
(3) location out-of-the way position;
(4) obtain symbolic information;
(5) dump abnormal information.
Described catching exception is for taking place when unusual when program, and system dishes out unusually, and this is encapsulated in the anomaly sxtructure body unusually, and the content of each register of acquisition CPU obtains current function calls stack frame by the value in the register from this anomaly sxtructure body.
Described definite abnormal module utilizes the stack frame to determine to take place unusual program module with respect to the side-play amount of program for after successfully obtaining function stack frame.
Unusual function name takes place, is expert at and filename by the location in described location out-of-the way position.
Described acquisition symbolic information obtains function parameters and local variable for just enumerating by call back function in this stack frame.
Described dump abnormal information when exporting its value, is come distinctive signs by the size and the type of symbol for symbol is formatd.
In the described catching exception, system simultaneously or dish out a plurality of unusually in the very short time of being separated by, catching exception has been to having carried out unusually synchronously of dishing out, and only allows to produce entering unusually the earliest, and this is handled unusually.
In the described dump abnormal information, corresponding two values of symbol during actual output are used for supporting pointer variable and fundamental type variable respectively.
Compared with prior art, advantage of the present invention comprises:
(1) directly reads information the process address space,, directly abnormal information is dumped in the journal file, simplified the abnormal information view procedure again based on symbol file from internal memory;
(2) can customize output format, for example export XML file, Syslog file, or write in the database.
Embodiment
The present invention will be further described below in conjunction with specific embodiment.
Dish out in function testFunc divided by in 0 the unusual application software system below in conjunction with the present invention, we suppose that cpu type is Intel X86, and operating system is Windows Xp, specifically sets forth its embodiment, and concrete steps are as follows:
(1) catching exception.After system dishes out and removes 0 operation exception, judge abnormal cause according to abnormality code, output INT_DIVIDE_BY_ZERO, the top-of-stack pointer of current thread, bottom of stack pointer, the register of the memory address correspondence that next cpu instruction is deposited is respectively ESP=0013F730, EBP=0013F7F4, EIP=00409948, and the value among the register EBP is unusual function stack frame address takes place.Different Machine Types or different operating system, the stack frame layout structure of function is different, so define cpu type (Intel X86) and operating system (Windows Xp) here.
(2) determine abnormal module.It is 00400000 that unusual function module handle value takes place, and can obtain the module title thus.
(3) location out-of-the way position.By top function stack frame the information of being expert at being taken place unusually, is comprised place file path, place function name testFunc, line number, and the place module.
(4) obtain symbolic information.After the information that successfully obtains next stack frame, all variablees and parameter in this frame all to be enumerated out.
(5) dump abnormal information.Owing to be to come distinctive signs by the size and the type of symbol, when the size and the type of two symbols was all identical, two symbols are the variable of same type not necessarily.The pointer variable of the automatic variable of floating type and floating type for example, their size all is 4, type all is a floating type.The value of each symbol to have been carried out two types format in order addressing this problem, to be respectively pointer variable and fundamental type variable.If variable is pointer, the value of reference pointer variable then, otherwise with reference to the value of fundamental type variable.
The present invention utilizes dbghelp.dll that Microsoft provides as base library, based on the corresponding symbol file, and selectable derivative function allocating stack, and according to the value of information format variable such as Symbol Type and size and parameter.When unusual the generation, the related data in the space, program address is dumped in the journal file, can from journal file, directly obtain taking place module, row, file and the place function at unusual code place, and write down unusual function calls storehouse has taken place, the local variable of each function, parameter and their value, global variable in the process and corresponding value, thus judge make mistakes reason and position fast and accurately.
Below the inventive method is further described, method comprises the steps:
(1) catching exception.When program takes place when unusual, system dishes out unusually, and this is encapsulated in the anomaly sxtructure body unusually, obtains the content of each register of CPU from this anomaly sxtructure body, obtains current function calls stack frame by the value in the register.
(2) determine abnormal module.If successfully obtain function stack frame, utilize the stack frame to determine unusual program module takes place, otherwise this inventive method can not obtain correct execution with respect to the side-play amount of program.
(3) location out-of-the way position.Can locate equally then unusual function name takes place, institute is expert at and filename.
(4) obtain symbolic information.In this stack frame, just can enumerate and obtain function parameters and local variable by call back function.
(5) dump abnormal information.Symbol is formatd, when exporting its value, come distinctive signs by the size and the type of symbol.Corresponding two values of symbol during actual output are used for supporting pointer variable and fundamental type variable.
At first automatic catching exception after the present invention produces unusually in program operation process, then the mapping function name, the institute be expert at, the place filename, and function parameters and local variable, the value of final format parameter and variable, and these information are outputed in the journal file.The accuracy of the function call of technology of the present invention when program crashing is provided, variable, parameter and comprehensive aspect still belong to initiative, the reason and the position of finder collapse fast are to improve program development efficient.The present invention is used to application program, information such as the allocating stack state of collecting when the application crash based on this technology, each register value, for the program crashing reason search and finder collapse position provides more crucial information.
Claims (8)
1. based on the abnormal information dump method of symbol file, it is characterized in that this method comprises:
(1) catching exception;
(2) determine abnormal module;
(3) location out-of-the way position;
(4) obtain symbolic information;
(5) dump abnormal information.
2. the abnormal information dump method based on symbol file according to claim 1, it is characterized in that, described catching exception is for taking place when unusual when program, system dishes out unusually, this is encapsulated in the anomaly sxtructure body unusually, from this anomaly sxtructure body, obtain the content of each register of CPU, obtain current function calls stack frame by the value in the register.
3. the abnormal information dump method based on symbol file according to claim 1 is characterized in that, described definite abnormal module utilizes the stack frame to determine to take place unusual program module with respect to the side-play amount of program for after successfully obtaining function stack frame.
4. the abnormal information dump method based on symbol file according to claim 1 is characterized in that, described location out-of-the way position unusual function name takes place, be expert at and filename by the location.
5. the abnormal information dump method based on symbol file according to claim 1 is characterized in that, described acquisition symbolic information obtains function parameters and local variable for just enumerating by call back function in this stack frame.
6. the abnormal information dump method based on symbol file according to claim 1 is characterized in that, described dump abnormal information when exporting its value, is come distinctive signs by the size and the type of symbol for symbol is formatd.
7. the abnormal information dump method based on symbol file according to claim 2, it is characterized in that, in the described catching exception, it is a plurality of unusual to dish out in the system's while or the very short time of being separated by, catching exception is to having carried out unusually synchronously of dishing out, only allow to produce entering unusually the earliest, and this is handled unusually.
8. the abnormal information dump method based on symbol file according to claim 6 is characterized in that, in the described dump abnormal information, corresponding two values of symbol during actual output are used for supporting pointer variable and fundamental type variable respectively.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNA2009100493440A CN101593147A (en) | 2009-04-15 | 2009-04-15 | Abnormal information dump method based on symbol file |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNA2009100493440A CN101593147A (en) | 2009-04-15 | 2009-04-15 | Abnormal information dump method based on symbol file |
Publications (1)
Publication Number | Publication Date |
---|---|
CN101593147A true CN101593147A (en) | 2009-12-02 |
Family
ID=41407814
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CNA2009100493440A Pending CN101593147A (en) | 2009-04-15 | 2009-04-15 | Abnormal information dump method based on symbol file |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101593147A (en) |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102306119A (en) * | 2011-06-30 | 2012-01-04 | 北京新媒传信科技有限公司 | System for capturing global exception and method |
CN105224451A (en) * | 2015-09-07 | 2016-01-06 | 百度在线网络技术(北京)有限公司 | A kind of disposal route of script file and system |
CN105824749A (en) * | 2016-03-09 | 2016-08-03 | 上海博达数据通信有限公司 | Method for analyzing abnormality of user-mode progress under linux system |
CN107391358A (en) * | 2016-05-17 | 2017-11-24 | 大唐移动通信设备有限公司 | A kind of method for processing abnormal data and system |
WO2017215439A1 (en) * | 2016-06-16 | 2017-12-21 | 中兴通讯股份有限公司 | Variable information extraction method, apparatus and computer storage medium |
CN108133149A (en) * | 2018-01-11 | 2018-06-08 | 武汉斗鱼网络科技有限公司 | A kind of data guard method, device and electronic equipment |
CN108334515A (en) * | 2017-01-20 | 2018-07-27 | 阿里巴巴集团控股有限公司 | The method, apparatus and system of stack address in file are collapsed in a kind of processing |
CN110032502A (en) * | 2018-01-11 | 2019-07-19 | 武汉斗鱼网络科技有限公司 | A kind of method, apparatus and electronic equipment of abnormality processing |
-
2009
- 2009-04-15 CN CNA2009100493440A patent/CN101593147A/en active Pending
Cited By (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102306119A (en) * | 2011-06-30 | 2012-01-04 | 北京新媒传信科技有限公司 | System for capturing global exception and method |
CN105224451A (en) * | 2015-09-07 | 2016-01-06 | 百度在线网络技术(北京)有限公司 | A kind of disposal route of script file and system |
CN105224451B (en) * | 2015-09-07 | 2018-12-14 | 百度在线网络技术(北京)有限公司 | A kind of processing method and system of script file |
CN105824749B (en) * | 2016-03-09 | 2019-06-25 | 上海博达数据通信有限公司 | The analysis method of User space process exception under a kind of Linux system |
CN105824749A (en) * | 2016-03-09 | 2016-08-03 | 上海博达数据通信有限公司 | Method for analyzing abnormality of user-mode progress under linux system |
CN107391358A (en) * | 2016-05-17 | 2017-11-24 | 大唐移动通信设备有限公司 | A kind of method for processing abnormal data and system |
CN107391358B (en) * | 2016-05-17 | 2020-08-28 | 大唐移动通信设备有限公司 | Abnormal data processing method and system |
WO2017215439A1 (en) * | 2016-06-16 | 2017-12-21 | 中兴通讯股份有限公司 | Variable information extraction method, apparatus and computer storage medium |
CN108334515A (en) * | 2017-01-20 | 2018-07-27 | 阿里巴巴集团控股有限公司 | The method, apparatus and system of stack address in file are collapsed in a kind of processing |
CN108334515B (en) * | 2017-01-20 | 2022-07-15 | 阿里巴巴集团控股有限公司 | Method, device and system for processing stack address in crash file |
CN110032502A (en) * | 2018-01-11 | 2019-07-19 | 武汉斗鱼网络科技有限公司 | A kind of method, apparatus and electronic equipment of abnormality processing |
CN108133149A (en) * | 2018-01-11 | 2018-06-08 | 武汉斗鱼网络科技有限公司 | A kind of data guard method, device and electronic equipment |
CN110032502B (en) * | 2018-01-11 | 2023-05-26 | 广州市康锦信息技术有限公司 | Abnormality processing method and device and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101593147A (en) | Abnormal information dump method based on symbol file | |
CN101539883B (en) | Error tracking method of embedded system and device thereof | |
CN102541521B (en) | Automatic operating instruction generating device based on structured query language and method | |
CN101719090A (en) | Method for automatically analyzing crash cause of computer software system | |
CN111078702B (en) | SQL sentence classification management and unified query method and device | |
CN106294134A (en) | The collapse localization method of code and device | |
CN102841832B (en) | Error memory chip locating method | |
CN101154185A (en) | Method for performing recovery and playback when running software | |
CN1485740A (en) | General purpose testing arrangement for embedded module and subsystem based on host machine platform | |
CN115328853A (en) | AUTOSAR-based file configuration method and device | |
CN112542199A (en) | Method, circuit, storage medium and terminal for detecting flash storage error | |
CN109002033A (en) | Automation calibration system and method based on UDS | |
CN111061802A (en) | Power data management processing method and device and storage medium | |
CN103198011B (en) | A kind of method and device detecting JAVA program file disturbance | |
CN102193787B (en) | Methods for serialization and de-serialization, device and system | |
CN113239106A (en) | Excel file export method and device, electronic equipment and storage medium | |
JP4023736B2 (en) | Method for electronically testing memory modules | |
CN111209135A (en) | Log processing method and device | |
CN109558315A (en) | The determination method, device and equipment of test scope | |
CN113741411A (en) | Generation method and system of global variable point product file of distributed control system | |
CN110096292B (en) | Method and system for refreshing BIOS firmware of server in self-adaptive manner | |
CN112596485A (en) | Method and device for packaging and reusing configuration data in industrial control system | |
CN111880078A (en) | Method and equipment for automated instruction testing | |
CN101458968B (en) | Method and device for obtaining disabled binary digit distribution information in non-volatile memory | |
CN112347095B (en) | Data table processing method, device and server |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C02 | Deemed withdrawal of patent application after publication (patent law 2001) | ||
WD01 | Invention patent application deemed withdrawn after publication |
Open date: 20091202 |