Interposing Method for Dynamic Library Call Interception

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Dynamic libraries do not provide a straightforward method for intercepting and redirecting calls to specific methods at runtime, limiting the ability to modify or extend library behavior without recompiling or relinking applications.

Innovation Solution

Loading an interposing method with the same name as the original method in a dynamic library, intercepting requests, and directing the software application to either run the interposing method or the original dynamic linking method based on the method name, allowing for operations like profiling, debugging, or adding functionality.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If dynamic libraries are used to separate application distribution from library distribution, then flexibility and update capability are improved, but the ability to intercept and modify library behavior at runtime deteriorates

Engineering Contradiction:
Improveflexibility and update capabilityVSAvoidability to intercept and modify library behavior
Core Design Contradiction:
Adaptability or versatilityVSEase of operation

Solution Approach 1:

The patent introduces an interposing dynamic library that acts as an intermediary between the software application and the original dynamic library. The interposing library contains interposing methods with the same names as original methods, which intercept function calls before they reach the original library. This mediator approach allows runtime modification of library behavior while preserving the dynamic linking benefits, as the interposing library can be loaded and unloaded without recompiling the application.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Stability of the object's composition

If static libraries are used to connect applications at build time, then linking stability is improved, but the ability to update libraries without recompiling applications deteriorates

Engineering Contradiction:
Improvelinking stabilityVSAvoidability to update libraries without recompiling
Core Design Contradiction:
Stability of the object's compositionVSAdaptability or versatility

Solution Approach 1:

The patent implements dynamic loading and unloading of the interposing library at runtime, allowing the system to transition between different library implementations without recompilation. The dynamic linker loads the interposing library into the application's address space and establishes function call redirection, enabling flexible updates while maintaining stable linking relationships throughout the application's execution lifecycle.

Inventive Principle:
Principle #15Dynamics

Data Source

PatentUS20240036887A1Intercepting calls to a dynamic library
Publication Date: 2024.02.01 NVIDIA CORP
  • US20240036887A1 patent drawing
  • US20240036887A1 patent drawing
  • US20240036887A1 patent drawing

AI summary

A method, including loading, to a first address in a memory of a computer, an interposing method having an interposing name that is identical to an original name of an original method in a library of original methods that are to be dynamically loaded by a software application running on the computer, and identifying a second address in the memory of a dynamic linking method associated with the library. A request is then intercepted from the application, the request including a specified name for one of the methods in the library. When the specified name matches the interposing name, the application is directed to the first address so as to run the interposing method. However, when the specified name does not match any interposing name, the application is directed to the second address so as to run the dynamic linking method to run one of the original methods.