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

Not all modules were added to the modules list resulting in <unknown> stack traces #948

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sc-aki
Copy link

@sc-aki sc-aki commented Feb 8, 2024

Not all modules were added to the modules list resulting in stack traces.

The problem was that in order to a module to get added to the list, the next module needed to have a valid elf header, which is not always the case. The fixed code checks if the module names are different.

… stack traces.

The problem was that in order to a module to get added to the list, the next module needed to have a valid elf header,
which is not always the case. The fixed code checks if the module names are different.
@supervacuus supervacuus requested a review from Swatinem February 8, 2024 09:41
Copy link

codecov bot commented Feb 8, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 82.63%. Comparing base (9ea6090) to head (021d5f7).
Report is 18 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #948      +/-   ##
==========================================
- Coverage   86.53%   82.63%   -3.91%     
==========================================
  Files          40       53      +13     
  Lines        3676     7375    +3699     
  Branches        0     1188    +1188     
==========================================
+ Hits         3181     6094    +2913     
- Misses        495     1171     +676     
- Partials        0      110     +110     

Copy link
Member

@Swatinem Swatinem left a comment

Choose a reason for hiding this comment

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

I wonder if checking for the executable flag is enough here, as I would be hesitant to remove the ELF header check. Can you elaborate your issue a bit more (maybe in the private chat we shared) why exactly the previous check failed on your executable?

Comment on lines +681 to +687
if ((!last_module.file.len
&& (!module.file.len || last_module.file.len != module.file.len
|| memcmp(last_module.file.ptr, module.file.ptr,
module.file.len)))
|| (!module.file.len || last_module.file.len != module.file.len
|| memcmp(
last_module.file.ptr, module.file.ptr, module.file.len))) {
Copy link
Member

Choose a reason for hiding this comment

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

you should use !sentry__slice_eq(module.file, last_module.file) here to make this more readable.

Copy link
Author

Choose a reason for hiding this comment

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

The key here is that the ELF check must be removed. Not all memory areas are valid ELF binaries. It doesn't make sense to search for ELF header of the next memory area as a condition to add a module to the list. Quite often there's anonymous memory areas between loaded libraries, and in such case the original code doesn't work.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi @sc-aki. Can you provide an example of such a memory map (or just a few entries that visualize the problem)?

Not all memory areas are valid ELF binaries.

But do they still contain valid ELF code referenced from the stack trace?

Quite often there's anonymous memory areas between loaded libraries, and in such case the original code doesn't work.

Yes, in these cases, we would ignore that map entry. Are you saying that you have anonymous entries that contain code that your stack trace is referencing? How do you ensure the code is readable in the backend symbolication?

Wouldn't this ignore anonymous map entries as well: https://github.com/getsentry/sentry-native/blob/master/src/modulefinder/sentry_modulefinder_linux.c#L677-L681

Copy link
Collaborator

Choose a reason for hiding this comment

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

How do you ensure the code is readable in the backend symbolication?

Or is this change only meant for Android (where symbolication happens in the client)?

@getsantry
Copy link

getsantry bot commented Apr 26, 2024

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry bot added the Stale label Apr 26, 2024
@getsantry
Copy link

getsantry bot commented May 18, 2024

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

10 similar comments
@getsantry
Copy link

getsantry bot commented Jun 9, 2024

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry
Copy link

getsantry bot commented Jul 1, 2024

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry
Copy link

getsantry bot commented Jul 23, 2024

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry
Copy link

getsantry bot commented Aug 14, 2024

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry
Copy link

getsantry bot commented Sep 5, 2024

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry
Copy link

getsantry bot commented Sep 27, 2024

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry
Copy link

getsantry bot commented Oct 19, 2024

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry
Copy link

getsantry bot commented Nov 9, 2024

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry
Copy link

getsantry bot commented Dec 1, 2024

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry
Copy link

getsantry bot commented Dec 23, 2024

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants