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

Minidumps without the main program mapping are created if the main program is missing a build id #122

Open
afranchuk opened this issue May 30, 2024 · 1 comment

Comments

@afranchuk
Copy link
Contributor

afranchuk commented May 30, 2024

As a result of https://bugzilla.mozilla.org/show_bug.cgi?id=1676109, any mappings without a build id are removed from the minidump. This behavior isn't great: if the main program doesn't have a build id, it will be removed, which invalidates assumptions in e.g. the minidump crate that the main module is the first mapping. I think at the time the assumption was that sane toolchains should always add build ids nowadays. I found this because the android linker does not (at least not when invoked by cargo)!

I would argue that the main module should never be removed. One could also argue that other modules shouldn't be removed either: the original bug had to do with saving space from "useless" mappings, however nowadays we do more with the mappings than just checking module versions/debug info. For instance, we use mappings to determine whether memory accesses would have been valid or not at crash time.

Furthermore, I think that the decision to remove such mappings should at least rest with the user of the crate, instead of being baked-in.

@gabrielesvelto
Copy link
Contributor

Yes, that's a good idea, and I suppose we could tweak the stack walker to react properly to these mappings (e.g. refuse to unwind through a mapped file which is not executable). With the old stack walker we'd happily unwind through those mappings, yielding some absolutely garbage stacks.

We now also have the list of file descriptors in a stream, so we can certainly build more synergies between that and the non-executable file mappings.

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

No branches or pull requests

2 participants