Dynamic Binary Translation Signal Handling

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing methods for running non-native binaries on host computer systems face challenges in signal handling due to differences in memory maps and execution states between architectures, leading to incorrect execution when signals are delivered during dynamic binary translation.

Innovation Solution

A method that translates guest executable binaries into translated executable binaries, defers signal handling until a safe point is reached, and uses a signal queue to ensure correct signal handling and execution context, allowing guest signal handlers to process signals correctly.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Speed

If signals are handled immediately when delivered during dynamic binary translation, then signal response time is improved, but execution correctness deteriorates due to incorrect execution state

Engineering Contradiction:
Improvesignal response timeVSAvoidexecution correctness
Core Design Contradiction:
SpeedVSReliability

Solution Approach 1:

The patent applies preliminary action by pre-identifying and marking safe points in the translated code where execution state is guaranteed to be correct. These safe points are determined during code translation before runtime signal handling occurs. When a signal is delivered, the system checks if the current location is a safe point; if not, execution is deferred to the next safe point, ensuring correctness while maintaining efficient signal handling.

Inventive Principle:
Principle #10Preliminary action

2Device complexity

If host signal handlers are used directly, then signal handling simplicity is improved, but compatibility with guest architecture deteriorates due to different memory maps

Engineering Contradiction:
Improvesignal handling complexityVSAvoidarchitecture compatibility
Core Design Contradiction:
Device complexityVSAdaptability or versatility

Solution Approach 1:

The patent introduces an intermediary mechanism - a translation layer that converts host signal handler calls into guest architecture-compatible operations. This intermediary translates memory addresses, register states, and control flow between host and guest architectures, allowing the use of simple host signal handlers while maintaining full compatibility with guest architecture conventions through automatic address space translation and context management.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Manufacturing precision

If multiple host instructions are used to emulate one guest instruction, then translation accuracy is improved, but execution efficiency deteriorates

Engineering Contradiction:
Improvetranslation accuracyVSAvoidexecution efficiency
Core Design Contradiction:
Manufacturing precisionVSProductivity

Solution Approach 1:

The patent applies segmentation by dividing the translation process into basic blocks - sequences of guest instructions that translate cleanly to sequences of host instructions with well-defined entry and exit points. Safe points are established at block boundaries where execution state is guaranteed to be correct. This segmentation allows accurate translation while enabling optimization opportunities, as entire basic blocks can be executed without intermediate signal handling interruptions.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS8473930B2Handling signals and exceptions in a dynamic translation environment
Publication Date: 2013.06.25 ORACLE AMERICAN INC
  • US8473930B2 patent drawing
  • US8473930B2 patent drawing
  • US8473930B2 patent drawing

AI summary

A method for executing non-native binaries on a host computer architecture comprises receiving the guest executable binary into a computer readable medium. The guest executable binary is executed on the host computer architecture by translating the guest executable binary into a translated executable binary. Each instruction of the translated executed binary is then executed on the host computer architecture. Signals are responded to by placing signal information on a signal queue and deferring signal handling until a safe point is reached. A computer system implementing the method is also provided.