Debugging device, debugging system, debugging method, and debugging program
The debug device and method for fault-tolerant servers allow setting breakpoints on one system while maintaining continuous operation by rewriting instructions and desynchronizing systems, facilitating debugging without interrupting business applications.
Patent Information
- Application Number
- JP2023037183
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-03-10
- Publication Date
- 2024-09-24
AI Technical Summary
In fault-tolerant servers with dual systems synchronized by lockstep technology, setting breakpoints for debugging requires stopping both systems, preventing continuous operation of the business application.
A debug device and method that allows setting breakpoints on one system of a fault-tolerant server by rewriting instructions with breakpoint exceptions, suppressing page-out, and desynchronizing systems upon breakpoint exceptions to enable debugging without stopping the other system.
Enables obtaining debugging information while continuing business operations on one system and stopping at a breakpoint on the other, utilizing the FT server's ability to desynchronize and operate independently, allowing data extraction without affecting ongoing processes.
Smart Images

Figure 2024128281000001
Abstract
Description
[Technical field]
[0001] The present invention relates to a debugging device, a debugging system, a debugging method, and a debugging program. [Background technology]
[0002] Generally, when a user debugs, in order to obtain debugging information such as the server's registers, stack, and memory data, the user must set breakpoints in the business AP, OS, driver, etc., and stop the business AP or the entire system at the set breakpoint.
[0003] On the other hand, there are servers that are configured to prevent the entire system from stopping, that is, servers that continue normal processing even if some of their components fail, called fault-tolerant (FT) servers. A fault-tolerant server is a highly available server that has duplicated hardware components and is equipped with a mechanism that prevents the system from stopping even when a failure occurs.
[0004] FT servers are duplicated to ensure availability, with the memory contents of both systems being made identical, and lockstep technology, which synchronizes the processors of each system on a clock-by-clock basis for redundancy, ensures that both systems operate in exactly the same way. This allows the affected CPU subsystem to be logically isolated in the event of a failure, allowing operation to continue on the healthy system.
[0005] However, because it is not possible to set a breakpoint on only one of the systems of an FT server using normal means, when a breakpoint is set for debugging, both systems of the FT server must be stopped. In other words, in a duplicated FT server, due to lockstep technology that synchronizes the processors and memory of both systems on a clock-by-clock basis to provide redundancy, it is not possible to stop only one system at a breakpoint, even after the two systems are separated. For this reason, just like with a general-purpose server, when a breakpoint is set for debugging, it is necessary to stop the business AP or the entire system.
[0006] Related technologies include one that prohibits swapping out when relocating files (Patent Document 1), one that checks the CPU information of both systems using an external debugger to investigate causes such as desynchronization of the FT server (Patent Document 2), one that desynchronizes the FT server and splits it into two systems, continuing operations on one while taking a backup on the other, allowing backups to be taken without affecting operations (Patent Document 3), one that monitors breakpoints set in a program and stops program execution when certain conditions are met (Patent Document 4), and one that intentionally and temporarily desynchronizes the FT server, splitting it into two systems which operate independently (Patent Document 5). [Prior art documents] [Patent documents]
[0007] [Patent Document 1] Japanese Patent Application Publication No. 62-245445 [Patent Document 2] Patent No. 5477725 [Patent Document 3] JP 2013-206052 A [Patent Document 4] JP 2013-206061 A [Patent Document 5] Patent Publication No. 2022-036778 Summary of the Invention [Problem to be solved by the invention]
[0008] Because both systems in a duplicated FT server operate in the same way, it should be sufficient to perform debugging on only one of the systems, and business should be able to continue on the system not being debugged. However, for the reasons mentioned above, this was not possible, which was an issue. [Means for solving the problem]
[0009] The present invention provides a debugging device, a debugging system, a debugging method, and a debugging program.
[0010] A first aspect of the present invention is a debugging device including a setting unit configured to read a portion of a program to be debugged, including an instruction for setting a breakpoint, from a debug area of each memory of systems operating in synchronization with each other, and to rewrite the instruction with a breakpoint instruction in a system used for debugging among the systems operating in synchronization with each other, thereby suppressing a page-out of the debug area; an exception handler configured to desynchronize the synchronously operating systems when a breakpoint exception occurs; The present invention is characterized by comprising:
[0011] A second aspect of the present invention is a debugging system including: The above debugging equipment; The present invention is characterized by comprising:
[0012] A third aspect of the present invention is a debugging method comprising the steps of: reading, into a debug area of a memory of each of systems operating in synchronization with each other, a portion of a program to be debugged that includes an instruction at which a breakpoint is set; rewriting, in a system used for debugging among the systems operating in synchronization with each other, the instruction with a breakpoint instruction; and suppressing a page-out of the debug area; desynchronizing said synchronously operating systems when a breakpoint exception occurs; The present invention is characterized by having the following.
[0013] A fourth aspect of the present invention is a setting unit configured such that a debug program reads out a portion of a program to be debugged, including an instruction at which a breakpoint is set, in a debug area of each memory of systems operating in synchronization with each other, and rewrites the instruction in a system used for debugging among the systems operating in synchronization with each other with a breakpoint instruction, thereby suppressing page-out of the debug area; an exception handler configured to desynchronize the synchronously operating systems when a breakpoint exception occurs; The present invention is characterized in that the computer functions as a Effect of the Invention
[0014] According to the present invention, a user can continue the operation of a business AP on one system of a FT server while stopping the operation at a breakpoint on the other system, and obtain the necessary debug information. [Brief description of the drawings]
[0015] [Figure 1] FIG. 2 is a diagram showing the configuration of a debugging device according to an embodiment of the present invention. [Diagram 2] FIG. 2 illustrates a diagram showing synchronized and de-synchronized states of a FT server according to an embodiment of the invention. [Diagram 3] 4 is a flowchart of setting a breakpoint, according to an embodiment of the present invention. [Figure 4] FIG. 4 is a diagram showing the memory states (1) of system 0 and system 1 at each step in FIG. [Diagram 5] FIG. 4 is a diagram showing the memory states (2) of system 0 and system 1 at each step in FIG. [Figure 6]FIG. 4 is a diagram showing the memory states (3) of system 0 and system 1 at each step in FIG. [Figure 7] FIG. 4 is a diagram showing the memory states (4) of system 0 and system 1 at each step in FIG. [Figure 8] FIG. 4 is a diagram showing the memory states (5) of System 0 and System 1 at each step in FIG. [Figure 9] 13 is a flowchart showing a process from debugging to recovery in an FT server according to an embodiment of the present invention. [Figure 10] FIG. 11 illustrates a diagram showing synchronized and desynchronized states of a FT server according to another embodiment of the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0016] First, the basic configuration and operation of an embodiment of the present invention will be described. The user sets a breakpoint. A breakpoint is set by rewriting an instruction in a relevant memory location into an instruction that generates a breakpoint exception. The opportunity to start debugging occurs when the FT server executes this instruction and a breakpoint exception occurs. This opportunity makes it possible to release the synchronization of the FT server and split it into two systems (system 0 and system 1) that operate independently. While the synchronization is released, system 0 and system 1 can each be operated for different purposes.
[0017] In one embodiment, the above debugging method can be realized by using a debugging device. The debugging device may realize its functions using hardware and software, for example, by reading a program from a disk of the server and executing the program by a processor of the server. Alternatively, the function of the debugging device may be realized as a circuit or device in the server. The debugging device may be controlled by using a command from a terminal.
[0018] 1 is a diagram showing a configuration of a debugging device according to an embodiment of the present invention. The debugging device 100 includes a setting unit 110 and an exception processing unit 120. The setting unit 110 is configured to read a portion including an instruction for setting a breakpoint in a program to be debugged in a debug area of each memory of systems operating synchronously in a fault-tolerant server, and rewrite the instruction with a breakpoint instruction in a system used for debugging among the systems operating synchronously, thereby suppressing page-out of the debug area. The exception processing unit 120 is configured to release the synchronization of the systems operating synchronously in the fault-tolerant server when a breakpoint exception occurs.
[0019] In this way, by taking advantage of the feature of a FT server that can be desynchronized and divided into two systems that operate independently, a business AP can be run on one system of the FT server, while the business AP is stopped on an instruction with a set breakpoint on the other system of the FT server, allowing the user to obtain debug information such as register, stack, and memory data.
[0020] A more detailed example of the configuration and operation of a FT server in an embodiment of the present invention will be described below.
[0021] 2 is a diagram showing the synchronized and desynchronized states of the FT server 10 according to an embodiment of the present invention. The left side of Fig. 2 shows the synchronized state, and the right side shows the desynchronized state after desynchronization.
[0022] The FT server 10 has two central processing unit (CPU) modules, two memories (not shown), two FT controllers, and two input / output (IO) modules. The IO module has a network interface card (NIC) and a disk (storage device). The FT server 10 connects to a network via the NIC. The CPU module and the IO module have debug ports. Debug port 0, debug port 1, debug port 0', and debug port 1' are provided in CPU module 0, CPU module 1, IO module 0, and IO module 1, respectively, and can be connected from a debug terminal 12 via a changeover switch 11.
[0023] In the synchronized state shown on the left side of Figure 2, one OS is running, and under the control of this OS, CPU module 0 and CPU module 1, FT controller 0 and FT controller 1 are synchronized, and IO module 0 (NIC 0, disk 0) and IO module 1 (NIC 1, disk 1) are duplicated.
[0024] In the desynchronized state shown on the right side of Figure 2, the OS operates separately as OS#1 and OS#2, and in the synchronized state FT server 10 operated as a single system, but it is now split into two systems: system 0 (CPU module 0, memory for system 0, FT controller 0, IO module 0) and system 1 (CPU module 1, memory for system 1, FT controller 1, IO module 1). The duplication of IO module 0 (NIC 0, disk 0) and IO module 1 (NIC 1, disk 1) remains the same. In other words, they are used in a duplexed state from system 1 and system 2.
[0025] When debugging is to be performed after the synchronization is released, the debug terminal 12 is connected to the debug port (debug port 1) of the system to be debugged (here, system 1) by the changeover switch 11. Necessary debug information such as register information, stack information, memory data, etc. is obtained by the debug command. Since the FT server 10 is separated into two systems that operate independently after the synchronization is released, the OS and running processes are not aware that only one system is being operated. In other words, the user can extract data for analysis and investigation without being visible to the OS and running processes. After the user has finished debugging, the system 0 that continued to operate for business processing becomes the master, and the system 1 that was used for debugging is incorporated, and the synchronization state can be restored.
[0026] Next, the above-described flow of transition from the synchronized state to the desynchronized state and return to the synchronized state will be described in detail with reference to Fig. 3. Fig. 3 is a flowchart of setting a breakpoint according to an embodiment of the present invention.
[0027] An overview of Figure 3 is as follows. The user sets a breakpoint that will trigger debugging. A breakpoint is set by rewriting instructions in a relevant memory to instructions that will cause a breakpoint exception. As shown in Figure 3, when implementing the debugging method according to the embodiment of the present invention in the FT server 10, when rewriting instructions in memory, only the memory in one system is rewritten. Also, when the contents of memory are written to disk by paging out, a check is made to see if the memories in both systems match, so it is necessary to suppress paging out for pages with mismatched contents.
[0028] The specific procedure shown in FIG. 3 is as follows. In step S11, a page having an instruction to set a breakpoint is paged in. For example, a program part of a predetermined unit including an instruction to set a breakpoint in the business AP to be debugged is read from a disk to a memory. The instruction to set a breakpoint is instructed, for example, by a user using the debug terminal 12. The other processes of steps S11 to S15 may be executed, for example, by the setting unit 110 of the debugging device 100 in FIG. 1. When paging in, a debug area is loaded into a certain page (here, page with page number 0) of the memory of each system (FIG. 4). That is, in FIG. 4, a page having an instruction to set a breakpoint is loaded as a debug area into page with page number 0 of the memory of each of systems 0 and 1. Next, in step S12, a page having an instruction to set a breakpoint is locked in memory. For example, a general OS function (API) such as API mlock of the Linux (registered trademark) OS is used to lock the target memory area (FIG. 5). That is, the page with page number 0 of the memory of each of systems 0 and 1 is locked. After that, in step S13, system operation is stopped in both systems, and the duplex state is released. That is, the synchronization of the memories of both systems is released by the FT server (FIG. 6). In this state where synchronization is released, in step S14, the instructions at the address where the breakpoint is set only in system 1 are rewritten. That is, only the instructions in the memory of system 1 where debugging is performed are rewritten (FIG. 7). After the rewriting, in step S15, duplex is restored and system operation is resumed. That is, the synchronized state is restored (FIG. 8). In this state, the contents of the memories of both systems do not match, but because the memories are locked and page-out is suppressed, the memory mismatch is not detected by the OS.
[0029] Next, the process from debugging in the FT server 10 to recovery will be described. After the procedure shown in FIG. 3 is performed, for example, the business AP to be debugged is run in the FT server 10. In step S21 of FIG. 9, a breakpoint exception occurs only in the system 1, and the exception handler (exception processing unit 120 in FIG. 1) starts running. After the breakpoint exception occurs, in step S22, the synchronization between the systems 0 and 1 is released. That is, the exception handler disconnects the system 1, and only the system 0 continues to operate. In step S23, the switch connecting the debug port and the debug terminal 12 is connected to the system 1, and control is transferred to the debug terminal 12. In step S24, a debug command is received from the debug terminal 12, and debug information such as register, stack, and memory information is obtained. As a result, the user obtains necessary debug information such as register information, stack information, and memory data by the debug command. The system 0 continues to operate the business AP. After debugging is completed, in step S25, only the system 1 used for debugging is reset or powered off, thereby clearing the memory information of the system 1, etc. Thereafter, in step S26, system 0, which continues to operate and continue business, becomes the master, and system 1, which was used for debugging, is incorporated. Steps S25 and S26 may be performed by the user individually inputting commands, or the debugging device 100 in FIG. 1 may further include a recovery processing unit (not shown), and the user may use a command to cause the recovery processing unit to execute steps S25 and S26. In step S27, systems 0 and 1 are synchronized to continue business. This causes the FT server 10 to return to duplexing.
[0030] As described above, when a user debugs on the FT server, the FT server follows commands from the debugging terminal to rewrite instructions in memory only on the system being debugged to generate a breakpoint, and also suppresses page-outs so that memory inconsistencies between the two systems are not detected by page-outs. When a breakpoint exception occurs for debugging and the exception handler begins execution, the FT server releases synchronization between the two systems and automatically cancels the lockstep function. This allows the user to independently use only the system on which the breakpoint was set to collect fault information, while the other system can continue operations without being affected by debugging.
[0031] As described above, the user can continue running business APs on one side of the FT server while stopping them at a breakpoint on the other side to obtain necessary debug information such as register information, stack information, and memory data. In this case, the FT server's feature of being able to separate the processor and memory into two systems that can be desynchronized and run independently is utilized, so the fact that only one system is being operated is not noticeable to the OS or running processes. In other words, data for analysis or investigation can be extracted without being seen by the OS or running processes.
[0032] Next, another embodiment of the present invention will be described with reference to Fig. 10. The synchronized state shown on the left side of Fig. 10 is the same as the synchronized state shown on the left side of Fig. 2. In the desynchronized state shown on the right side of Fig. 2, the OS operates separately as OS#1 and OS#2, and the duplication of IO module 0 (NIC0, disk 0) and IO module 1 (NIC1, disk 1) remains the same, but in the desynchronized state shown on the right side of Fig. 10, all systems, including the IO modules, are separated.
[0033] By intentionally disabling the synchronization of an FT server, the server can be split into two systems (system 0 and system 1) that operate independently, and while synchronization is disabled, separate tasks can be carried out on system 0 and system 1. In addition, when isolating one system (disabling synchronization), the user can obtain all of the data for that system by detaching everything, including the IO module.
[0034] After releasing the synchronization, the user connects a debugging terminal to debug port 1', which is the debug port of the system used for debugging, and obtains necessary debugging information such as register information, stack information, memory data, etc. using debug commands.
[0035] The OS has two paths to the IO modules, and if one of them fails, the bus is disconnected and operations continue on the other bus. Therefore, although the degeneration of the IO module is visible from the operational system, both IO modules before disconnection are in a duplicated state and operate exactly the same, so even after disconnecting one system, it is possible to continue operations on the other system while debugging the entire IO module of the disconnected system.
[0036] After debugging is completed, the FT server makes system 0, which had been continuing operations, the master and incorporates system 1, which was used for debugging, and returns to a synchronized state.
[0037] As mentioned above, when isolating one system (de-synchronization), by isolating everything including the input / output (IO) module, the user can obtain all of the data of the system. The OS has paths to two IO modules, and if a problem occurs on one of them, that bus is isolated and operations continue on the other bus. Therefore, unlike the above, the degeneration of the IO module is recognized from the operational system. Note that both IO modules are in a duplicated state before isolation and operate in exactly the same way, so even after isolating one system, it is possible to continue operations on the other system while debugging the entire IO module of the isolated system.
[0038] The process of the above-mentioned computer system is stored in a computer-readable recording medium in the form of a program, and the above-mentioned process is performed by the computer reading and executing this program. Here, the computer-readable recording medium refers to a magnetic disk, a magneto-optical disk, a CD-ROM, a DVD-ROM, a semiconductor memory, etc. Also, the computer program may be distributed to a computer via a communication line, and the computer that receives the program may execute the program.
[0039] The above program may also be transmitted from a computer system in which the program is stored in a storage device or the like to another computer system via a transmission medium, or by transmission waves in the transmission medium. Here, the "transmission medium" that transmits the program refers to a medium that has the function of transmitting information, such as a network (communication network) such as the Internet or a communication line (communication line) such as a telephone line. The above program may also be for realizing part of the above-mentioned functions. Furthermore, it may be a so-called difference file (difference program) that can realize the above-mentioned functions in combination with a program already recorded in the computer system. [Industrial Applicability]
[0040] The present invention can be used for debugging a system that operates synchronously. [Explanation of symbols]
[0041] 10, 20 FT Server 11 Switch 12 Debugging Terminal 100 Debugging Device 110 Setting section 120 Exception Handling
Claims
1. 1. A debugging device, comprising: a setting unit configured to read a portion of a program to be debugged, including an instruction for setting a breakpoint, in a debug area of each memory of the systems operating in synchronization with each other, and to rewrite the instruction in a system used for debugging among the systems operating in synchronization with each other with a breakpoint instruction, thereby suppressing a page-out of the debug area; an exception handler configured to desynchronize the synchronously operating systems when a breakpoint exception occurs; A debugging apparatus comprising:
2. 2. The debugging device according to claim 1, wherein said exception processing section maintains duplication of input / output modules of said synchronously operating system when a breakpoint exception occurs.
3. 2. The debugging device according to claim 1, wherein said exception processing section separates input / output modules of said synchronously operating systems for each system when a breakpoint exception occurs.
4. 2. The debugging device according to claim 1, further comprising a recovery processing unit configured to, after releasing synchronization, synchronize by making a system other than the system used for debugging among the systems operating in synchronization a master and incorporating the system used for debugging.
5. 2. The debugging device according to claim 1, wherein the setting unit is controlled by a debugging terminal.
6. A fault-tolerant server; A debugging device according to any one of claims 1 to 5; A debugging system comprising:
7. 1. A debugging method, comprising: reading a portion of a program to be debugged including an instruction at which a breakpoint is set in the program to be debugged into a debug area of each memory of the systems operating in synchronization with each other, and rewriting the instruction with a breakpoint instruction in a system used for debugging among the systems operating in synchronization with each other, thereby suppressing page-out of the debug area; desynchronizing said synchronously operating systems when a breakpoint exception occurs; A debugging method having the following steps:
8. a setting unit configured to read a portion of a program to be debugged, including an instruction for setting a breakpoint, in a debug area of each memory of the systems operating in synchronization with each other, and to rewrite the instruction with a breakpoint instruction in a system used for debugging among the systems operating in synchronization with each other, thereby suppressing a page-out of the debug area; an exception handler configured to desynchronize the synchronously operating systems when a breakpoint exception occurs; A debugging program that allows a computer to function as a
Citation Information
Patent Citations
Production of carbon whisker
JP1979077725A
File rearrangement system
JP1987245445A
Backup method in fault tolerant server
JP2013206052A
Information processing device and method, and program
JP2013206061A
Monitoring system, monitoring method, program, and fault tolerant server
JP2022036778A
Cited By
Debugging support methods, fault-tolerant servers, high-availability servers, and programs
JP2026127929A
