Hot Software Fix via Dynamic Linking and Jump Operators
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing software fixes require termination or suspension of application execution, especially problematic for 24/7 available systems like database servers, as they necessitate re-compiling and re-linking all affected components, which is inefficient and disruptive.
Innovation Solution
A system that converts internal references to external imported references, generates a header file, and compiles only the source code section with the fix, allowing for application of the software fix without suspension by using thread-local storage and modifying the binary code with jump operators, enabling application and removal without interrupting the running application.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If conventional software fix methods are used (re-compiling and re-linking all affected components), then the software error is corrected, but the application execution must be terminated or suspended
Solution Approach 1:
The patent segments the software fix into a separate dynamically linkable library (DLL) that can be independently compiled and loaded. Only the specific components containing the error are fixed and placed in the DLL, while the rest of the application continues to run using the original components. This segmentation allows the fix to be applied without terminating the application.
Solution Approach 2:
The patent performs preliminary actions by pre-compiling the fixed components into a separate DLL library before the application needs the fix. The DLL is prepared in advance with the corrected code, so when the fix is needed, it can be loaded dynamically without interrupting the running application. This preliminary preparation enables hot-fixing capability.
2Reliability
If all affected software application components are re-compiled and re-linked, then the software fix is complete, but the process is inefficient and time-consuming
Solution Approach 1:
The patent extracts only the specific source code sections containing errors from the larger software application. Instead of re-compiling all affected components, only the necessary portions are compiled into a separate DLL. This extraction approach dramatically reduces compilation time while still providing a complete fix for the erroneous components.
Solution Approach 2:
The patent applies partial action by compiling and linking only the specific components that contain errors, rather than all affected components. The DLL contains only the necessary fixed code sections, which are then dynamically loaded into the running application. This partial approach reduces the time and resources required for the fix.
3Reliability
If the binary code of functions is modified with jump operators, then the application can use the fixed version, but the modification process must be thread-safe
Solution Approach 1:
The patent uses an intermediary approach by introducing a loading mechanism that acts as a mediator between the original application code and the fixed DLL. The system modifies binary code to include jump operators that redirect to the DLL, but this modification is performed through a controlled loading process that ensures thread-safety. The intermediary loading mechanism coordinates the redirection to prevent race conditions.
Solution Approach 2:
The patent performs preliminary thread-safety checks and preparations before modifying binary code with jump operators. The system ensures that the redirection mechanism is thread-safe by implementing proper synchronization and atomic operations during the loading process. This preliminary preparation of the redirection mechanism ensures that multiple threads can safely access the fixed functions without conflicts.
Data Source
AI summary
Embodiments of the present disclosure involve a method for creating, applying, and removing a software fix for an application without terminating the application. To create the fix, the system converts an unresolved internal reference in a source code section to an external imported reference, generates a header file which includes a re-definition of the external imported reference, and generates a binary representation for the fix by compiling the source code section using the generated header file and linking the complied object. To apply the fix, the system loads the binary representation into a virtual address space, places a long jump operator in a compiler-generated padding prior to the start of an affected function, and replaces a no-operation prologue at the start of the function with a short jump operator in an atomic write operation. To remove the fix, the system replaces the short jump operator with the no-operation prologue, removes the long jump operator, and unloads the software fix.


