Duplicate Stack for Asynchronous Function Debugging
Find Innovative SolutionsGenerate 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
Engineering 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
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.
2Reliability
If long stack traces are saved for every callback, then failure cause can be traced, but management overhead and cost efficiency deteriorate
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.
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
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.
Data Source
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.


