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

fix: Fetch ELF debug files as well just to be safe if it is a Windows minidump #555

Merged
merged 10 commits into from
Sep 20, 2021

Conversation

relaxolotl
Copy link
Contributor

@relaxolotl relaxolotl commented Sep 14, 2021

A first shot at fixing a regression where we're no longer fetching
ELF DIFs for minidumps generated on Windows, likely caused by
#414.

Symbolicator now requests all known debug file types when encountering a minidump generated by a native executable. This means that minidumps produced by PEs, Machos and ELFs will trigger a search for PDBs, dSYMs, and ELFs if possible.

} else {
None
};

Copy link
Contributor

Choose a reason for hiding this comment

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

i fear this is the wrong place to fix this up, i expect it should be fixed in whoever calls this function to pass the right slice of FileTypes. but still looking for all the places where this could be caused

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In that case I think https://github.com/getsentry/symbolicator/blob/master/crates/symbolicator/src/services/symbolication.rs#L1716 might also be an option. This is assuming we're only seeing this issue with minidumps, though.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think so, MinidumpState::object_type is only used in

let object_type = minidump_state.object_type();
which is not used in any code paths ending up calling .list_files(). The other location is the one which ends up being used in .list_files().

@relaxolotl
Copy link
Contributor Author

relaxolotl commented Sep 17, 2021

there are a few integration tests left that i need to update and the changes required for those are enough of a rat's nest that i'm going to put them off until tomorrow

Copy link
Contributor

@flub flub left a comment

Choose a reason for hiding this comment

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

oh no, forgot that this would affect snapshots... but lgtm

ObjectType::Macho => &[FileType::MachDebug, FileType::MachCode, FileType::Breakpad],
ObjectType::Pe => &[FileType::Pdb, FileType::Pe, FileType::Breakpad],
ObjectType::Elf => &[FileType::ElfDebug, FileType::ElfCode, FileType::Breakpad],
// There are instances where applications have been cross-compiled for some target
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// There are instances where applications have been cross-compiled for some target
// There are instances where applications have been compiled for some target

I don't think we can claim this is cross-compiling

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed 👍

@relaxolotl relaxolotl marked this pull request as ready for review September 18, 2021 03:51
@relaxolotl relaxolotl requested a review from a team September 18, 2021 03:51
@github-actions
Copy link
Contributor

github-actions bot commented Sep 18, 2021

Warnings
⚠️ Snapshot changes likely affect Sentry tests. Please check the symbolicator test suite in Sentry and update snapshots as needed.
Instructions for snapshot changes

Sentry runs a symbolicator integration test suite located at tests/symbolicator/. Changes in this PR will likely result in snapshot diffs in Sentry, which will break the master branch and in-progress PRs.

Follow these steps to update snapshots in Sentry:

  1. Check out latest Sentry master and enable the virtualenv.
  2. Stop the symbolicator devservice using sentry devservices down symbolicator.
  3. Run your development symbolicator on port 3021.
  4. Export SENTRY_SNAPSHOTS_WRITEBACK=1 and run symbolicator tests with pytest.
  5. Review snapshot changes locally, then create a PR to Sentry.
  6. Merge the Symbolicator PR, then merge the Sentry PR.

Generated by 🚫 dangerJS against bd7955d

@@ -195,19 +218,12 @@ def _make_error_result(download_error, source="microsoft", bucket_type="http"):
"source": source,
},
]
if bucket_type != "http":
Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed this because i fixed an error where i'd incorrectly left out the layout field on the non-http sources in the permissions tests, causing them to include dSYMs in their output.

"location": "http://127.0.0.1:1234/msdl/wkernel32.pdb/FF9F9F7841DB88F0CDEDA9E1E9BFF3B51/wkernel32.pd_",
"source": "microsoft",

def _make_successful_result(filtered=False):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

would recommend hiding whitespace changes for this block

@relaxolotl
Copy link
Contributor Author

i fixed the integration tests but my attempts to update snapshots in sentry has left them in pretty bad shape. those will have to be double checked before merging this PR in, but i think the changes here should be good.

Copy link
Contributor

@flub flub left a comment

Choose a reason for hiding this comment

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

lgtm i think but this will probably need snapshot updates in the sentry repo as well. We used to commit the two changes close together but are no longer allowed to break master and i don't know what we're doing about this currently. i'll try and find out

@relaxolotl
Copy link
Contributor Author

based on the CI results it looks like sentry doesn't need updating. i think we can infer based off of that that we can leave sentry as is and this should be safe to merge in without changes to that repo. i (and floris) did run some tests locally to be safe, and the results of those tests support the conclusion that no snapshot updates are needed in sentry.

@relaxolotl relaxolotl merged commit 016adba into master Sep 20, 2021
@relaxolotl relaxolotl deleted the fix/windows-debug-sources branch September 20, 2021 16:20
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.

2 participants