Repository navigation
Conversation
Signed-off-by: Lixin Wei <wlx65005@gmail.com>
lixin-wei
force-pushed
the
fix/trace-writer-stack-reconstruction
branch
from
September 24, 2026 14:26
1820c49 to
4e4b3a2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
hi, thank you for making such an amazing tool! I really enjoy using it!
today I met an issue and fixed it using AI. I wonder whether I fix it the right way? would be grateful if you can have a look, thanks!
summary
Magic-trace could build an invalid call stack when optimized code jumped back to an existing caller: it left the current frame open and added a duplicate caller frame. It could also emit the first traced function before its inferred callers, putting begin events in the wrong order. These errors made some scopes appear to run until the trace ended.
The trace writer now treats a jump to an existing caller as a return and defers the first frame’s begin event until inferred callers are emitted. The change includes regression tests, updated expected traces, and the C++ link flag needed for the native build.
effect
before fix:

after fix:
