CN110928720A - Core dump file generation method and device based on Linux system - Google Patents

Core dump file generation method and device based on Linux system Download PDF

Info

Publication number
CN110928720A
CN110928720A CN202010083558.6A CN202010083558A CN110928720A CN 110928720 A CN110928720 A CN 110928720A CN 202010083558 A CN202010083558 A CN 202010083558A CN 110928720 A CN110928720 A CN 110928720A
Authority
CN
China
Prior art keywords
memory data
program
target
initial
currently accessed
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
CN202010083558.6A
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 An Polytron Technologies Inc
Original Assignee
Beijing An Polytron Technologies Inc
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 An Polytron Technologies Inc filed Critical Beijing An Polytron Technologies Inc
Priority to CN202010083558.6A priority Critical patent/CN110928720A/en
Publication of CN110928720A publication Critical patent/CN110928720A/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/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0766Error or fault reporting or storing
    • G06F11/0781Error filtering or prioritizing based on a policy defined by the user or on a policy defined by a hardware/software module, e.g. according to a severity level
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
    • G06F11/073Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in a memory management context, e.g. virtual memory or cache management

Abstract

The application provides a core dump file generation method and device based on a Linux system. The method comprises the following steps: when a program crash event is detected, acquiring initial memory information when the program runs, determining candidate memory data which accord with a preset filtering rule from the initial memory data according to the type of the initial memory data, screening target memory data currently accessed by the program from the candidate memory data, and generating a core dump file according to the target memory data. Therefore, after the screening is carried out by the preset filtering rule, the target memory data which is not currently accessed by the program can be further screened, namely, the memory data which is not currently accessed by the program is excluded, and when the program sends a crash event, the memory data which is currently accessed is usually caused by errors, so that the screened target memory data has better pertinence on one hand, and the data volume of the core dump file is reduced on the other hand, and developers can conveniently find the cause of the program crash.

Description

Core dump file generation method and device based on Linux system
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a core dump file generation method and apparatus based on a Linux system.
Background
In the Linux system, if a program crashes suddenly, a core dump (core dump) file may be viewed. The developer can analyze the reason from the core dump file to determine the problem of the program crash.
Currently, the core dump file is generated as follows: when the program is abnormally terminated or crashed in the running process, the operating system records the current memory information of the program and stores the memory information in a file, and the behavior is called coredump. However, there are many memory information during program operation, and if all the memory information is recorded as a core dump file, the data size of the core dump file will be large, which obviously is not beneficial for a developer to find the cause of program crash.
One existing solution is that a developer may set a filtering rule, and screen out the type of the required memory data by using the filtering rule, and generate a core dump file based on the type of the memory data. However, the foregoing method using the filtering rule still brings some disadvantages, that is, the filtering rule only performs filtering for the type of the memory data, and for the same type of memory data, either all the core dump files are generated or all the core dump files are not generated. The data size of some types of memory data is huge, and the core dump file generated by the method still has a large data size, so that developers are not favorable for finding the cause of program crash.
Based on this, there is a need for a core dump file generation method based on a Linux system, which is used to solve the technical problem that the generated core dump file in the prior art has an excessively large data volume and is not beneficial for developers to find the cause of program crash.
Disclosure of Invention
The application provides a method and a device for generating a core dump file based on a Linux system, which can be used for solving the technical problem that the data size of the core dump file generated in the prior art is too large, so that developers are not facilitated to find the cause of program crash.
In a first aspect, an embodiment of the present application provides a core dump file generation method based on a Linux system, where the method includes:
when a crash event of a program is detected, acquiring initial memory information of the program during running; the initial memory information comprises initial memory data and the type of the initial memory data;
determining candidate memory data which accord with a preset filtering rule from the initial memory data according to the type of the initial memory data; the preset filtering rule is a preset type of memory data for generating a core dump file;
screening target memory data currently accessed by a program from the candidate memory data;
and generating a core dump file according to the target memory data.
With reference to the first aspect, in an implementable manner of the first aspect, the type of the initial memory data includes at least one of private anonymity, shared anonymity, private mapping of underlying files, underlying file shared mapping, ELF header, private large-size page, shared large-size page, DAX private memory, and DAX shared memory.
With reference to the first aspect, in an implementable manner of the first aspect, the preset filtering rule includes a private large-size page and a shared large-size page;
the candidate memory data comprises initial memory data corresponding to a private large-size page and initial memory data corresponding to a shared large-size page.
With reference to the first aspect, in an implementation manner of the first aspect, the screening target memory data currently accessed by a program from the candidate memory data includes:
and screening out target memory data currently accessed by the program from the initial memory data corresponding to the private large-size page and the initial memory data corresponding to the shared large-size page.
With reference to the first aspect, in an implementation manner of the first aspect, the obtaining initial memory information of the program during running includes:
when a program is detected to have a crash event, determining a target process corresponding to the crash event;
and acquiring the memory information of the target process, and taking the memory information of the target process as the initial memory information.
With reference to the first aspect, in an implementation manner of the first aspect, before the target memory data currently accessed by the program is screened from the candidate memory data, the method further includes:
determining a target keyword corresponding to target memory data currently accessed by a program;
screening out target memory data currently accessed by a program from the candidate memory data, wherein the screening comprises the following steps:
and screening target memory data currently accessed by the program from the candidate memory data according to the target keywords.
In a second aspect, an embodiment of the present application provides a core dump file generation apparatus based on a Linux system, where the apparatus includes:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring initial memory information of a program in operation when a crash event of the program is detected; the initial memory information comprises initial memory data and the type of the initial memory data;
the processing unit is used for determining candidate memory data which accord with a preset filtering rule from the initial memory data according to the type of the initial memory data; the preset filtering rule is a preset type of memory data for generating a core dump file; screening target memory data currently accessed by the program from the candidate memory data;
and the generating unit is used for generating a core dump file according to the target memory data.
In combination with the second aspect, in an implementable manner of the second aspect, the type of the initial memory data includes at least one of private anonymity, shared anonymity, private mapping of underlying files, underlying file shared mapping, ELF header, private large-size page, shared large-size page, DAX private memory, and DAX shared memory.
With reference to the second aspect, in an implementable manner of the second aspect, the preset filtering rule includes a private large-size page and a shared large-size page;
the candidate memory data comprises initial memory data corresponding to a private large-size page and initial memory data corresponding to a shared large-size page.
With reference to the second aspect, in an implementable manner of the second aspect, the processing unit is specifically configured to:
and screening out target memory data currently accessed by the program from the initial memory data corresponding to the private large-size page and the initial memory data corresponding to the shared large-size page.
With reference to the second aspect, in an implementation manner of the second aspect, the obtaining unit is specifically configured to:
when a program is detected to have a crash event, determining a target process corresponding to the crash event; and acquiring the memory information of the target process, and taking the memory information of the target process as the initial memory information.
With reference to the second aspect, in an implementation manner of the second aspect, before the target memory data currently accessed by the program is screened from the candidate memory data, the processing unit is further configured to:
determining a target keyword corresponding to target memory data currently accessed by a program;
the processing unit is specifically configured to:
and screening target memory data currently accessed by the program from the candidate memory data according to the target keywords.
In a third aspect, an embodiment of the present application provides an electronic device, including:
a memory for storing program instructions;
and the processor is used for calling and executing the program instructions in the memory so as to realize the core dump file generation method of the first aspect.
In a fourth aspect, an embodiment of the present application provides a storage medium, where a computer program is stored in the storage medium, and when the computer program is executed by at least one processor of the core dump file generating apparatus, the core dump file generating apparatus executes the method for generating a core dump file according to the first aspect.
In the embodiment of the application, when a program crash event is detected, the candidate memory data meeting the preset filtering rule can be screened out first, then the target memory data currently accessed by the program is screened out from the candidate memory data, and then the core dump file can be generated according to the target memory data. By adopting the method, after the screening is carried out by the preset filtering rule, the target memory data currently accessed by the program can be further screened, namely, the memory data not currently accessed by the program is excluded, and the error of the memory data currently accessed is usually caused when the program sends a crash event, so that the screened target memory data has better pertinence on one hand, and the data volume of the core dump file is reduced on the other hand, thereby facilitating the developer to search the cause of the program crash.
Drawings
FIG. 1 is a flowchart illustrating a core dump file generation method based on a Linux system according to an embodiment of the present disclosure;
fig. 2 is a schematic diagram corresponding to a method for generating a core dump file according to an embodiment of the present disclosure;
FIG. 3 is a schematic structural diagram of a core dump file generation apparatus based on a Linux system according to an embodiment of the present application;
fig. 4 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
The following first explains terms related to embodiments of the present application.
Sharing the memory: as the name implies, sharing memory is a very efficient way to share and transfer data between two running processes, allowing two unrelated processes to access the same logical memory. The memory shared between different processes is usually the same physical memory segment. The processes may connect the same segment of physical memory to their own address space, and all processes may access addresses in the shared memory. If a process writes data to shared memory, the changes made will immediately affect any other process that can access the same segment of shared memory.
core dump: the application program is abnormally exited or suspended in the running process due to various exceptions or BUGs, and a file called core is generated when a certain condition is met. Generally, the core file includes a memory, a register state, a stack pointer, memory management information, and various function call stack information during program operation, and we can understand that the core file is a mirror image file generated by storing the current operating state of the program. The process of generating this image file is called core dump. By analyzing the file through the tool, the corresponding stack call information and the like when the program exits abnormally can be located, and the problem is found out and solved in time.
Large page memory (Hugepage): the Linux system manages memories (physical memories and virtual memories) in a paging mode. The paging mode can avoid the waste of memory space. Accordingly, there is a concept of physical address and virtual address of the memory, and a Central Processing Unit (CPU) must convert the virtual address into a physical memory address to actually access the memory. To improve this translation efficiency, the CPU caches recent mappings between virtual memory addresses and physical memory addresses and stores them in a mapping Table (TLB) maintained by the CPU. In order to increase the access speed of the memory as much as possible, it is necessary to store as many mapping relationships as possible in the mapping table. Generally, each page of the Linux system is 4 kbytes by default, which means that if the physical memory is large, the number of entries of the mapping table is very large, and the retrieval efficiency of the CPU is affected. Since the memory size is fixed, in order to reduce the entries of the mapping table, only the page size is increased, and therefore the Hugepage comes.
DPDK, known as Intel Data Plane Development Kit, is a Data Plane Development tool set provided by Intel, provides support of library functions and drivers for user space efficient packet processing under an Intel Architecture (IA) processor architecture, and is different from a Linux system aiming at universal design and focuses on high-performance processing of packets in network applications. At present, the DPDK can run on most Linux operating systems, and uses BSDLicense, thereby being greatly convenient for enterprises to realize own protocol stacks or applications on the basis of the BSDLicense.
GDB tool: UNIX and UNIX-like. Generally, GDBs have the following functions: starting a program, wherein the program can be randomly operated according to the user-defined requirement; the debuggee program can be made to stop at the breakpoint of the set specified by you; when the program is stopped, what happens in the program at that time can be checked; the program can be changed to correct the effect of one BUG to test other BUGs.
Referring to fig. 1, a flowchart illustrating a method for generating a coredump file based on a Linux system according to an embodiment of the present application is shown as an example. As shown in fig. 1, the method specifically comprises the following steps:
step 101, when a program crash event is detected, acquiring initial memory information of the program during running.
And 102, determining candidate memory data which accord with a preset filtering rule from the initial memory data according to the type of the initial memory data.
Step 103, screening out target memory data currently accessed by the program from the candidate memory data.
And step 104, generating a core dump file according to the target memory data.
In the embodiment of the application, when a program crash event is detected, the candidate memory data meeting the preset filtering rule can be screened out first, then the target memory data currently accessed by the program is screened out from the candidate memory data, and then the core dump file can be generated according to the target memory data. By adopting the method, after the screening is carried out by the preset filtering rule, the target memory data which is not currently accessed by the program can be further screened, namely, the memory data which is not currently accessed by the program is excluded, and the target memory data which is screened out is more targeted on one hand, and on the other hand, the data volume of the core dump file is reduced, so that developers can conveniently find the reason of program collapse because the memory data which is currently accessed is usually caused by errors when the program is crashed.
Specifically, in step 101, when a crash event of the program is detected, a target process corresponding to the crash event may be determined first, then the memory information of the target process is obtained, and the memory information of the target process is used as the initial memory information.
The target process may be a process program for processing any service.
When the target process program generates abnormal fault, the process may generate crash. Furthermore, the crash is a process crash event caused when the program is abnormal. Generally, when a process has a crash, the process receives the following signals: SIGQUIT, SIQILL, SIGTARP, SIGABRT, SIGBUS or SIGFAPE. When a process creates a crash, the system will generate a tombstone file based on the process. The tombstone file only records brief information of the process, including information in each register value and a nearby memory when a problem occurs, and also records brief information of each frame in the process stack. By searching for the tombstone file, the target process corresponding to the crash event can be determined.
In a specific implementation process, a GDB tool may be used to obtain initial memory information. The method comprises the steps of acquiring a called function group through a backup command in a GDB tool, simultaneously using a frame command to enter each layer of calling function, and then using an information local or information register command to acquire as many variable addresses used by the function as possible. And in the obtained result file, acquiring initial memory information by searching a 'signal handler' character string.
In this embodiment, the initial memory information may include initial memory data and a type of the initial memory data. Wherein the type of the initial memory data may include at least one of private anonymity, shared anonymity, private mapping of underlying files, underlying file shared mapping, ELF headers, private large size pages, shared large size pages, DAX private memory, and DAX shared memory.
In step 102, the preset filtering rule may be a preset type of memory data for generating the core dump file.
For example, as shown in table 1, it is an example of the initial memory information.
Table 1: an example of initial memory information
Figure 248944DEST_PATH_IMAGE001
Taking the content shown in table 1 as an example, if the types of the memory data set in the preset filtering rule for generating the core dump file include a private large-size page and a shared large-size page, the candidate memory data conforming to the filtering rule includes initial memory data corresponding to the private large-size page and initial memory data corresponding to the shared large-size page, which are the data 6 and the data 7 shown in table 1.
In a specific implementation process, different parameter values may be set for different types of memory data, and the parameter values may be set in a bit manner, for example, the private anonymity is set to bit0, the sharing anonymity is set to bit1, the private mapping of the underlying file is set to bit2, the sharing mapping of the underlying file is set to bit3, the ELF header is set to bit4, the private large-size page is set to bit5, the shared large-size page is set to bit6, the DAX private memory is set to bit7, and the DAX shared memory is set to bit 8. Therefore, when the core dump file is generated, only part of types of memory data which accord with the preset filtering rule can be captured by adopting a rule filtering method to serve as candidate memory data for generating the core dump file.
Further, in the types of the memory data, generally, the data amount of the memory data corresponding to the private large-size page and the shared large-size page is huge, that is, by adopting the method provided by the embodiment of the present application, the two types of memory data, namely the private large-size page and the shared large-size page with huge data amount, are mainly screened, so that the data amount of the core dump file is reduced.
Before step 103 is executed, a target keyword corresponding to target memory data currently accessed by the program may be determined, and then, when step 103 is executed, the target memory data currently accessed by the program may be screened from the candidate memory data according to the target keyword.
For example, if the candidate memory data includes initial memory data corresponding to a private large-size page and initial memory data corresponding to a shared large-size page, target memory data currently accessed by the program may be screened from the initial memory data corresponding to the private large-size page and the initial memory data corresponding to the shared large-size page.
Taking data 6 and data 7 shown in table 1 as an example, data 6 is initial memory data corresponding to a private large-size page, and data 7 is initial memory data corresponding to a shared large-size page. As shown in table 2, an example of initial memory data is shown. Wherein, the data 6 comprises subdata such as data 6-1, data 6-2, data 6-3 and the like; the data 7 includes sub data such as data 7-1, data 7-2, and data 7-3.
Table 2: an example of initial memory data
Figure 41450DEST_PATH_IMAGE002
If, in the subdata corresponding to the data 6, the data 6-1 and the data 6-2 are the memory data currently accessed by the program, and in the subdata corresponding to the data 7, the data 7-2 and the data 7-3 are the memory data currently accessed by the program, it may be determined that the target memory data includes the data 6-1, the data 6-2, the data 7-2 and the data 7-3.
In order to more clearly describe the core dump file generation method based on the Linux system provided in the embodiment of the present application, an example is given below in which the preset filter rule includes a private large-size page and a shared large-size page, and is exemplarily described with reference to fig. 2.
Please refer to fig. 2, which schematically illustrates a schematic diagram corresponding to a method for generating a core dump file according to an embodiment of the present application.
In step 201, a GDB tool is used to obtain the address of a variable used by a function.
In the GDB tool, the called function group can be acquired through a backup command, a frame command is used for entering each layer of calling function, and then an information local or information register command is used for acquiring the variable addresses used by the function as much as possible.
Further, in the formal release version, the binary executable program corresponding to the process may be subjected to strip symbol table and more optimization due to the limitation of the compiling options, so that the address effect shown by the two commands, namely the information local and the information register, may be poor. In order to acquire effective addresses as much as possible, an extended script interface is reserved, and in the script, a user can add a self-defined memory address acquisition method according to the requirement of the user.
Step 202, searching a 'signal handler' character string in the variable address to obtain initial memory information.
Since the GDB tool is a common tool, a "signal handler" string will exist in each system version.
Step 203, traversing the function stack, and determining candidate memory data meeting the preset filtering rule.
And traversing each function stack from the position of the character string of the 'signal handler', identifying the character string beginning with '0 x' in the function stack, converting the character string into an address, and judging whether the address meets a preset filtering rule (namely whether the address is a private large-size page or a shared large-size page).
Step 204, for any subdata in the candidate memory data, judging whether the subdata is the memory data currently accessed by the program, if so, executing step 205; otherwise, returning to step 204, judging the next subdata.
In a specific implementation process, whether the subdata is currently accessed memory data can be judged in a DPDK traversing mode.
Step 205, the subdata is used as the target memory data.
In a specific implementation process, the target memory data can be distinguished by setting the MADV _ DONTDUMP flag.
And step 206, generating a core dump file according to the target memory data.
In the embodiment of the application, when a program crash event is detected, the candidate memory data meeting the preset filtering rule can be screened out first, then the target memory data currently accessed by the program is screened out from the candidate memory data, and then the core dump file can be generated according to the target memory data. By adopting the method, after the screening is carried out by the preset filtering rule, the target memory data currently accessed by the program can be further screened, namely, the memory data not currently accessed by the program is excluded, and the error of the memory data currently accessed is usually caused when the program sends a crash event, so that the screened target memory data has better pertinence on one hand, and the data volume of the core dump file is reduced on the other hand, thereby facilitating the developer to search the cause of the program crash.
The following are embodiments of the apparatus of the present application that may be used to perform embodiments of the method of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method of the present application.
Fig. 3 schematically illustrates a structure of a core dump file generation apparatus based on a Linux system according to an embodiment of the present application. As shown in fig. 3, the apparatus has a function of implementing the core dump file generation method, where the function may be implemented by hardware, or may be implemented by hardware executing corresponding software. The apparatus may include: an acquisition unit 301, a processing unit 302 and a generation unit 303.
An obtaining unit 301, configured to obtain initial memory information of a program when the program is detected to have a crash event; the initial memory information comprises initial memory data and the type of the initial memory data;
a processing unit 302, configured to determine, according to the type of the initial memory data, candidate memory data that meets a preset filtering rule from the initial memory data; the preset filtering rule is a preset type of memory data for generating a core dump file; screening target memory data currently accessed by the program from the candidate memory data;
a generating unit 303, configured to generate a core dump file according to the target memory data.
Optionally, the type of the initial memory data includes at least one of private anonymity, shared anonymity, private mapping of underlying files, underlying file shared mapping, ELF header, private large size page, shared large size page, DAX private memory, and DAX shared memory.
Optionally, the preset filtering rule includes a private large-size page and a shared large-size page;
the candidate memory data comprises initial memory data corresponding to a private large-size page and initial memory data corresponding to a shared large-size page.
Optionally, the processing unit 302 is specifically configured to:
and screening out target memory data currently accessed by the program from the initial memory data corresponding to the private large-size page and the initial memory data corresponding to the shared large-size page.
Optionally, the obtaining unit 301 is specifically configured to:
when a program is detected to have a crash event, determining a target process corresponding to the crash event; and acquiring the memory information of the target process, and taking the memory information of the target process as the initial memory information.
Optionally, before the target memory data currently accessed by the program is screened from the candidate memory data, the processing unit 302 is further configured to:
determining a target keyword corresponding to target memory data currently accessed by a program;
the processing unit 302 is specifically configured to:
and screening target memory data currently accessed by the program from the candidate memory data according to the target keywords.
In the embodiment of the application, when a program crash event is detected, the candidate memory data meeting the preset filtering rule can be screened out first, then the target memory data currently accessed by the program is screened out from the candidate memory data, and then the core dump file can be generated according to the target memory data. Therefore, after the screening is carried out by the preset filtering rule, the target memory data which is not currently accessed by the program can be further screened, namely, the memory data which is not currently accessed by the program is excluded, and when the program sends a crash event, the memory data which is currently accessed is usually caused by errors, so that the screened target memory data has better pertinence on one hand, and the data volume of the core dump file is reduced on the other hand, and developers can conveniently find the cause of the program crash.
Fig. 4 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application. As shown in fig. 4, an electronic device provided in an embodiment of the present application includes: a memory 401 for storing program instructions; the processor 402 is configured to call and execute the program instructions in the memory to implement the core dump file generation method according to the foregoing embodiment.
In this embodiment, the processor 402 and the memory 401 may be connected by a bus or other means. The processor may be a general-purpose processor, such as a central processing unit, a digital signal processor, an application specific integrated circuit, or one or more integrated circuits configured to implement embodiments of the present application. The memory may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as read-only memory, flash memory, a hard disk, or a solid state disk.
The embodiment of the present application further provides a storage medium, in which a computer program is stored, and when at least one processor of the core dump file generation apparatus executes the computer program, the core dump file generation apparatus executes the method for generating the core dump file according to the above embodiment.
The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a Random Access Memory (RAM).
Those skilled in the art will clearly understand that the techniques in the embodiments of the present application may be implemented by way of software plus a required general hardware platform. Based on such understanding, the technical solutions in the embodiments of the present application may be essentially implemented or a part contributing to the prior art may be embodied in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the embodiments or some parts of the embodiments of the present application.
The same and similar parts in the various embodiments in this specification may be referred to each other. In particular, for the embodiments of the service construction apparatus and the service loading apparatus, since they are substantially similar to the embodiments of the method, the description is simple, and the relevant points can be referred to the description in the embodiments of the method.
The above-described embodiments of the present application do not limit the scope of the present application.

Claims (10)

1. A core dump file generation method based on a Linux system is characterized by comprising the following steps:
when a crash event of a program is detected, acquiring initial memory information of the program during running; the initial memory information comprises initial memory data and the type of the initial memory data;
determining candidate memory data which accord with a preset filtering rule from the initial memory data according to the type of the initial memory data; the preset filtering rule is a preset type of memory data for generating a core dump file;
screening target memory data currently accessed by a program from the candidate memory data;
and generating a core dump file according to the target memory data.
2. The method of claim 1, wherein the type of the initial memory data comprises at least one of private anonymity, shared anonymity, private mapping of underlying files, underlying file-sharing mapping, ELF header, private large-size page, shared large-size page, DAX private memory, and DAX shared memory.
3. The method according to claim 2, wherein the preset filtering rules comprise private large-size pages and shared large-size pages;
the candidate memory data comprises initial memory data corresponding to a private large-size page and initial memory data corresponding to a shared large-size page.
4. The method of claim 3, wherein the step of filtering out the target memory data currently accessed by the program from the candidate memory data comprises:
and screening out target memory data currently accessed by the program from the initial memory data corresponding to the private large-size page and the initial memory data corresponding to the shared large-size page.
5. The method of claim 1, wherein obtaining initial memory information during program runtime comprises:
when a program is detected to have a crash event, determining a target process corresponding to the crash event;
and acquiring the memory information of the target process, and taking the memory information of the target process as the initial memory information.
6. The method of claim 1, wherein prior to screening the candidate memory data for target memory data currently accessed by the program, the method further comprises:
determining a target keyword corresponding to target memory data currently accessed by a program;
screening out target memory data currently accessed by a program from the candidate memory data, wherein the screening comprises the following steps:
and screening target memory data currently accessed by the program from the candidate memory data according to the target keywords.
7. A core dump file generation apparatus based on a Linux system, the apparatus comprising:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring initial memory information of a program in operation when a crash event of the program is detected; the initial memory information comprises initial memory data and the type of the initial memory data;
the processing unit is used for determining candidate memory data which accord with a preset filtering rule from the initial memory data according to the type of the initial memory data; the preset filtering rule is a preset type of memory data for generating a core dump file; screening target memory data currently accessed by the program from the candidate memory data;
and the generating unit is used for generating a core dump file according to the target memory data.
8. The apparatus of claim 7, wherein the type of the initial memory data comprises at least one of private anonymity, shared anonymity, private mapping of underlying files, underlying file-sharing mapping, ELF header, private large-size page, shared large-size page, DAX private memory, and DAX shared memory.
9. The apparatus of claim 8, wherein the preset filtering rules comprise private large-size pages and shared large-size pages;
the candidate memory data comprises initial memory data corresponding to a private large-size page and initial memory data corresponding to a shared large-size page.
10. The apparatus of claim 7, wherein the processing unit, prior to filtering out the target memory data currently accessed by the program from the candidate memory data, is further configured to:
determining a target keyword corresponding to target memory data currently accessed by a program;
the processing unit is specifically configured to:
and screening target memory data currently accessed by the program from the candidate memory data according to the target keywords.
CN202010083558.6A 2020-02-10 2020-02-10 Core dump file generation method and device based on Linux system Pending CN110928720A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010083558.6A CN110928720A (en) 2020-02-10 2020-02-10 Core dump file generation method and device based on Linux system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010083558.6A CN110928720A (en) 2020-02-10 2020-02-10 Core dump file generation method and device based on Linux system

Publications (1)

Publication Number Publication Date
CN110928720A true CN110928720A (en) 2020-03-27

Family

ID=69854840

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010083558.6A Pending CN110928720A (en) 2020-02-10 2020-02-10 Core dump file generation method and device based on Linux system

Country Status (1)

Country Link
CN (1) CN110928720A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111563000A (en) * 2020-04-28 2020-08-21 深圳震有科技股份有限公司 File generation method, intelligent terminal and storage medium
CN113791925A (en) * 2021-08-24 2021-12-14 杭州迪普科技股份有限公司 Memory mapping file storage method and device
US11829231B2 (en) 2020-12-01 2023-11-28 Samsung Electronics Co., Ltd. Methods and systems for generating core dump in a user equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101529385A (en) * 2005-06-01 2009-09-09 纽约市哥伦比亚大学理事会 Methods and systems for repairing applications
CN104881611A (en) * 2014-02-28 2015-09-02 国际商业机器公司 Method and apparatus for protecting sensitive data in software product
CN108874448A (en) * 2017-05-09 2018-11-23 阿里巴巴集团控股有限公司 Realize the method and apparatus that object is positioned in coredump file

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101529385A (en) * 2005-06-01 2009-09-09 纽约市哥伦比亚大学理事会 Methods and systems for repairing applications
CN104881611A (en) * 2014-02-28 2015-09-02 国际商业机器公司 Method and apparatus for protecting sensitive data in software product
CN108874448A (en) * 2017-05-09 2018-11-23 阿里巴巴集团控股有限公司 Realize the method and apparatus that object is positioned in coredump file

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
立超的专栏: ""关于内核转储(core dump)的设置方法"", 《HTTPS://WWW.CNBLOGS.COM/ZLCXBB/P/6431191.HTML》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111563000A (en) * 2020-04-28 2020-08-21 深圳震有科技股份有限公司 File generation method, intelligent terminal and storage medium
CN111563000B (en) * 2020-04-28 2023-08-18 深圳市震有软件科技有限公司 File generation method, intelligent terminal and storage medium
US11829231B2 (en) 2020-12-01 2023-11-28 Samsung Electronics Co., Ltd. Methods and systems for generating core dump in a user equipment
CN113791925A (en) * 2021-08-24 2021-12-14 杭州迪普科技股份有限公司 Memory mapping file storage method and device

Similar Documents

Publication Publication Date Title
US8073673B2 (en) Emulated memory management
US8769504B2 (en) Method and apparatus for dynamically instrumenting a program
US7458078B2 (en) Apparatus and method for autonomic hardware assisted thread stack tracking
CN110928720A (en) Core dump file generation method and device based on Linux system
US7302613B2 (en) System and method for capturing kernel-resident information
CN109086183B (en) Application program monitoring method and device, electronic equipment and storage medium
CN110716845B (en) Log information reading method of Android system
EP3274839B1 (en) Technologies for root cause identification of use-after-free memory corruption bugs
US20050283672A1 (en) Management device configured to perform a data dump
US9223678B2 (en) Data processor device having a debug control module which selectively modifies trace messages
CN111800490A (en) Method and device for acquiring network behavior data and terminal equipment
US8726101B2 (en) Apparatus and method for tracing memory access information
US20070150866A1 (en) Displaying parameters associated with call statements
US20110202903A1 (en) Apparatus and method for debugging a shared library
CN109408265B (en) IOS abnormal operation protection method and device, terminal equipment and storage medium
CN116450398A (en) Exception backtracking method, device, equipment and medium
CN115421960A (en) UE memory fault recovery method, device, electronic equipment and medium
CN115858211A (en) Method and device for processing machine check errors
CN108845959B (en) Memory data processing method and device and electronic equipment
CN112783683A (en) Data processing method, device, equipment and storage medium
CN111475807A (en) Detection method and device for movable storage equipment
US20210406162A1 (en) Code testing method, apparatus and device, and computer-readable storage medium
CN112307033B (en) Reconstruction method, device and equipment of data packet file
CN116107759A (en) Memory space optimization method, kernel symbol access method and device
JPH02126340A (en) Data processing system

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200327

RJ01 Rejection of invention patent application after publication