-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
feat(minidump): Support CFI for minidumps #9344
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
Merged
Merged
Conversation
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
79e1afb to
fced113
Compare
d865a16 to
b550e0b
Compare
fd7dd9b to
3251660
Compare
Member
Author
|
@mitsuhiko This is ready for review now. |
mitsuhiko
reviewed
Oct 29, 2018
mitsuhiko
approved these changes
Oct 30, 2018
Contributor
|
lgtm but it comes with a disclaimer: this will likely generate new groups for some customers. Since the current issues are not grouping well anyways I do not expect this to be an issue but I would propose we watch the graphs as the deploy goes out to see what happens. |
4925a51 to
8871539
Compare
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This PR introduces CFI into the native processing pipeline. It builds on previous PRs that have refactored debug symbol handling (#10052) and introduced CFI caching (#10161).
Frame Interface
Stack frames now have an optional
trustfield. The value of this field is unstructured and depends on the event platform. For minidump events, this field holds the values of theFrameTrustenum, as exported by symbolic:cfi,cfi-scan,context,fp,none,prewalked,scan.The trust level can be used to infer whether stack traces need CFI (
noneandscan) or whether stack traces have been walked with CFI (cfiandcfi-scan).Plugin Interface
The minidump needs to be stackwalked with CFI before the stacktrace processors run during event processing. The current order is:
plugin.get_stacktrace_processors()plugin.get_event_preprocessors()(which are, really, event processors)This required to introduce a new hook -- for now internal -- with the same interface as event processors. It is called:
plugin.get_event_enhancers. The purpose of an enhancer is to add useful information before processing actually starts, that is subsequently available to all processors and also the stacktrace processing step. Their interface is identical to event processors:Conditions
CFI is only applied if all of the following conditions are met (checked in that order):
mechanism.type: "minidump"setCaching
We cache entire stack traces. The cache key is computed by hashing the following value for each frame:
(module.debug_id, frame.relative_address)None. (Only the absolute instruction address is known, and that changes potentially with every execution)Once a stacktrace has been reprocessed with CFI and the stack trace contains at least one frame with CFI trust, the following values are cached for each frame:
(module.debug_id, frame.relative_address, frame.trust)(None, frame.absolute_address, frame.trust)When loading these traces from the cache, the relative addresses are again rebased to the new image addresses from the event to form a new stack trace. If a module is not found in the new event, or only an absolute address was stored, the address is used directly without rebasing.
If the reprocessed stack trace does not contain CFI frames, indicating that no CFI could be applied during reprocessing, a marker
"__no_cfi__"is stored in the cache instead of the above frames. In that case, the original raw stack trace is not touched. This speeds up restoration when loading from the cache and avoids the hack with absolute addresses.Matching Threads
If a minidump needs to be reprocessed, it is loaded along with all CFI caches and processed again with symbolic. Instead of transforming the entire process state into a payload, only the threads are transformed. They are matched with the original event payload via their
thread_id. It is assumed that in minidumps every thread has a unique ID.Requires getsentry/symbolic#98
Fixes #8193