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(debuginfo): Avoid infinite recursion because of self references #202

Merged
merged 2 commits into from
Apr 1, 2020

Conversation

calixteman
Copy link
Contributor

No description provided.

@calixteman calixteman requested a review from a team April 1, 2020 08:31
Copy link
Member

@jan-auer jan-auer left a comment

Choose a reason for hiding this comment

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

Good catch, thanks! Confirming one point in the comment below.

{
ref_unit.resolve_function_name(ref_entry)
} else {
Err(DwarfErrorKind::SelfReference.into())
Copy link
Member

Choose a reason for hiding this comment

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

Just to confirm, are you sure you don't just want to return Ok(None) here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Or maybe just return an Option instead of a Result since resolve_function_name is only used in functions() and remove the ok().flatten(). I can do that in a follow-up PR. Wdyt ?

Copy link
Member

Choose a reason for hiding this comment

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

I'd keep the result if the Dwarf is really invalid (used in resolve_reference). But it's already a Result<Option<_>>, so just returning Ok(None) here should be the ideal compromise imho.

@jan-auer jan-auer changed the title [debuginfo] Avoid infinite recursion because of self references fix(debuginfo): Avoid infinite recursion because of self references Apr 1, 2020
@jan-auer jan-auer merged commit fd22b1a into getsentry:master Apr 1, 2020
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