8000 Fix test flakiness on Linux by schopin-mozilla · Pull Request #196 · rust-minidump/minidump-writer · GitHub
[go: up one dir, main page]

Skip to content

Fix test flakiness on Linux - #196

Merged
marti4d merged 4 commits into
rust-minidump:mainfrom
schopin-mozilla:stack-ip-soft-errors
Aug 17, 2026
Merged

marti4d merged 4 commits into
rust-minidump:mainfrom
schopin-mozilla:stack-ip-soft-errors

Conversation

@schopin-mozilla
Copy link
Copy Markdown
Collaborator

Some of our tests build crash contexts for the parent process, to then write the minidump for a child process. Most of the time, the instruction and stack pointers will just point to unmapped memory, which is just silently ignored, but because of ASLR the memory layouts are random and it happens that sometimes they point to mapped but unreadable memory, leading to hard errors.

This branch addresses the issue on both ends: we build a zeroed out crash context (at least we know how it's invalid), and we also use soft errors rather than hard ones to be consistent with the unmapped experience.

FWIW, the unreadable case happens pretty frequently on Android ARM64 for some reason.

Building a crash context from the current process and passing it to a
writer that dumps *another* process is bound to cause issues. Using
stable data, even if invalid, make the tests more predictable -> less
flaky.
Up until now, getting a stack pointer to unmapped memory would just
silently be ignored and result in an empty stack. This should probably
be recorded instead.
If the stack pointer is garbage, it could point to a
valid-but-unreadable mapping. Since we already ignore and move on if
it points to unmapped memory, let's do the same in this case.
Similarly to stack pointers, garbage IP pointer could potentially point to an
unreadable memory mapping rather than just unmapped memory. In that
case, let's log and move on.
@marti4d marti4d left a comment
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Awesome! Glad to see tests got added for this stuff, and thanks for breaking it apart into those 4 commits -- Was much easier to review than the whole thing at once.

I'll merge this in now :)

@marti4d
marti4d merged commit 6861725 into rust-minidump:main Aug 17, 2026
16 checks passed
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

0