CN112965892A - Abnormal information acquisition method and device for software system, electronic equipment and medium - Google Patents

Abnormal information acquisition method and device for software system, electronic equipment and medium Download PDF

Info

Publication number
CN112965892A
CN112965892A CN201911275572.XA CN201911275572A CN112965892A CN 112965892 A CN112965892 A CN 112965892A CN 201911275572 A CN201911275572 A CN 201911275572A CN 112965892 A CN112965892 A CN 112965892A
Authority
CN
China
Prior art keywords
abnormal
information
software system
exception
gdb
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
CN201911275572.XA
Other languages
Chinese (zh)
Other versions
CN112965892B (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 Ltd filed Critical Datang Mobile Communications Equipment Co Ltd
Priority to CN201911275572.XA priority Critical patent/CN112965892B/en
Publication of CN112965892A publication Critical patent/CN112965892A/en
Application granted granted Critical
Publication of CN112965892B publication Critical patent/CN112965892B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3636Software debugging by tracing the execution of the program
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the invention discloses a method, a device, electronic equipment and a medium for acquiring abnormal information of a software system, wherein the method comprises the following steps: if an abnormal signal preset in a software system is received, acquiring an abnormal thread in an abnormal process corresponding to the abnormal signal through a gdb function of a debugging tool; and acquiring the abnormal information of the abnormal thread according to the gdb instruction, and storing the abnormal information into a state log. According to the embodiment of the invention, the abnormal thread is obtained through the gdb function, the accurate and complete abnormal information of the abnormal thread is obtained through the gdb instruction and is stored in the state log, and the abnormal information can be conveniently and comprehensively positioned at any time in the follow-up process.

Description

Abnormal information acquisition method and device for software system, electronic equipment and medium
Technical Field
The invention relates to the technical field of communication, in particular to an abnormal information acquisition method and device of a software system, electronic equipment and a medium.
Background
With the popularization and development of communication technology, the requirement on the processing capacity of a base station is higher and higher, the number of software running in the base station is increased explosively, but the quality of products is uneven, a plurality of products frequently collapse during running, and if abnormal information cannot be comprehensively positioned, the abnormal information can have great influence on a terminal user connected with the base station.
When the software system in the base station is abnormal, in order to accurately analyze and solve the problem, detailed information of the abnormal point needs to be recorded. In the prior art, function-level calling information is acquired from the calling relationship of the abnormal point analysis task stack through a system backup function, but accurate information in the function cannot be acquired, so that a certain obstacle is brought to the positioning of abnormal information.
Disclosure of Invention
Because the existing method has the above problems, embodiments of the present invention provide a method, an apparatus, an electronic device, and a medium for acquiring exception information of a software system.
In a first aspect, an embodiment of the present invention provides a method for acquiring exception information of a software system, where the method includes:
if an abnormal signal preset in a software system is received, acquiring an abnormal thread in an abnormal process corresponding to the abnormal signal through a gdb function of a debugging tool;
and acquiring the abnormal information of the abnormal thread according to the gdb instruction, and storing the abnormal information into a state log.
Optionally, the method for acquiring exception information of the software system further includes:
and extracting the abnormal information from the state log, and positioning the abnormal position of the function according to the abnormal information.
Optionally, the anomaly information comprises at least one of: exception thread stack information, exception thread local variable information and exception thread register information;
the anomaly signal includes at least one of: SIGHUP, SIGILL, SIGTRAP, SIGABRT, and SIGSEGG.
Optionally, before the step of obtaining, by a gdb function of a debugging tool, an exception thread in an exception process corresponding to the exception signal if the exception signal preset in the software system is received, the method further includes:
acquiring a created file path, and creating a standard input file and a standard output file under the created file path;
and redirecting the standard input of the gdb function according to the standard input file, and redirecting the standard output of the gdb function according to the standard output file.
Optionally, before the step of obtaining, by a gdb function of a debugging tool, an exception thread in an exception process corresponding to the exception signal if the exception signal preset in the software system is received, the method further includes:
and registering a gdb function of the software system, and replacing the default abnormal post-processing function of the software system with the gdb function.
Optionally, the debug information and the symbol table information are carried by the software system when the source code is compiled.
In a second aspect, an embodiment of the present invention further provides an abnormal information acquiring apparatus for a software system, including:
the abnormal thread acquisition module is used for acquiring an abnormal thread in an abnormal process corresponding to an abnormal signal through a gdb function of a debugging tool if the abnormal signal preset in the software system is received;
and the abnormal information acquisition module is used for acquiring the abnormal information of the abnormal thread according to the gdb instruction and storing the abnormal information into a state log.
Optionally, the apparatus for acquiring exception information of the software system further includes:
and the abnormal position positioning module is used for extracting the abnormal information from the state log and positioning the abnormal position of the function according to the abnormal information.
Optionally, the anomaly information comprises at least one of: exception thread stack information, exception thread local variable information and exception thread register information;
the anomaly signal includes at least one of: SIGHUP, SIGILL, SIGTRAP, SIGABRT, and SIGSEGG.
Optionally, the apparatus for acquiring exception information of the software system further includes:
the file creating module is used for acquiring a created file path and creating a standard input file and a standard output file under the created file path;
and the redirection module is used for redirecting the standard input of the gdb function according to the standard input file and redirecting the standard output of the gdb function according to the standard output file.
Optionally, the apparatus for acquiring exception information of the software system further includes:
and registering a gdb function of the software system, and replacing the default abnormal post-processing function of the software system with the gdb function.
Optionally, the debug information and the symbol table information are carried by the software system when the source code is compiled.
In a third aspect, an embodiment of the present invention further provides an electronic device, including:
at least one processor; and
at least one memory communicatively coupled to the processor, wherein:
the memory stores program instructions executable by the processor, which when called by the processor are capable of performing the above-described methods.
In a fourth aspect, an embodiment of the present invention further provides a non-transitory computer-readable storage medium storing a computer program, which causes the computer to execute the above method.
According to the technical scheme, the abnormal thread is obtained through the gdb function, the accurate and complete abnormal information of the abnormal thread is obtained through the gdb instruction and is stored in the state log, and therefore the abnormal information can be conveniently and comprehensively positioned at any time in the follow-up process.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic flowchart of an exception information obtaining method of a software system according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of an abnormal information acquiring apparatus of a software system according to an embodiment of the present invention;
fig. 3 is a logic block diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The following further describes embodiments of the present invention with reference to the accompanying drawings. The following examples are only for illustrating the technical solutions of the present invention more clearly, and the protection scope of the present invention is not limited thereby.
Fig. 1 shows a schematic flowchart of an exception information obtaining method of a software system provided in this embodiment, including:
s101, if an abnormal signal preset in a software system is received, acquiring an abnormal thread in an abnormal process corresponding to the abnormal signal through a gdb function of a debugging tool.
The preset exception signal is an exception signal frequently encountered in a software system. The anomaly signal includes at least one of: SIGHUP, SIGILL, SIGTRAP, SIGABRT, and SIGSEGG.
gdb is a debugging tool under UNIX and UNIX-like systems, and the gdb function is a function provided in the debugging tool.
The abnormal process is a process which sends an abnormal signal currently.
The exception thread is a process which sends an exception signal currently.
It should be noted that, before the exception information obtaining method of the software system provided in this embodiment is executed, the gdb component needs to be installed in the software system, and the software system carries debug information and symbol table information when compiling the source code.
S102, obtaining the abnormal information of the abnormal thread according to the gdb instruction, and storing the abnormal information into a state log.
The gdb instruction is an instruction provided by a gdb debugging tool and used for acquiring exception information of an exception thread.
The exception information is extracted from an exception thread and includes at least one of the following items: exception thread stack information, exception thread local variable information, and exception thread register information.
The state log is used for storing the abnormal information of the abnormal thread, and is convenient to check at any time in the follow-up process.
Specifically, when an abnormal signal occurs in the software system, the running script provided in this embodiment can be automatically executed, an abnormal thread in an abnormal process corresponding to the abnormal signal is obtained through a gdb function of the debugging tool, the abnormal information of the abnormal thread is obtained according to a gdb instruction, the abnormal information is stored in a state log, and detailed abnormal information can be automatically obtained when a task abnormality occurs in the software system.
According to the method and the device, the abnormal thread is obtained through the gdb function, the accurate and complete abnormal information of the abnormal thread is obtained through the gdb instruction and is stored in the state log, and the abnormal information can be conveniently and comprehensively positioned at any time in the follow-up process.
Further, on the basis of the above method embodiment, the method for acquiring exception information of a software system further includes:
and extracting the abnormal information from the state log, and positioning the abnormal position of the function according to the abnormal information.
Specifically, the abnormality information acquired by the related art is:
no 1- -current task exception information
I task ID of 0xfffffffe
| task name ShadowTask.1120
I message time count 0
I abnormal vector 0xb (segmentation fault)
I PC register 0x00007fff1578e7ba
0x000000000000000e | DAR register
I SP register 0x00007fff252160c0
65535 type of recent message
Current message type 65535
I nearest message pointer 0x0000000000000000
I Current message pointer 0x0000000000000000
I Current message Length 0
I current message record Length 0
L current message record content:
i monitoring task private variable 0
Number of resets after | Exception 0
[ tt ]/ramDisk/hbpod _ bcp _ dd _ major. so (xx _ Get _ Call _ Info +0x142) [0x7fff157c4542]
[tt]/ramDisk/hbpod_bcp_dd_major.so(Osp_Task_Exc_Monitor+0x57b)[0x7fff157b23fb]
[tt]/ramDisk/hbpod_bcp_dd_major.so(MyExcHookFunc+0x5b)[0x7fff157c372b]
[tt]/lib64/libpthread.so.0(+0x10c60)[0x7ffff70a1c60]
[tt]/ramDisk/hbpod_bcp_dd_major.so(Osp_Free_Mem+0x1a)[0x7fff1578e7ba]
[tt]/usr/software/libtpf.so(nb_tpf_input_command+0x5fe)[0x7fff167f64fe]
[tt]/lib64/libpthread.so.0(+0x73d4)[0x7ffff70983d4]
[tt]/lib64/libc.so.6(clone+0x6d)[0x7ffff761d90d]
The exception information recorded by the exception information acquiring method of the software system provided by the embodiment is as follows:
no 1- -current task exception information
I task ID of 0xfffffffe
| task name ShadowTask.1120
I message time count 0
I abnormal vector 0xb (segmentation fault)
I PC register 0x00007fff1578e7ba
0x000000000000000e | DAR register
I SP register 0x00007fff252160c0
65535 type of recent message
Current message type 65535
I nearest message pointer 0x0000000000000000
I Current message pointer 0x0000000000000000
I Current message Length 0
I current message record Length 0
L current message record content:
i monitoring task private variable 0
Number of resets after | Exception 0
[ tt ]/ramDisk/hbpod _ bcp _ dd _ major. so (xx _ Get _ Call _ Info +0x142) [0x7fff157c4542]
[tt]/ramDisk/hbpod_bcp_dd_major.so(Osp_Task_Exc_Monitor+0x57b)[0x7fff157b23fb]
[tt]/ramDisk/hbpod_bcp_dd_major.so(MyExcHookFunc+0x5b)[0x7fff157c372b]
[tt]/lib64/libpthread.so.0(+0x10c60)[0x7ffff70a1c60]
[tt]/ramDisk/hbpod_bcp_dd_major.so(Osp_Free_Mem+0x1a)[0x7fff1578e7ba]
[tt]/usr/software/libtpf.so(nb_tpf_input_command+0x5fe)[0x7fff167f64fe]
[tt]/lib64/libpthread.so.0(+0x73d4)[0x7ffff70983d4]
[tt]/lib64/libc.so.6(clone+0x6d)[0x7ffff761d90d]
Information of | GDB:
#6<signal handler called>
#7Osp_Free_Mem(ppMem=0xe)
at../../OSP_V2/osp_a/posix/mem/osp_mem_critical.c:1549
#8 0x00007fff167f64fe in nb_tpf_input_command()from/usr/software/libtpf.so
#9 0x00007ffff70983d4 in start_thread(arg=0x7fff25217340)
at pthread_create.c:460
#10 0x00007ffff761d90d in clone()
at../sysdeps/unix/sysv/linux/x86_64/clone.S:109
(gdb)#7Osp_Free_Mem(ppMem=0xe)
at../../OSP_V2/osp_a/posix/mem/osp_mem_critical.c:1549(gdb)Ret=<optimized out>
pMem=<optimized out>
pstruBlkHead=<optimized out>
pstruBlkHeadTmp=<optimized out>
pstruBlkTail=<optimized out>
PoolId=<optimized out>
pstruPoolStableCB=<optimized out>
pstruPoolDynamicCB=<optimized out>
u8BlkSizeId=<optimized out>
ppBlkFreeListsHead=<optimized out>
pBlkFreeListsHead=<optimized out>
BlkHeadPhyAddr=<optimized out>
FreeListHeadPhyAddr=<optimized out>
BlkVirtAddr=<optimized out>
CurTaskId=<optimized out>
BlkOwner=<optimized out>
pstruBlkStatInfo=<optimized out>
MutexId=<optimized out>
s32PoolType=<optimized out>
(gdb)Stack level 7,frame at 0x7fff25216130:
rip=0x7fff1578e7ba in Osp_Free_Mem
(../../OSP_V2/osp_a/posix/mem/osp_mem_critical.c:1549);
saved rip=0x7fff167f64fe
called by frame at 0x7fff25216ba0,caller of frame at0x7fff252160c0
source language c.
Arglist at 0x7fff252160b8,args:ppMem=0xe
Locals at 0x7fff252160b8,Previous frame's sp is 0x7fff25216130
Saved registers:
rbx at 0x7fff252160f8,rbp at 0x7fff25216100,r12 at0x7fff25216108,
r13 at 0x7fff25216110,r14 at 0x7fff25216118,r15 at0x7fff25216120,
rip at 0x7fff25216128
(gdb)rax 0x0 0
rbx 0x0 0
rcx 0x0 0
rdx 0x0 0
rsi 0x0 0
rdi 0xe 14
rbp 0xe 0xe
rsp 0x7fff252160c0 0x7fff252160c0
r8 0x0 0
r9 0x0 0
r10 0x1999999999999999 1844674407370955161
r11 0x0 0
r12 0x0 0
r13 0x7fff25216760 140733816334176
r14 0x7fff25216360 140733816333152
r15 0x7fff25216360 140733816333152
rip 0x7fff1578e7ba 0x7fff1578e7ba
<Osp_Free_Mem+26>
eflags 0x3246[PF ZF IF#12#13]
cs 0x33 51
ss 0x2b 43
ds 0x0 0
es 0x0 0
fs 0x0 0
gs 0x0 0
by comparing, it can be found that the abnormal information recorded by the abnormal information acquiring method of the software system provided by the embodiment is more detailed, including local variables, abnormal line numbers, register information and the like, which are recorded, so that the field information of the abnormal information can be conveniently acquired at any time in the follow-up process, the detailed abnormal information can be analyzed, all the abnormal information can be rapidly determined, and the abnormal position of the function can be rapidly located and solved.
Further, on the basis of the above embodiment of the method, before S101, the method further includes:
acquiring a created file path, and creating a standard input file and a standard output file under the created file path;
and redirecting the standard input of the gdb function according to the standard input file, and redirecting the standard output of the gdb function according to the standard output file.
Wherein the create file path subsequently creates paths for a standard input file and a standard output file.
The standard input file is a file used for performing standard input subsequently.
The standard output file is a file used for standard output in the following process.
For example, in a specific execution process, the method for acquiring exception information of a software system according to this embodiment first acquires an exception process and a thread number from an entry parameter of a system call, and acquires a path of a created file as follows: pid $ 1; tid ═ 2; path $ 3.
Standard input and standard output files are then created: inputfile ═ path/gdb _ info _ in; outputfile ═ path/gdb _ info _ out.
The standard inputs and outputs of the gdb software are then redirected: exec 998< > $outputfile; exec 999< > $inputfile.
And then operating the gdb function and acquiring the abnormal thread information: gdb < &999> & 998.
Attach to exception process: echo attach $ pid > > $ inputfile.
Acquiring in-process thread information: echo info threads > $ inputfile.
Acquiring abnormal thread information: gdb _ tid $ (cat $ outputfile | grep sysboot | grep "LWP $ tid" | awk '{ print $1 }').
Attach to exception thread: echo thread $ gdb _ tid > $ inputfile.
Exception thread stack information echo bt > > $ inputfile is obtained.
Acquiring local variable information of the abnormal thread: echo info locals > $ inputfile.
Obtaining exception thread register information: echo info registers > $ inputfile.
And finally, reading the abnormal information from the standard output file and recording the abnormal information into a cache.
Further, on the basis of the above embodiment of the method, before S101, the method further includes:
and registering a gdb function of the software system, and replacing the default abnormal post-processing function of the software system with the gdb function.
Specifically, when the software system is abnormal, in the abnormal signal post-processing branch, a shell script is specified to run under certain signal branches, a gdb debugging tool is run in the script, an abnormal function is automatically identified, the detailed content of abnormal information is analyzed, and the abnormal information is recorded in a log.
Firstly, registering an abnormal signal post-processing function of the system, and replacing the default abnormal post-processing function of the system. The signals of the system comprise: 1) SIGHUP, 2) SIGING, 3) SIGQUIT, 4) SIGLL, 5) SIGTRAP, 6) SIGABRT, 7) SIGBUS, 8) SIGFAPE, 9) SIGKILL, 10) SIGURR 1, 11) SIGSEGGV, 12) SIGURR 2, 13) SIGPIPE, 14) SIGALUM, 15) SIGTERM, 16) SIGSTKFLT, 17) SIGCHLD, 18) SIGCON, 19) SIGTOP, 20) SIGTIP, 21) SIGTIN, 22) SIGTIU, 23) SIGURG, 24) SIGXCPU, 25) SIGGSZ, 26) SIGVTALRM, 27) SIGPROF, 28) SIGGIINCCH, 29) SIGPRO, 30) SIGPROR, 31) SIGSYS, 34) SIGGRIN, 35) SIGGRIN + 1), 36) SIGGRIN, 4) SIGGRIN, 11) SIGGRIN + 48), SIGGRIN, 11) SIGGRIN + 5) SIGGRIN, 11) SIGGRIN + TMR, 11) SIGGRIN + 25), SIGGRIN, 11 + TMGRIN, SIGGRIN, 11 + 48), SIGGRIN, 11 + 23) SIGGRIN, 11 + TMR, SIGGRIN, 11 + 23) SIGGRIN, 23) SIGGRIN, 11 + 23) SIGGRIN, SIGRIN, 23) SIGGRIN, 11 + 23) SIGGRIN, SIGRIN, 11 + 23) SIGGRIN, SIGRIN, 11 +1, SIGRIN, 11 + 23) SIGGRIN, SI, 55) SIGTMAX-9, 56) SIGTMAX-8, 57) SIGTMAX-7, 58) SIGTMAX-6, 59) SIGTMAX-5, 60) SIGTMAX-4, 61) SIGTMAX-3, 62) SIGTMAX-2, 63) SIGTMAX-1 and 64) SIGTMAX. The abnormal signals frequently encountered in the software system comprise 1) SIGHUP, 4) SIGLL, 5) SIGTRAP, 6) SIGABRT and 11) SIGSEEGV, and the customized signal post-processing function is registered for the abnormal signals through a system interface, and the called system interface is sign (SIG, strSigAction, NULL). After the abnormal signal processing function is registered, the system can call the post-processing function MyExcHookFunc registered in the embodiment after receiving the abnormal signals, a shell script can be executed in the abnormal post-processing function through system () system call, a gdb component is operated in the shell script, the abnormal process is attached to the abnormal process through a gdb tool, then the abnormal thread is obtained, the specific information, the local variables, the abnormal row number, CPU register array data and the like of the abnormal function of the thread are obtained through an internal instruction of the gdb, and the specific information, the local variables, the abnormal row number, the CPU register array data and the like are recorded in a state log. The user obtains the abnormal detailed information by extracting the log, thereby being convenient for positioning the abnormity of the function and rapidly solving the problem of the software system.
Fig. 2 is a schematic structural diagram illustrating an exception information acquiring apparatus of a software system according to this embodiment, where the apparatus includes: an exception thread obtaining module 201 and an exception information obtaining module 202, wherein:
the abnormal thread acquiring module 201 is configured to, if an abnormal signal preset in the software system is received, acquire an abnormal thread in an abnormal process corresponding to the abnormal signal through a gdb function of a debugging tool;
the exception information acquiring module 202 is configured to acquire exception information of the exception thread according to the gdb instruction, and store the exception information in a state log.
Specifically, if the abnormal thread acquiring module 201 receives an abnormal signal preset in the software system, the abnormal thread in the abnormal process corresponding to the abnormal signal is acquired through a gdb function of a debugging tool; the exception information obtaining module 202 obtains the exception information of the exception thread according to the gdb instruction, and stores the exception information into a state log.
According to the method and the device, the abnormal thread is obtained through the gdb function, the accurate and complete abnormal information of the abnormal thread is obtained through the gdb instruction and is stored in the state log, and the abnormal information can be conveniently and comprehensively positioned at any time in the follow-up process.
Further, on the basis of the above device embodiment, the exception information acquiring device of the software system further includes:
and the abnormal position positioning module is used for extracting the abnormal information from the state log and positioning the abnormal position of the function according to the abnormal information.
Further, on the basis of the above apparatus embodiment, the anomaly information comprises at least one of: exception thread stack information, exception thread local variable information and exception thread register information;
the anomaly signal includes at least one of: SIGHUP, SIGILL, SIGTRAP, SIGABRT, and SIGSEGG.
Further, on the basis of the above device embodiment, the exception information acquiring device of the software system further includes:
the file creating module is used for acquiring a created file path and creating a standard input file and a standard output file under the created file path;
and the redirection module is used for redirecting the standard input of the gdb function according to the standard input file and redirecting the standard output of the gdb function according to the standard output file.
Further, on the basis of the above device embodiment, the exception information acquiring device of the software system further includes:
and registering a gdb function of the software system, and replacing the default abnormal post-processing function of the software system with the gdb function.
Further, on the basis of the above device embodiment, the debug information and the symbol table information are carried by the software system when the source code is compiled.
The abnormal information acquiring apparatus of the software system according to this embodiment may be used to execute the above method embodiments, and the principle and the technical effect are similar, which are not described herein again.
Referring to fig. 3, the electronic device includes: a processor (processor)301, a memory (memory)302, and a bus 303;
wherein the content of the first and second substances,
the processor 301 and the memory 302 complete communication with each other through the bus 303;
the processor 301 is configured to call program instructions in the memory 302 to perform the methods provided by the above-described method embodiments.
The present embodiments disclose a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the methods provided by the above-described method embodiments.
The present embodiments provide a non-transitory computer-readable storage medium storing computer instructions that cause the computer to perform the methods provided by the method embodiments described above.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
It should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (14)

1. An abnormal information acquisition method for a software system is characterized by comprising the following steps:
if an abnormal signal preset in a software system is received, acquiring an abnormal thread in an abnormal process corresponding to the abnormal signal through a gdb function of a debugging tool;
and acquiring the abnormal information of the abnormal thread according to the gdb instruction, and storing the abnormal information into a state log.
2. The method for acquiring exception information of a software system according to claim 1, further comprising:
and extracting the abnormal information from the state log, and positioning the abnormal position of the function according to the abnormal information.
3. The abnormality information acquisition method of a software system according to claim 1, characterized in that the abnormality information includes at least one of: exception thread stack information, exception thread local variable information and exception thread register information;
the anomaly signal includes at least one of: SIGHUP, SIGILL, SIGTRAP, SIGABRT, and SIGSEGG.
4. The method for acquiring exception information of a software system according to any one of claims 1 to 3, wherein before the step of acquiring, by using a gdb function of a debugging tool, the exception thread in the exception process corresponding to the exception signal if the preset exception signal in the software system is received, the method further includes:
acquiring a created file path, and creating a standard input file and a standard output file under the created file path;
and redirecting the standard input of the gdb function according to the standard input file, and redirecting the standard output of the gdb function according to the standard output file.
5. The method for acquiring exception information of a software system according to any one of claims 1 to 3, wherein before the step of acquiring, by using a gdb function of a debugging tool, the exception thread in the exception process corresponding to the exception signal if the preset exception signal in the software system is received, the method further includes:
and registering a gdb function of the software system, and replacing the default abnormal post-processing function of the software system with the gdb function.
6. The method for acquiring the exception information of the software system according to any one of claims 1 to 3, wherein the debug information and the symbol table information are carried by the software system when the source code is compiled.
7. An abnormality information acquisition apparatus for a software system, comprising:
the abnormal thread acquisition module is used for acquiring an abnormal thread in an abnormal process corresponding to an abnormal signal through a gdb function of a debugging tool if the abnormal signal preset in the software system is received;
and the abnormal information acquisition module is used for acquiring the abnormal information of the abnormal thread according to the gdb instruction and storing the abnormal information into a state log.
8. The abnormality information acquisition apparatus for a software system according to claim 7, characterized by further comprising:
and the abnormal position positioning module is used for extracting the abnormal information from the state log and positioning the abnormal position of the function according to the abnormal information.
9. The abnormality information acquisition apparatus of a software system according to claim 7, characterized in that the abnormality information includes at least one of: exception thread stack information, exception thread local variable information and exception thread register information;
the anomaly signal includes at least one of: SIGHUP, SIGILL, SIGTRAP, SIGABRT, and SIGSEGG.
10. The apparatus for acquiring anomaly information of a software system according to any one of claims 7 to 9, further comprising:
the file creating module is used for acquiring a created file path and creating a standard input file and a standard output file under the created file path;
and the redirection module is used for redirecting the standard input of the gdb function according to the standard input file and redirecting the standard output of the gdb function according to the standard output file.
11. The apparatus for acquiring anomaly information of a software system according to any one of claims 7 to 9, further comprising:
and registering a gdb function of the software system, and replacing the default abnormal post-processing function of the software system with the gdb function.
12. The apparatus for acquiring exception information of a software system according to any one of claims 7 to 9, wherein the software system carries debug information and symbol table information when compiling the source code.
13. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method for acquiring exception information of a software system according to any one of claims 1 to 6 when executing the program.
14. A non-transitory computer-readable storage medium on which a computer program is stored, the computer program being executed by a processor to implement the abnormality information acquisition method of the software system according to any one of claims 1 to 6.
CN201911275572.XA 2019-12-12 2019-12-12 Abnormal information acquisition method and device of software system, electronic equipment and medium Active CN112965892B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911275572.XA CN112965892B (en) 2019-12-12 2019-12-12 Abnormal information acquisition method and device of software system, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911275572.XA CN112965892B (en) 2019-12-12 2019-12-12 Abnormal information acquisition method and device of software system, electronic equipment and medium

Publications (2)

Publication Number Publication Date
CN112965892A true CN112965892A (en) 2021-06-15
CN112965892B CN112965892B (en) 2024-06-21

Family

ID=76271014

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911275572.XA Active CN112965892B (en) 2019-12-12 2019-12-12 Abnormal information acquisition method and device of software system, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN112965892B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101211309A (en) * 2006-12-29 2008-07-02 中兴通讯股份有限公司 Embedded system progress abnormal tracking position-finding method
CN103973519A (en) * 2014-05-27 2014-08-06 天津七一二通信广播有限公司 Simulation testing system of switching center based on PC (Personal Computer) platform
CN104050080A (en) * 2014-06-09 2014-09-17 汉柏科技有限公司 Method and system for debugging linux kernel in user mode
CN104268055A (en) * 2014-09-01 2015-01-07 腾讯科技(深圳)有限公司 Program exception monitoring method and device
CN105956474A (en) * 2016-05-17 2016-09-21 武汉虹旭信息技术有限责任公司 Abnormal behavior detection system of Android platform software
CN106598871A (en) * 2016-12-29 2017-04-26 山东鲁能智能技术有限公司 Automatic analysis method and system for collapse file under Linux
CN108319555A (en) * 2018-03-17 2018-07-24 成都大学 A kind of real-time adjustment method based on embedded real time system
CN109614290A (en) * 2018-12-10 2019-04-12 苏州思必驰信息科技有限公司 Process exception information recording method and system in container
CN109669866A (en) * 2018-12-10 2019-04-23 北京航空航天大学 A kind of acquisition methods of software run time fault propagation path
CN109947636A (en) * 2017-12-20 2019-06-28 浙江宇视科技有限公司 Abnormal thread localization method and device
CN110134385A (en) * 2019-05-17 2019-08-16 中国农业银行股份有限公司 Record the method and C language general journal frame of C language function call chain

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101211309A (en) * 2006-12-29 2008-07-02 中兴通讯股份有限公司 Embedded system progress abnormal tracking position-finding method
CN103973519A (en) * 2014-05-27 2014-08-06 天津七一二通信广播有限公司 Simulation testing system of switching center based on PC (Personal Computer) platform
CN104050080A (en) * 2014-06-09 2014-09-17 汉柏科技有限公司 Method and system for debugging linux kernel in user mode
CN104268055A (en) * 2014-09-01 2015-01-07 腾讯科技(深圳)有限公司 Program exception monitoring method and device
CN105956474A (en) * 2016-05-17 2016-09-21 武汉虹旭信息技术有限责任公司 Abnormal behavior detection system of Android platform software
CN106598871A (en) * 2016-12-29 2017-04-26 山东鲁能智能技术有限公司 Automatic analysis method and system for collapse file under Linux
CN109947636A (en) * 2017-12-20 2019-06-28 浙江宇视科技有限公司 Abnormal thread localization method and device
CN108319555A (en) * 2018-03-17 2018-07-24 成都大学 A kind of real-time adjustment method based on embedded real time system
CN109614290A (en) * 2018-12-10 2019-04-12 苏州思必驰信息科技有限公司 Process exception information recording method and system in container
CN109669866A (en) * 2018-12-10 2019-04-23 北京航空航天大学 A kind of acquisition methods of software run time fault propagation path
CN110134385A (en) * 2019-05-17 2019-08-16 中国农业银行股份有限公司 Record the method and C language general journal frame of C language function call chain

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
广告与算法: "c++ gdb调试大全", Retrieved from the Internet <URL:https://blog.csdn.net/bigheadyushan/article/details/77828949> *
胡伟彬: "基于GDB的无线传感网络调试器的设计与实现", 中国优秀硕士学位论文全文数据库信息科技辑 *
马庆胜等: "红帽Linux上的故障定位技术", 硅谷, 31 October 2011 (2011-10-31) *
龚伟: "基于gdb的嵌入式系统调试器的设计与实现", 中国优秀博硕士学位论文全文数据库(硕士)信息科技辑 *

Also Published As

Publication number Publication date
CN112965892B (en) 2024-06-21

Similar Documents

Publication Publication Date Title
CN108614770B (en) Automatic test assertion method, device, storage medium and equipment
US9256517B1 (en) Display of aggregated stack traces in a source code viewer
US9280445B2 (en) Logging code generation and distribution
CN111144839B (en) Project construction method, continuous integration system and terminal equipment
CN105512015B (en) A kind of Android intended application collapse statistical method and device
CN108280027A (en) A kind of concurrently debugging rendering intent and device of script
CN106649114B (en) The method and apparatus that application crash is positioned
CN115454869A (en) Interface automation test method, device, equipment and storage medium
CN112115055A (en) Multi-machine automatic testing method and device and computer equipment
KR20180129623A (en) Apparatus for statically analyzing assembly code including assoxiated multi files
CN109388568B (en) Code testing method and device
CN113568825B (en) Program flow debugging method, device, equipment and storage medium
CN110580220A (en) method for measuring execution time of code segment and terminal equipment
CN111026638A (en) Webpage automatic testing method and device, electronic equipment and storage medium
CN113946803A (en) Method and device for automatic bypass by having anti-debugging mechanism for target program
CN112965892B (en) Abnormal information acquisition method and device of software system, electronic equipment and medium
CN109857642B (en) Blocking type debugging method and debugging tool for UI automation script
CN111243580B (en) Voice control method, device and computer readable storage medium
CN111381995A (en) Method and device for restoring user operation and computer
US9710360B2 (en) Optimizing error parsing in an integrated development environment
CN116155934A (en) Method, device, electronic equipment and storage medium for intelligent contract call account book
CN113127874A (en) Method and device for processing intranet sensitive information
CN111291091A (en) Data processing method and device and data processing system
CN112100077B (en) Transaction testing method and device
CN113268230B (en) Feedback information generation method and device, terminal and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant