Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework the symcache writer for correctness #648

Merged
merged 2 commits into from
Aug 3, 2022

Conversation

mstange
Copy link
Contributor

@mstange mstange commented Aug 3, 2022

This fixes #646 and #647. I think it's also simpler; we iterate over the inlinees twice, but at least the responsibility of who inserts what range is clear now.
Overall it's about 50 more lines of code, but those extra lines are just comments.

Commit message for the squashed commit:

fix(symcache): Rework the symcache writer for correctness

This commit also reverts the public API
`SymCacheConverter::process_symbolic_function` back to its 9.0.0 signature.

Fixes #646.
Fixes #647.

Before this fix, for each function in the inlinee tree we inserted an entry
into `self.ranges` for every line address. These entries were overwritten
repeatedly as we descendent into the inlinees.
Now we just insert entries for address ranges which are not covered by
the function's inlinees. And we no longer insert entries for "parent lines"
from within a callee; every function only inserts its own lines and knows
where to split.

@mstange mstange requested a review from a team August 3, 2022 00:19
@mstange mstange force-pushed the symcache-writer-rework branch 2 times, most recently from 8c5b278 to 1275d64 Compare August 3, 2022 02:46
This commit also reverts the public API
`SymCacheConverter::process_symbolic_function` back to its 9.0.0 signature.

Fixes getsentry#646.
Fixes getsentry#647.

Before this fix, for each function in the inlinee tree we inserted an entry
into `self.ranges` for every line address. These entries were overwritten
repeatedly as we descendent into the inlinees.
Now we just insert entries for address ranges which are not covered by
the function's inlinees. And we no longer insert entries for "parent lines"
from within a callee; every function only inserts its own lines and knows
where to split.
@mstange mstange force-pushed the symcache-writer-rework branch from 1275d64 to 87033c5 Compare August 3, 2022 03:13
Comment on lines +197 to +198
// (1) Instructions which are part of an inlined function call, and
// (2) instructions which are *not* part of an inlined function call.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the "part of" might be a bit confusing here.
maybe:

(1) Instructions which are in the middle of an inlined call chain, and
(2) instructions which do not have further callees.

That’s not too good of an explanation either though :-D

@Swatinem Swatinem merged commit d5a5c55 into getsentry:master Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Duplicate frames in symcache lookup
2 participants