CN112286773A - Method, device, medium and electronic equipment for collecting crash information - Google Patents

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

Info

Publication number
CN112286773A
CN112286773A CN202011118632.XA CN202011118632A CN112286773A CN 112286773 A CN112286773 A CN 112286773A CN 202011118632 A CN202011118632 A CN 202011118632A CN 112286773 A CN112286773 A CN 112286773A
Authority
CN
China
Prior art keywords
crash
crash information
information
sub
target file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011118632.XA
Other languages
Chinese (zh)
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 CN202011118632.XA priority Critical patent/CN112286773A/en
Publication of CN112286773A publication Critical patent/CN112286773A/en
Pending legal-status Critical Current

Links

Images

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/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
    • 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

Abstract

The disclosure provides a method, a device, a medium and an electronic device for collecting crash information. According to the method, a first process generates a derived sub-process after the first process crashes, the first process collects and stores crash information, and the derived sub-process reports a crash file generated by the first process. The time difference between the generation of the crash file and the reporting of the crash file is reduced, and the reporting timeliness is ensured. The crash file is reported by the derived sub-process of the first process, so that other crash processes are prevented from covering the crash file, and the integrity of the crash information is ensured.

Description

Method, device, medium and electronic equipment for collecting crash information
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method, an apparatus, a medium, and an electronic device for collecting crash information.
Background
After the android application crashes, because the running environment of the application is unstable, many crash collection programs collect and store crash information, and report the previously collected crash information to the server in a stable environment after the application is started next time.
The disadvantage is that the crash reporting is delayed and the developer cannot receive the crash information in a timely manner. And because of the crash reporting delay, the server is easy to miss the delayed crash information when counting the crash time distribution, thereby generating the statistical deviation. In addition, if the crash of the application occurs in the starting stage and the last crash information is not reported yet, the crash information of the starting crash covers the last crash information, so that the last crash information can never be reported again.
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.
An object of the present disclosure is to provide a method, an apparatus, a medium, and an electronic device for collecting crash information, which can solve at least one of the above-mentioned technical problems. 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 collecting crash information, including:
when monitoring that the application crashes through a first process, copying and generating a derived sub-process aiming at the first process, wherein the first process is used as a parent process of the derived sub-process;
collecting crash information generated when the application crashes through the first process, and storing the crash information in a target file shared with the derivative sub-process;
periodically determining whether the first process finishes the collection and storage of crash information through the derived sub-process;
and when the first process finishes the collection and storage of the crash information through the derivation sub-process, acquiring the crash information from the target file through the derivation sub-process and reporting the crash information.
According to a second aspect, the present disclosure provides a crash information collecting apparatus, including:
generating a derived sub-process unit, configured to copy and generate a derived sub-process for a first process when it is monitored that an application crashes through the first process, where the first process is used as a parent process of the derived sub-process;
the storage crash information unit is used for collecting crash information generated when the application crashes through the first process and storing the crash information in a target file shared by the derived sub-process;
determining a first process unit, configured to periodically determine, by the spawning sub-process, whether the first process completes collection and storage of crash information;
and the crash information reporting unit is used for acquiring the crash information from the target file through the derived sub-process and reporting the crash information when the first process is determined to complete the collection and storage of the crash information through the derived sub-process.
According to a third aspect, the present disclosure provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method for collecting crash information according to any one of the first aspect.
According to a fourth aspect thereof, the present disclosure provides 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 collecting crash information according to any one of the first aspect.
Compared with the prior art, the scheme of the embodiment of the disclosure at least has the following beneficial effects:
the disclosure provides a method, a device, a medium and an electronic device for collecting crash information. According to the method, a first process generates a derived sub-process after the first process crashes, the first process collects and stores crash information, and the derived sub-process reports a crash file generated by the first process. The time difference between the generation of the crash file and the reporting of the crash file is reduced, and the reporting timeliness is ensured. The crash file is reported by the derived sub-process of the first process, so that other crash processes are prevented from covering the crash file, and the integrity of the crash information is ensured.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale. In the drawings:
FIG. 1 illustrates a flow diagram of a method of collecting crash information in accordance with an embodiment of the disclosure;
FIG. 2 illustrates a block diagram of elements of a crash information collection apparatus, in accordance with an embodiment of the present disclosure;
fig. 3 shows an electronic device connection structure schematic 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 are shown in the 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 rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the 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. Moreover, 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 "include" and variations thereof as used herein are 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". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
Alternative embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
For the first embodiment provided by the present disclosure, that is, the embodiment of the method for collecting crash information, the embodiment of the present disclosure is applied to a parent process.
The embodiments of the present disclosure are described in detail below with reference to fig. 1.
Step S101, when the first process monitors that the application crashes, a derived sub-process is generated aiming at the first process in a copying mode, and the first process is used as a parent process of the derived sub-process.
Optionally, the first process and the derived sub-process both run in a Java environment.
For example, in a JAVA environment such as a senix system (UNIX system for short) or a renix system (LINUX system for short), a crash handling class is set at the initialization stage; the crash handling class is typically a custom class that can be used to collect crash information; when the JAVA application crashes, the JAVA application automatically jumps to the crash handling class.
A spawn child process is a process that a first process generates by replicating the first process. For example, in a JAVA environment, there is a duplicate function (i.e. fork function), the first process calling the fork function can generate a derived subprocess identical to the first process, and the two processes share the information of the memory area.
Step S102, collecting crash information generated when the application crashes through the first process, and storing the crash information in a target file shared with the derivative sub-process.
The crash information generated when the application crashes includes: the method comprises the following steps of crash call stack information, register information of a crash thread, a memory value of a memory area pointed by a crash thread register, memory occupation information, file handle information and a memory mapping table.
Since the first process and the derivative sub-process share information of the memory region, the target file is also stored in the shared memory region.
Optionally, collecting, by the first process, crash information generated when the application crashes, and storing the crash information in a shared target file, includes the following steps:
and step S102-1, when the first process monitors that the application is crashed, determining the crash time and creating a file by taking the crash time as a file name, wherein the file is used as a target file shared with the derivative sub-process.
In order to avoid the conflict of the target file names and the loss of the target file content, the target file name needs to adopt a unique file name, that is, the file name same as the target file name does not exist in the directory for storing the target file. Because the accuracy of the system time can be as accurate as milliseconds, the embodiment of the present disclosure uses the crash time as the target file name, and can greatly reduce the possibility of duplication of the target file name. Moreover, due to the sequence and the stage of time, the crash file can be conveniently and quickly inquired.
The directory for storing the target file in the JAVA environment can be set through the preset directory specifying function. For example, a preset setenv function is called to set a directory for storing a target file in a JAVA environment, a first parameter of the setenv function is transmitted into a "CLASSPATH" character string, a second parameter is transmitted into a currently applied apk path, and a third parameter is transmitted into a value 1.
Step S102-2, collecting crash information generated when the application crashes through the first process, and storing the crash information in the target file.
Step S103, periodically determining whether the first process finishes the collection and storage of the crash information through the derived sub-process.
For the first process which crashes, the original running environment is changed after the crash. After the crash happens, the first process automatically jumps to the crash processing class, and only can finish the collection and storage work of the memory information.
In order to ensure that the crash information is reported, the embodiment of the present disclosure provides a method for generating a derived sub-process by copying a first process, and the derived sub-process completes the reporting of the crash information.
Thus, the spawn sub-process periodically monitors whether the first process is finished collecting and storing crash information.
Optionally, periodically determining, by the spawn sub-process, whether the first process completes the collection and storage of the crash information, including the following steps:
step S103-1, acquiring the process identity information of the first process through the derivation sub-process.
Process Identity information (PID) is unique identification information of a first Process in the system. The PID is stored in a preset location in memory of the first process. Because the memory information of the first process and the derivation sub-process is shared, the derivation sub-process can read the process identity information of the first process.
And step S103-2, periodically checking whether the process identity information of the first process exists in a system process list through the derived sub-process.
Each time a process is started, a PID is owned in the system and is also registered in the system process list. Until the process ends, the system will not delete the ending PID in the system process list. Thus, periodically viewing the system process list enables one to see if the first process has completed the collection and storage of crash information.
Step S103-3, when the process identity information of the first process does not exist in the system process list, determining that the first process completes the collection and storage of the crash information.
When the PID of the first process does not exist in the system process list, the first process is indicated to finish collecting and storing the crash information.
And step S104, when the first process is determined to finish the collection and storage of the crash information through the derivation sub-process, acquiring the crash information from the target file through the derivation sub-process and reporting the crash information.
Optionally, the method specifically includes the following steps:
and step S104-1, calling a preset function through the derivation subprocess to acquire a storage path of the target file.
For example, in a JAVA environment, the derivative subprocess can obtain the current environment directory, that is, the storage path of the target file, through the getenv function.
And S104-2, positioning the target file according to the storage path and acquiring and reporting the crash information in the target file.
In the embodiment of the present disclosure, the first process generates the derived sub-process after the crash, the first process collects and stores the crash information, and the derived sub-process reports the crash file generated by the first process. The time difference between the generation of the crash file and the reporting of the crash file is reduced, and the reporting timeliness is ensured. The crash file is reported by the derived sub-process of the first process, so that other crash processes are prevented from covering the crash file, and the integrity of the crash information is ensured.
Corresponding to the first embodiment provided by the present disclosure, the present disclosure also provides a second embodiment, that is, a collecting apparatus of crash information. Since the second embodiment is basically similar to the first embodiment, the description is simple, and the relevant portions should be referred to the corresponding description of the first embodiment. The device embodiments described below are merely illustrative.
Fig. 2 shows an embodiment of a crash information collection apparatus provided by the present disclosure.
Referring to fig. 2, the present disclosure provides a crash information collecting apparatus, including:
a generating derived sub-process unit 201, configured to copy and generate a derived sub-process for a first process when it is monitored that an application crashes through the first process, where the first process is a parent process of the derived sub-process;
a store crash information unit 202, configured to collect, by the first process, crash information generated when the application crashes, and store the crash information in a target file shared with the spawn sub-process;
a first process determining unit 203, configured to periodically determine, by the spawning sub-process, whether the first process completes collecting and storing crash information;
a reporting crash information unit 204, configured to, when it is determined that the first process completes the collection and storage of crash information through the derived sub-process, obtain and report crash information from the target file through the derived sub-process.
Optionally, the unit 202 for storing crash information includes:
the target file determining subunit is used for determining the crash time and creating a file by taking the crash time as a file name when the first process monitors that the application crashes, and the file is used as a target file shared by the derived sub-process;
and the storage crash information subunit is used for collecting crash information generated when the application crashes through the first process and storing the crash information in the target file.
Optionally, in the determining the first process unit 203, the method includes:
a process identity information acquiring subunit, configured to acquire, by using the derivation subprocess, process identity information of the first process;
the process identity information checking sub-unit is used for periodically checking whether the process identity information of the first process exists in a system process list through the derivation sub-process;
and the determining first process subunit is used for determining that the first process completes the collection and storage of the crash information when the process identity information of the first process does not exist in the system process list.
Optionally, the reporting crash information unit 204 includes:
the acquiring storage path sub-unit is used for calling a preset function through the derivation sub-process to acquire a storage path of the target file;
and the reporting crash information subunit is used for positioning the target file according to the storage path and acquiring the crash information in the target file for reporting.
Optionally, the derivative sub-process runs in a Java environment.
In the embodiment of the present disclosure, the first process generates the derived sub-process after the crash, the first process collects and stores the crash information, and the derived sub-process reports the crash file generated by the first process. The time difference between the generation of the crash file and the reporting of the crash file is reduced, and the reporting timeliness is ensured. The crash file is reported by the derived sub-process of the first process, so that other crash processes are prevented from covering the crash file, and the integrity of the crash information is ensured
The disclosed embodiments provide a third embodiment, which is a computer storage medium for collecting crash information, where the computer storage medium stores computer-executable instructions that can execute the method for collecting crash information as described in the first embodiment.
The embodiment of the present disclosure provides a fourth embodiment, that is, another electronic device, where the device is used in a method for collecting crash information, and the electronic device includes: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the one processor to cause the at least one processor to perform the method of collecting crash information of the third embodiment.
Referring now to fig. 3, shown is a schematic diagram of an electronic device suitable for use in implementing embodiments five and seven of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 3 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 3, the electronic device may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 301 that may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)302 or a program loaded from a storage device 308 into a Random Access Memory (RAM) 303. In the RAM 303, various programs and data necessary for the operation of the electronic apparatus are also stored. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input/output (I/O) interface 305 is also connected to bus 304.
Generally, the following devices may be connected to the I/O interface 305: input devices 306 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 307 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage devices 308 including, for example, magnetic tape, hard disk, etc.; and a communication device 309. The communication means 309 may allow the electronic device to communicate wirelessly or by wire with other devices to exchange data. While fig. 3 illustrates an electronic device having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication means 309, or installed from the storage means 308, or installed from the ROM 302. The computer program, when executed by the processing device 301, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination 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 present 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 contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. 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, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications 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 network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
Computer program code for carrying out operations for the present disclosure may be written in any combination of 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 type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart 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 described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of an element does not in some cases constitute a limitation on the element itself.
The functions described herein above 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: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), 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. A 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 exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while 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. Under 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 limitations on the scope of the 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 disclosed as example forms of implementing the claims.

Claims (10)

1. A method for collecting crash information, comprising:
when monitoring that the application crashes through a first process, copying and generating a derived sub-process aiming at the first process, wherein the first process is used as a parent process of the derived sub-process;
collecting crash information generated when the application crashes through the first process, and storing the crash information in a target file shared with the derivative sub-process;
periodically determining whether the first process finishes the collection and storage of crash information through the derived sub-process;
and when the first process finishes the collection and storage of the crash information through the derivation sub-process, acquiring the crash information from the target file through the derivation sub-process and reporting the crash information.
2. The collection method of claim 1, wherein collecting, by the first process, crash information generated when an application crashes and storing the crash information in a shared target file comprises:
when monitoring that the application is crashed through the first process, determining the crash time and creating a file by taking the crash time as a file name, wherein the file is used as a target file shared with the derived sub-process;
and collecting crash information generated when the application crashes through the first process, and storing the crash information in the target file.
3. The collection method of claim 1, wherein periodically determining whether the first process completes the collection and storage of crash information by the spawn sub-process comprises:
acquiring process identity information of the first process through the derivation subprocess;
periodically checking whether the process identity information of the first process exists in a system process list through the derivation sub-process;
and when the process identity information of the first process does not exist in the system process list, determining that the first process finishes collecting and storing the crash information.
4. The collection method of claim 1, wherein obtaining crash information from the target file through the spawning subprocess and reporting the crash information comprises:
calling a preset function through the derivation subprocess to obtain a storage path of the target file;
and positioning the target file according to the storage path and acquiring the crash information in the target file for reporting.
5. A collection method according to claim 1, wherein the spawn sub-process runs in a Java environment.
6. An apparatus for collecting crash information, comprising:
generating a derived sub-process unit, configured to copy and generate a derived sub-process for a first process when it is monitored that an application crashes through the first process, where the first process is used as a parent process of the derived sub-process;
the storage crash information unit is used for collecting crash information generated when the application crashes through the first process and storing the crash information in a target file shared by the derived sub-process;
determining a first process unit, configured to periodically determine, by the spawning sub-process, whether the first process completes collection and storage of crash information;
and the crash information reporting unit is used for acquiring the crash information from the target file through the derived sub-process and reporting the crash information when the first process is determined to complete the collection and storage of the crash information through the derived sub-process.
7. The collection apparatus according to claim 6, wherein the storage crash information unit includes:
the target file determining subunit is used for determining the crash time and creating a file by taking the crash time as a file name when the first process monitors that the application crashes, and the file is used as a target file shared by the derived sub-process;
and the storage crash information subunit is used for collecting crash information generated when the application crashes through the first process and storing the crash information in the target file.
8. The collecting apparatus according to claim 6, wherein in said determining the first process unit, comprises:
a process identity information acquiring subunit, configured to acquire, by using the derivation subprocess, process identity information of the first process;
the process identity information checking sub-unit is used for periodically checking whether the process identity information of the first process exists in a system process list through the derivation sub-process;
and the determining first process subunit is used for determining that the first process completes the collection and storage of the crash information when the process identity information of the first process does not exist in the system process list.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the collecting method according to any one of claims 1 to 5.
10. 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 carry out the collection method according to any one of claims 1 to 5.
CN202011118632.XA 2020-10-19 2020-10-19 Method, device, medium and electronic equipment for collecting crash information Pending CN112286773A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011118632.XA CN112286773A (en) 2020-10-19 2020-10-19 Method, device, medium and electronic equipment for collecting crash information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011118632.XA CN112286773A (en) 2020-10-19 2020-10-19 Method, device, medium and electronic equipment for collecting crash information

Publications (1)

Publication Number Publication Date
CN112286773A true CN112286773A (en) 2021-01-29

Family

ID=74496395

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011118632.XA Pending CN112286773A (en) 2020-10-19 2020-10-19 Method, device, medium and electronic equipment for collecting crash information

Country Status (1)

Country Link
CN (1) CN112286773A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8621282B1 (en) * 2011-05-19 2013-12-31 Google Inc. Crash data handling
CN106708643A (en) * 2016-11-14 2017-05-24 武汉斗鱼网络科技有限公司 Abnormal information processing method and apparatus
CN109522198A (en) * 2018-11-26 2019-03-26 北京微播视界科技有限公司 Processing method, device, electronic equipment and the readable storage medium storing program for executing of application program
CN110688245A (en) * 2019-10-08 2020-01-14 广州市百果园信息技术有限公司 Information acquisition method, device, storage medium and equipment
CN111090536A (en) * 2019-11-19 2020-05-01 北京字节跳动网络技术有限公司 Method, device, medium and electronic equipment for acquiring memory leakage information

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8621282B1 (en) * 2011-05-19 2013-12-31 Google Inc. Crash data handling
CN106708643A (en) * 2016-11-14 2017-05-24 武汉斗鱼网络科技有限公司 Abnormal information processing method and apparatus
CN109522198A (en) * 2018-11-26 2019-03-26 北京微播视界科技有限公司 Processing method, device, electronic equipment and the readable storage medium storing program for executing of application program
CN110688245A (en) * 2019-10-08 2020-01-14 广州市百果园信息技术有限公司 Information acquisition method, device, storage medium and equipment
CN111090536A (en) * 2019-11-19 2020-05-01 北京字节跳动网络技术有限公司 Method, device, medium and electronic equipment for acquiring memory leakage information

Similar Documents

Publication Publication Date Title
CN111581291A (en) Data processing method and device, electronic equipment and readable medium
CN110753089B (en) Method, device, medium and electronic equipment for managing client
CN110851139B (en) Method and device for checking codes and electronic equipment
CN111679990B (en) Test data generation method and device, readable medium and electronic equipment
CN112395253B (en) Index file generation method, terminal device, electronic device and medium
CN111857720B (en) User interface state information generation method and device, electronic equipment and medium
CN112214408A (en) Dependency conflict detection method and device, electronic equipment and computer readable medium
CN111596991A (en) Interactive operation execution method and device and electronic equipment
CN111309304B (en) Method, device, medium and electronic equipment for generating IDL file
CN112099982A (en) Collapse information positioning method, device, medium and electronic equipment
CN111338813A (en) Method, device, medium and electronic equipment for dynamically generating middleware
CN113220281A (en) Information generation method and device, terminal equipment and storage medium
CN110888773B (en) Method, device, medium and electronic equipment for acquiring thread identification
CN116302271A (en) Page display method and device and electronic equipment
CN111240801A (en) Method, device, medium and electronic equipment for generating heap memory snapshot file
CN112084086B (en) Information collection method, device, medium and electronic equipment
CN111538717B (en) Data processing method, device, electronic equipment and computer readable medium
CN111309366B (en) Method, device, medium and electronic equipment for managing registration core
CN114817409A (en) Label generation method, device, equipment and medium
CN112286773A (en) Method, device, medium and electronic equipment for collecting crash information
CN112817701A (en) Timer processing method and device, electronic equipment and computer readable medium
CN112767036A (en) Service processing method and device
CN111949528A (en) Memory leak detection method and device, electronic equipment and storage medium
CN111581930A (en) Online form data processing method and device, electronic equipment and readable medium
CN111367590A (en) Interrupt event processing method and device

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant after: Douyin Vision Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant before: Tiktok vision (Beijing) Co.,Ltd.

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant after: Tiktok vision (Beijing) Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant before: BEIJING BYTEDANCE NETWORK TECHNOLOGY Co.,Ltd.

RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210129