Duplicate Stack for Asynchronous Function Debugging

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Debugging asynchronous functions in computer systems is challenging due to the difficulty in determining the cause of failures, as existing methods like long stack traces are inefficient and do not provide an integrated runtime stack for debugging.

Innovation Solution

Implementing a method that copies active stack frames of the runtime stack and stores them as a duplicate stack when an asynchronous function is invoked, allowing for the capture of invocation context information and providing extended stack tracing capabilities.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Loss of information

If long stack traces are employed to debug asynchronous functions, then debugging information is provided, but memory consumption increases and efficiency decreases

Engineering Contradiction:
Improvedebugging informationVSAvoidmemory consumption
Core Design Contradiction:
Loss of informationVSLoss of energy

Solution Approach 1:

The patent creates a duplicate stack that copies only the relevant active stack frames from the original runtime stack when an asynchronous function is invoked. This selective copying provides necessary debugging information while consuming significantly less memory than storing complete long stack traces for every callback.

Inventive Principle:
Principle #26Copying

2Reliability

If long stack traces are saved for every callback, then failure cause can be traced, but management overhead and cost efficiency deteriorate

Engineering Contradiction:
Improvefailure tracing capabilityVSAvoidmanagement overhead
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent extracts only the relevant active stack frames from the complete runtime stack at the moment of asynchronous function invocation. This extraction provides sufficient information for failure tracing while eliminating the overhead of managing complete stack traces, reducing memory management complexity and improving cost efficiency.

Inventive Principle:
Principle #2Taking out (Extraction)

3Ease of operation

If traditional stack trace methods are used, then simple function calls are traced, but integrated runtime stack for debugging is not provided

Engineering Contradiction:
Improvedebugging capabilityVSAvoidinvocation context information
Core Design Contradiction:
Ease of operationVSLoss of information

Solution Approach 1:

The patent performs preliminary action by capturing and storing the active stack frames at the moment of asynchronous function invocation, before the function executes. This preserves the invocation context information including the calling function's stack state, providing an integrated runtime stack view that enables effective debugging of asynchronous failures.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS10997057B2Debugging asynchronous functions
Publication Date: 2021.05.04 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US10997057B2 patent drawing
  • US10997057B2 patent drawing
  • US10997057B2 patent drawing

AI summary

A method for debugging asynchronous functions in a computer system that implements a runtime stack when executing a program includes, in response to an asynchronous called function being invoked by a calling function of a first execution thread, copying active stack frames of the runtime stack and storing the copied active stack frames as a duplicate stack.