Hybrid Managed Unmanaged Data Model Execution Engine
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing systems struggle to execute applications containing both managed and unmanaged code effectively, as unmanaged code lacks memory safety, and sandboxed execution prevents interaction with natively compiled unmanaged code.
Innovation Solution
A hybrid execution environment is introduced, where data objects can exist in either a Managed State or an Unmanaged State. When an object is passed to non-sandboxed native code, it is transformed from the Managed State to the Unmanaged State, allowing interaction with native unmanaged code while maintaining memory safety in the Managed State.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If unmanaged code is executed with sandboxed execution to provide memory safety, then memory safety is improved, but the ability to interact with natively compiled unmanaged code deteriorates
Solution Approach 1:
The patent introduces a runtime environment as an intermediary layer between managed and unmanaged code. This runtime provides a hybrid execution model where objects can be allocated in managed memory (providing memory safety) but accessed by unmanaged code through a controlled interface. The runtime mediates the interaction by translating managed object references into unmanaged memory addresses when needed, enabling interoperability without compromising the memory safety guarantees of the managed environment.
Solution Approach 2:
The patent segments the execution environment into distinct managed and unmanaged execution contexts. Managed code executes with full memory safety checks, while unmanaged code executes in a controlled sandbox. Objects can exist in either execution context or transition between them. This segmentation allows each code type to execute with appropriate safety guarantees while maintaining the ability to interact when necessary.
2Reliability
If managed code is used to provide memory safety for all code execution, then memory safety is improved, but the ability to execute legacy unmanaged code deteriorates
Solution Approach 1:
The patent implements a dynamic execution model where the execution context of code can change at runtime. Unmanaged code can be dynamically transitioned into a sandboxed managed execution context when memory safety is required, while managed code can access unmanaged resources when needed. This dynamic context switching allows legacy unmanaged code to execute with modern memory safety guarantees without requiring a complete rewrite.
Solution Approach 2:
The patent changes the execution parameters of unmanaged code by running it within a controlled runtime environment that provides memory safety guarantees. The runtime modifies memory access patterns, allocation behaviors, and execution contexts to ensure that even unmanaged code benefits from managed memory safety features while maintaining compatibility with legacy codebases.
3Difficulty of detecting and measuring
If runtime checks are inserted to catch memory violations, then detection capability is improved, but the precision and reliability of security vulnerability detection deteriorates
Solution Approach 1:
The patent replaces mechanical runtime checks with a fundamental change in the memory model. Instead of checking memory access validity at runtime, the system uses a hybrid memory model where managed memory allocations inherently provide safety guarantees. The runtime environment manages memory permissions and access rights at a lower level, eliminating the need for imprecise runtime checks while maintaining strong detection and prevention capabilities.
Data Source
AI summary
A computer comprising processors and memory may implement an application execution engine to execute an application including both managed code and unmanaged code, the managed code providing memory safety for accesses to objects in memory and the unmanaged code providing no such safety. Responsive to a request from managed code, the application execution engine allocates memory for an object in a managed pool and the object is accessible to managed code in a managed state. Responsive to a requirement for unmanaged code to access the managed object, the application execution engine transforms the object to be accessible in an unmanaged state, the transformation including allocating memory for the object in an unmanaged pool, copying data from managed memory to unmanaged memory according to a predetermined unmanaged layout, releasing the managed memory and using an address of the unmanaged memory to access the object in the unmanaged state.


