Skip to content

Fix test flakiness on Linux#196

Open
schopin-mozilla wants to merge 4 commits into
rust-minidump:mainfrom
schopin-mozilla:stack-ip-soft-errors
Open

Fix test flakiness on Linux#196
schopin-mozilla wants to merge 4 commits into
rust-minidump:mainfrom
schopin-mozilla:stack-ip-soft-errors

Conversation

@schopin-mozilla

Copy link
Copy Markdown

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.
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.

1 participant