CN110727566B - Method, device, medium and electronic equipment for acquiring process crash information - Google Patents

Method, device, medium and electronic equipment for acquiring process crash information Download PDF

Info

Publication number
CN110727566B
CN110727566B CN201910838285.9A CN201910838285A CN110727566B CN 110727566 B CN110727566 B CN 110727566B CN 201910838285 A CN201910838285 A CN 201910838285A CN 110727566 B CN110727566 B CN 110727566B
Authority
CN
China
Prior art keywords
information
instruction
crash
memory
acquiring
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.)
Active
Application number
CN201910838285.9A
Other languages
Chinese (zh)
Other versions
CN110727566A (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.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology 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 Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN201910838285.9A priority Critical patent/CN110727566B/en
Publication of CN110727566A publication Critical patent/CN110727566A/en
Application granted granted Critical
Publication of CN110727566B publication Critical patent/CN110727566B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3466Performance evaluation by tracing or monitoring
    • G06F11/3476Data logging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3065Monitoring arrangements determined by the means or processing involved in reporting the monitored data
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The disclosure provides a method, a device, a medium and electronic equipment for acquiring process crash information. The method comprises the following steps: acquiring first process parameter information sent by a first process after breakdown; generating a first process injection instruction based on the first process parameter information; and acquiring the crash information of the first process according to the first process injection instruction. According to the method and the device, the first process is subjected to instruction injection through the dump process, the crash information is obtained, and the front and back information of the process operation when the first process crashes can be obtained from the crash information, so that the crash problem can be conveniently located. The crash reasons of the first process collapse can be obtained by comprehensively analyzing the crash information of the first process. The method solves the problem that the process crash cannot be analyzed because of no core dump mechanism, and further solves the problem of system crash.

Description

Method, device, medium and electronic equipment for acquiring process crash information
Technical Field
The disclosure relates to the field of system debugging, in particular to a method, a device, a medium and electronic equipment for acquiring process crash information.
Background
The system crash is a symptom reflected by the incapability of normal operation, frequent halt and the like of a computer caused by the system operation problem, the software design problem or the malicious invasion of viruses.
The core dump (CoreDump) is a mechanism for coping with system crash in the Linux system, and is that when the operating system receives some signals to terminate the running process, the content of the address space of the process and other information about the state of the process are written into a disk file. The disk file and the GDB debugging tool in the Linux system can be utilized to comprehensively analyze the crashing process, so that the problem of system crash can be solved.
However, there is no core dump mechanism and similar debugging tools for android systems, so there is no effective means to analyze the system crash problem.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
The disclosure aims to provide a method, a device, a medium and an electronic device for acquiring process crash information, which can solve at least one technical problem mentioned above. The specific scheme is as follows:
according to a specific embodiment of the present disclosure, in a first aspect, the present disclosure provides a method for obtaining process crash information, including:
acquiring first process parameter information sent by a first process after breakdown;
generating a first process injection instruction based on the first process parameter information;
and acquiring the crash information of the first process according to the first process injection instruction.
According to a second aspect of the specific embodiment of the present disclosure, the present disclosure provides an apparatus for obtaining process crash information, including:
the crash parameter obtaining unit is used for obtaining first process parameter information sent by a first process after crash;
the injection instruction generating unit is used for generating a first process injection instruction based on the first process parameter information;
and the crash information acquisition unit is used for acquiring the crash information of the first process according to the first process injection instruction.
According to a third aspect of the disclosure, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method of obtaining process crash information as claimed in any of the first aspects.
According to a fourth aspect of the present disclosure, there is provided an electronic device comprising: one or more processors; storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement a method of obtaining process crash information as claimed in any of the first aspects.
Compared with the prior art, the scheme of the embodiment of the disclosure has at least the following beneficial effects:
the disclosure provides a method, a device, a medium and electronic equipment for acquiring process crash information. The method comprises the following steps: acquiring first process parameter information sent by a first process after breakdown; generating a first process injection instruction based on the first process parameter information; and acquiring the crash information of the first process according to the first process injection instruction. According to the method and the device, the first process is subjected to instruction injection through the dump process, the crash information is obtained, and the front and back information of the process operation when the first process crashes can be obtained from the crash information, so that the crash problem can be conveniently located. The crash reasons of the first process collapse can be obtained by comprehensively analyzing the crash information of the first process. The method solves the problem that the process crash cannot be analyzed because of no core dump mechanism, and further solves the problem of system crash.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale. In the drawings:
FIG. 1 illustrates a flow chart of a method of obtaining process crash information in accordance with an embodiment of the disclosure;
FIG. 2 illustrates a call graph with a first process according to an embodiment of the present disclosure;
FIG. 3 illustrates a block diagram of an ELF format file according to an embodiment of the present disclosure;
FIG. 4 illustrates a block diagram of a unit of an apparatus for obtaining process crash information in accordance with an embodiment of the disclosure;
fig. 5 shows a schematic diagram of an electronic device connection structure according to an embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure have been shown in the accompanying drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below.
It should be noted that the terms "first," "second," and the like in this disclosure are merely used to distinguish between different devices, modules, or units and are not used to define an order or interdependence of functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
Alternative embodiments of the present disclosure are described in detail below with reference to the drawings.
The first embodiment provided by the present disclosure is an embodiment of a method for obtaining process crash information.
Embodiments of the present disclosure are described in detail below with reference to fig. 1, 2, and 3, where fig. 1 illustrates a flowchart of a method for obtaining process crash information according to an embodiment of the present disclosure; FIG. 2 illustrates a call graph with a first process according to an embodiment of the present disclosure; FIG. 3 illustrates a block diagram of an ELF format file according to an embodiment of the present disclosure.
Referring to fig. 1, in step S101, first process parameter information sent by a first process after a crash is obtained.
The crash refers to a process Cheng Bengkui, and because of design errors of the program of the process, the errors are accumulated to a certain extent when the process runs, so that the process cannot continue to run normally, and the problem of process crash occurs. For example, the process has a problem of memory leakage, and when the leaked memory cannot be released all the time, the memory is finally occupied, and then the process is crashed, even the system is crashed.
Referring to fig. 2, the embodiment of the disclosure is applied to a dump process, where the dump process is used to obtain crash information of a first process. An exception handling function is arranged in a program of the first process, and the exception handling function is registered in an initialization stage of the first process. And when the first process crashes, the exception handling function is called back, and the exception handling function sends first process parameter information to the dump process. And the first process exits after the dump completion information sent by the dump process is obtained.
The dump process may be initiated by the first process during an initialization phase of the initiation, or by the first process calling back the exception handling function. The embodiments of the present disclosure are not limited.
Optionally, the obtaining the first process parameter information sent by the first process after the crash includes:
step S101-1, obtaining first process parameter information sent by a first process after breakdown through a shared memory with the first process.
In the embodiment of the disclosure, the first process and the dump process communicate with each other in a manner of sharing the memory.
The first process parameter information includes: the first process identification information, the first process memory address information and the first process memory size information.
The first process identification information is unique information representing the first process. For example, a first process ID.
Step S102, generating a first process injection instruction based on the first process parameter information.
The first process injection instruction is an instruction for the dump process to acquire the first process crash information.
Optionally, the first process injects instructions, including: the method comprises the steps of a first process additional instruction, a first process register instruction reading, a first process memory instruction reading and a first process separation instruction reading.
For example, in an operating system of the mobile phone, a Ptrace instruction may be used to generate a first process injection instruction, where parameters include: behavior parameters, injected process ID, address parameters, and data size parameters; the Ptrace instruction can directly and remotely call functions such as dlopen\dlsym and the like to load into the first process and execute first process injection instructions with different parameters.
The generating a first process injection instruction based on the first process parameter information includes the following steps:
step S102-1, acquiring the first process additional instruction based on the first process identification information.
For example, continuing with the above example, when the behavior parameter is PTRACE_ATTACH and the injected process ID is the first process ID, then a first process add-on instruction is generated.
Step S102-2, acquiring the instruction for reading the first process register based on the first process identification information.
For example, continuing with the above example, when the behavior parameter is PTRACE_SETREGS and the injected process ID is the first process ID, then a first process register instruction is generated.
Step S102-3, acquiring the first process memory reading instruction based on the first process identification information, the first process memory address information and the first process memory size information.
For example, continuing with the above example, when the behavior parameter is PTRACE_PEEKTEXT, the injected process ID is the first process ID, the address parameter is the first process memory address information, and the data size parameter is the first process memory size information, then a first process memory instruction is generated.
Step S102-4, acquiring the first process separation instruction based on the first process identification information.
For example, continuing with the above example, when the behavior parameter is PTRACE_DETACH and the injected process ID is the first process ID, then a first process DETACH instruction is generated.
Step S103, obtaining the crash information of the first process according to the first process injection instruction.
The crash information includes: the first register information and the first memory information which are stored when the first process crashes.
The step of acquiring the crash information of the first process according to the first process injection instruction specifically comprises the following steps:
step S103-1, establishing connection with the first process according to the first process additional instruction.
Step S103-2, obtaining the first register information according to the instruction of the instruction for reading the first process register.
Step S103-3, the first process memory instruction is read according to the reading, and the first memory information is obtained.
And step S103-4, disconnecting the first process according to the first process separation instruction.
At this time, the dump completion information is information of disconnection of the dump process, and when the information of disconnection of the dump process is acquired, the first process exits.
After the crash information of the first process is obtained according to the remote injection instruction, the method further comprises the following steps:
step S104, a first file in a preset package format is generated based on the first process parameter information and the collapse information.
The preset package format includes an ELF format.
In computer science, an ELF format file is a file used for binary files, executable files, object code, shared libraries, and core dump (CoreDump) formats.
Referring to fig. 3, the ELF format includes: ELF header information, program header, first process identification information, first register information, and first memory information.
For example, the first file is a CoreDump format file.
The CoreDump format file in combination with the operating system's GDB debug tool can view the call stack, register state, memory values, view code, acquire thread state and switch other threads and view the call stack when the first process crashes. The front and back information of the process operation when the first process crashes can be obtained from the crash information, so that the crash problem can be conveniently positioned. The crash reasons of the first process collapse can be obtained by comprehensively analyzing the crash information of the first process.
Step S105, writing the first file into a disk.
Step S106, the dump process exits.
According to the embodiment of the disclosure, the first process is subjected to instruction injection through the dump process, the crash information is obtained, and the front and back information of the process operation when the first process crashes can be obtained from the crash information, so that the crash problem can be conveniently located. The crash reasons of the first process collapse can be obtained by comprehensively analyzing the crash information of the first process. The method solves the problem that the process crash cannot be analyzed because of no core dump mechanism, and further solves the problem of system crash.
Corresponding to the first embodiment provided by the present disclosure, the present disclosure also provides a second embodiment, i.e., an apparatus for obtaining process crash information. Since the second embodiment is substantially similar to the first embodiment, the description is relatively simple, and the relevant portions will be referred to the corresponding descriptions of the first embodiment. The device embodiments described below are merely illustrative.
Fig. 4 illustrates an embodiment of an apparatus for obtaining process crash information provided by the present disclosure. Fig. 4 is a block diagram of an apparatus for acquiring process crash information according to an embodiment of the present disclosure.
Referring to fig. 4, the disclosure provides an apparatus for obtaining process crash information, including: the crash parameter unit 401 is acquired, the injection instruction unit 402 is generated, and the crash information unit 403 is acquired.
The crash parameter obtaining unit 401 is configured to obtain first process parameter information sent by a first process after a crash;
a generating injection instruction unit 402, configured to generate a first process injection instruction based on the first process parameter information;
and the crash information obtaining unit 403 is configured to obtain crash information of the first process according to the first process injection instruction.
Optionally, the acquiring crash parameter unit 401 includes:
and the crash parameter acquisition subunit is used for acquiring the first process parameter information sent by the first process after the crash through the shared memory with the first process.
Optionally, the first process parameter information includes: the first process identification information, the first process memory address information and the first process memory size information;
the first process injects instructions comprising: the method comprises the steps of a first process additional instruction, a first process register instruction reading, a first process memory instruction reading and a first process separation instruction reading;
in the generate inject instruction unit 402, it includes:
an acquisition additional instruction subunit, configured to acquire the first process additional instruction based on the first process identification information;
an acquire register instruction subunit, configured to acquire the read first process register instruction based on the first process identification information;
the memory instruction obtaining subunit is used for obtaining the first process memory instruction based on the first process identification information, the first process memory address information and the first process memory size information;
and the acquisition and separation instruction subunit is used for acquiring the first process separation instruction based on the first process identification information.
Optionally, the crash information includes: the method comprises the steps of storing first register information and first memory information when a first process crashes;
in the get crash information unit 403, it includes:
a connection establishment subunit, configured to establish connection with the first process according to the first process additional instruction;
an acquire register information subunit, configured to acquire the first register information according to the instruction for reading the first process register instruction;
the memory information acquisition subunit is used for acquiring the first memory information according to the read first process memory instruction;
and the disconnection subunit is used for disconnecting the connection with the first process according to the first process separation instruction.
Optionally, in the apparatus, further includes:
and the packaging unit is used for generating a first file in a preset packaging format based on the first process parameter information and the collapse information.
Optionally, the preset package format includes an ELF format.
Optionally, the ELF format includes: ELF header information, program header, first process identification information, first register information, and first memory information.
According to the embodiment of the disclosure, the first process is subjected to instruction injection through the dump process, the crash information is obtained, and the front and back information of the process operation when the first process crashes can be obtained from the crash information, so that the crash problem can be conveniently located. The crash reasons of the first process collapse can be obtained by comprehensively analyzing the crash information of the first process. The method solves the problem that the process crash cannot be analyzed because of no core dump mechanism, and further solves the problem of system crash.
The embodiment of the disclosure provides a third embodiment, namely an electronic device, which is used for obtaining the process crash information, and the electronic device comprises: at least one processor; and a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory stores instructions executable by the one processor to enable the at least one processor to perform the method of obtaining process crash information as described in the first embodiment.
The fourth embodiment is a computer storage medium storing computer executable instructions for performing the method for acquiring process crash information according to the first embodiment.
Referring now to fig. 5, a schematic diagram of an electronic device suitable for use in implementing embodiments of the present disclosure is shown. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 5 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 5, the electronic device may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 501, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 502 or a program loaded from a storage means 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
In general, the following devices may be connected to the I/O interface 505: input devices 506 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 507 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 508 including, for example, magnetic tape, hard disk, etc.; and communication means 509. The communication means 509 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. While fig. 5 shows an electronic device having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a non-transitory computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 509, or from the storage means 508, or from the ROM 502. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing device 501.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some implementations, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol ), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including, but not limited to, an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. Wherein the names of the units do not constitute a limitation of the units themselves in some cases.
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
Moreover, although operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are example forms of implementing the claims.

Claims (8)

1. A method for obtaining process crash information, applied to a dump process, comprising:
when the first process crashes, the exception handling function is called back, and the exception handling function sends first process parameter information to the dump process; the first process parameter information includes: the first process identification information, the first process memory address information and the first process memory size information;
generating a first process injection instruction based on the first process parameter information; the first process injects instructions comprising: the method comprises the steps of a first process additional instruction, a first process register instruction reading, a first process memory instruction reading and a first process separation instruction reading;
the generating a first process injection instruction based on the first process parameter information includes:
acquiring the first process additional instruction based on the first process identification information;
acquiring the instruction for reading the first process register based on the first process identification information;
acquiring the first process memory reading instruction based on the first process identification information, the first process memory address information and the first process memory size information;
acquiring the first process separation instruction based on the first process identification information;
acquiring crash information of the first process according to the first process injection instruction; the crash information includes: the method comprises the steps of storing first register information and first memory information when a first process crashes;
the obtaining the crash information of the first process according to the first process injection instruction includes:
establishing connection with the first process according to the first process additional instruction;
acquiring the first register information according to the instruction for reading the first process register;
acquiring the first memory information according to the first process memory reading instruction;
disconnecting from the first process according to the first process separation instruction.
2. The method of claim 1, wherein the sending, by the exception handling function, the first process parameter information to the dump process comprises:
and acquiring first process parameter information sent by the first process after the crash through the shared memory of the first process.
3. The method of claim 1, further comprising, after the acquiring crash information of the first process according to the first process injection instruction:
and generating a first file in a preset package format based on the first process parameter information and the collapse information.
4. The method of claim 3, wherein the predetermined encapsulation format comprises an ELF format.
5. The method of claim 4, wherein the ELF format comprises: ELF header information, program header, first process identification information, first register information, and first memory information.
6. An apparatus for obtaining process crash information, applied to a dump process, comprising:
the crash parameter obtaining unit is used for calling back an exception handling function when the first process crashes and sending first process parameter information to the dump process by the exception handling function; the first process parameter information includes: the first process identification information, the first process memory address information and the first process memory size information;
the injection instruction generating unit is used for generating a first process injection instruction based on the first process parameter information; the first process injects instructions comprising: the method comprises the steps of a first process additional instruction, a first process register instruction reading, a first process memory instruction reading and a first process separation instruction reading;
the crash information acquisition unit is used for acquiring the crash information of the first process according to the first process injection instruction; the crash information includes: the method comprises the steps of storing first register information and first memory information when a first process crashes;
in the generating injection instruction unit, it includes:
an acquisition additional instruction subunit, configured to acquire the first process additional instruction based on the first process identification information;
an acquire register instruction subunit, configured to acquire the read first process register instruction based on the first process identification information;
the memory instruction obtaining subunit is used for obtaining the first process memory instruction based on the first process identification information, the first process memory address information and the first process memory size information;
an acquisition separation instruction subunit, configured to acquire the first process separation instruction based on the first process identification information;
the acquiring crash information unit includes:
a connection establishment subunit, configured to establish connection with the first process according to the first process additional instruction;
an acquire register information subunit, configured to acquire the first register information according to the read first process register instruction;
the memory information acquisition subunit is used for acquiring the first memory information according to the first process memory reading instruction;
and the disconnection subunit is used for disconnecting the connection with the first process according to the first process separation instruction.
7. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any one of claims 1 to 5.
8. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs which when executed by the one or more processors cause the one or more processors to implement the method of any of claims 1 to 5.
CN201910838285.9A 2019-09-05 2019-09-05 Method, device, medium and electronic equipment for acquiring process crash information Active CN110727566B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910838285.9A CN110727566B (en) 2019-09-05 2019-09-05 Method, device, medium and electronic equipment for acquiring process crash information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910838285.9A CN110727566B (en) 2019-09-05 2019-09-05 Method, device, medium and electronic equipment for acquiring process crash information

Publications (2)

Publication Number Publication Date
CN110727566A CN110727566A (en) 2020-01-24
CN110727566B true CN110727566B (en) 2023-08-11

Family

ID=69217790

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910838285.9A Active CN110727566B (en) 2019-09-05 2019-09-05 Method, device, medium and electronic equipment for acquiring process crash information

Country Status (1)

Country Link
CN (1) CN110727566B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113407368B (en) * 2020-03-16 2023-03-21 广东龙芯中科电子科技有限公司 Process management method and device and electronic equipment
CN111563000B (en) * 2020-04-28 2023-08-18 深圳市震有软件科技有限公司 File generation method, intelligent terminal and storage medium
CN112084086B (en) * 2020-08-14 2024-03-22 北京字节跳动网络技术有限公司 Information collection method, device, medium and electronic equipment
CN114138531A (en) * 2021-09-23 2022-03-04 统信软件技术有限公司 Core dump file generation method, computing device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1215578A2 (en) * 2000-12-15 2002-06-19 Microsoft Corporation Creation of mini dump files from full dump files
CN108170552A (en) * 2018-01-05 2018-06-15 武汉斗鱼网络科技有限公司 A kind of method, apparatus and equipment for capturing Dump files
CN108763060A (en) * 2018-04-27 2018-11-06 广州华多网络科技有限公司 Native layers of collapse source tracing method, device, storage medium and terminal in android system
CN109032909A (en) * 2018-07-18 2018-12-18 携程旅游信息技术(上海)有限公司 Processing method, system, equipment and the storage medium of application crash log
CN109614290A (en) * 2018-12-10 2019-04-12 苏州思必驰信息科技有限公司 Process exception information recording method and system in container

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6769077B2 (en) * 2000-12-20 2004-07-27 Microsoft Corporation System and method for remotely creating a physical memory snapshot over a serial bus
US8607098B2 (en) * 2011-05-26 2013-12-10 International Business Machines Corporation Generating appropriately sized core files used in diagnosing application crashes
US9275229B2 (en) * 2012-03-15 2016-03-01 Mandiant, Llc System to bypass a compromised mass storage device driver stack and method thereof
US9026860B2 (en) * 2012-07-31 2015-05-05 International Business Machines Corpoation Securing crash dump files
US10268563B2 (en) * 2016-06-23 2019-04-23 Vmware, Inc. Monitoring of an automated end-to-end crash analysis system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1215578A2 (en) * 2000-12-15 2002-06-19 Microsoft Corporation Creation of mini dump files from full dump files
CN108170552A (en) * 2018-01-05 2018-06-15 武汉斗鱼网络科技有限公司 A kind of method, apparatus and equipment for capturing Dump files
CN108763060A (en) * 2018-04-27 2018-11-06 广州华多网络科技有限公司 Native layers of collapse source tracing method, device, storage medium and terminal in android system
CN109032909A (en) * 2018-07-18 2018-12-18 携程旅游信息技术(上海)有限公司 Processing method, system, equipment and the storage medium of application crash log
CN109614290A (en) * 2018-12-10 2019-04-12 苏州思必驰信息科技有限公司 Process exception information recording method and system in container

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
X86体系中保护模式下的内存访问机制;湛辉来, 曾一;重庆大学学报(自然科学版)(第06期);全文 *

Also Published As

Publication number Publication date
CN110727566A (en) 2020-01-24

Similar Documents

Publication Publication Date Title
CN110727566B (en) Method, device, medium and electronic equipment for acquiring process crash information
CN110865898B (en) Method, device, medium and equipment for converging crash call stack
CN111611145B (en) Breakdown information collection method and device, storage medium and electronic equipment
CN113835992B (en) Memory leakage processing method and device, electronic equipment and computer storage medium
CN111459822B (en) Method, device, equipment and readable medium for extracting system component data
CN111625422B (en) Thread monitoring method, thread monitoring device, electronic equipment and computer readable storage medium
CN111309304B (en) Method, device, medium and electronic equipment for generating IDL file
CN111274503B (en) Data processing method, device, electronic equipment and computer readable medium
CN112099982A (en) Collapse information positioning method, device, medium and electronic equipment
CN112363885B (en) Method, device, electronic equipment and computer readable medium for detecting application abnormality
CN110764995B (en) Method, device, medium and electronic equipment for detecting file access abnormality
CN111240801A (en) Method, device, medium and electronic equipment for generating heap memory snapshot file
CN111984496B (en) Method, device, medium and electronic equipment for monitoring stack memory leakage
CN111309323B (en) Parameter initialization method and device and electronic equipment
CN112084086B (en) Information collection method, device, medium and electronic equipment
CN111538717B (en) Data processing method, device, electronic equipment and computer readable medium
CN111258582B (en) Window rendering method and device, computer equipment and storage medium
CN111382381B (en) User data sharing method and device, mobile terminal and storage medium
CN111310175A (en) iOS application safety monitoring and protecting method and device based on plug-in
CN111782410B (en) Lock jam monitoring method and device, electronic equipment and computer readable medium
CN111258852B (en) Abnormal data monitoring method, device, electronic equipment and storage medium
CN111626787B (en) Resource issuing method, device, medium and equipment
CN111694679B (en) Message processing method and device and electronic equipment
CN110489341B (en) Test method and device, storage medium and electronic equipment
CN111367555B (en) Assertion method, assertion device, electronic equipment and computer readable 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
GR01 Patent grant