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

TODO: Write instruction_addr_heuristics RFC #42

Closed
Swatinem opened this issue Dec 6, 2022 · 1 comment
Closed

TODO: Write instruction_addr_heuristics RFC #42

Swatinem opened this issue Dec 6, 2022 · 1 comment

Comments

@Swatinem
Copy link
Member

Swatinem commented Dec 6, 2022

We currently have some heuristics in symbolicator (and some even in SDKs) that adjust stack frames.

The intention is that depending on the platform, a call / bl instruction will always push the following return address on the stack or into the lr register.
In symbolicator, we then go to the previous instruction which should land us back at the call / bl.

This heuristic is not applied to the very first frame, as we assume the first frame points to the actual crashing instruction (eg a mov that tries to access invalid memory)

However we don’t know at processing time if the first address is a crashing instruction or a return address that needs to be adjusted. In particular if SDKs truncate the top of the stack trace to throw away implementation details of the stack walking implementation itself.

This also does not work for profiling, which will index/deduplicate all the stack frames into a single large list, and the notion of what is the "top" frame is completely lost.

@mitsuhiko proposed to introduce a new instruction_addr_heuristics property on stack traces with the following options:

  • all always use the previous instruction
  • none do not adjust the instructions at all
  • all_but_first adjust all but the first frame
  • magic (current behavior) try to infer if we need adjustment for the first frame or not
@Swatinem
Copy link
Member Author

Swatinem commented Dec 7, 2022

RFC is here: #43
I also chose to slightly rename the proposed attr and values

@Swatinem Swatinem closed this as completed Dec 7, 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

No branches or pull requests

1 participant