-
-
Notifications
You must be signed in to change notification settings - Fork 171
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
Linux Module finder is broken, also crashes when creating stack trace #640
Comments
@JodiTheTigger thanks for the very detailed report! I can also try to revert back to mmap-ing as we did before, however I’m a bit hesitant as to not regress the Android use-case with loading libraries directly from |
Heya, I'm now on Christmas break, so I'll try your fixes when back after the 5th of Jan 2022. Have a happy new year! |
I can confirm that the code in #641 prevents the crashes caused by reading However, the fundamental issue that for modules without a build-id, the section headers are not read properly still exists. The end result is that the modules are not recognised, and the callstack will not have any symbols. As stated before this is due to moving to reading memory as opposed to the actual files for the section headers. I'm hardly and expert in this area, so these are only suggestions on how to possibly fix this issue. I'll happily defer to those who know more about this stuff.
|
@JodiTheTigger since I think you can reproduce this issue reliably, can you also give #642 a shot? That indeed moves back to using mmap for this, and shoud still work for the android usecase. |
Ok, done and tested, comment left on the MR (tl;dr: doesn't work as file mappings are larger than file mapped (wtf?), so mmaped files are ignored) |
Ok, I tested the code that was merged to master, and I believe it fixes my issues as described in my comment on the MR of #642 Fee free to close |
🎉 @JodiTheTigger Thank you very much for the detailed report, and testing the fixes! |
Description
Crashes in
get_code_id_from_text_fallback
whensentry_value_new_stacktrace(nullptr, 0)
is calledBut also, whenever a debug symbol hash is calculated for any module that doesn't have a build-id
Caused by #431
Fundamental cause of this issue, is that a module is read from memory, instead of from the actual file (pre #431), and the mapped memory does not point to the assumed data. The crash happens when the offset for the section headers just happens to match one of the section's mappings in the module itself, so rubbish data is loaded.
This is exactly as the pre #431 code warned:
sentry_modulefinder_linux.c
get_code_id_from_text_fallback
When does the problem happen
Environment
-DSENTRY_BACKEND=crashpad
)Steps To Reproduce
random, as dependent on loaded modules not having a build-id, and if their elf section headers overlap with one of their internal elf section file mappings
The text was updated successfully, but these errors were encountered: