Repository navigation
Conversation
G36maid
added a commit
that referenced
this pull request
May 16, 2026
…k logging, procfs test - Use getcontext() instead of zeroed ucontext in tests (Finding rust-minidump#3) so register extraction is actually tested with non-zero values. - Assert exception thread_id exists in thread list (Finding rust-minidump#2) to catch orphaned exception references. - Store mapping names as OsString instead of String (Finding rust-minidump#5) to preserve non-UTF-8 paths until lossy conversion at write time, matching Linux implementation. - Log stack copy failures instead of silently ignoring (Finding rust-minidump#4) with log::warn for both crash and non-crash thread paths. - Make handle_data_stream test procfs-aware (Finding #1) so it doesn't silently pass when /proc/<pid>/fd is absent.
G36maid
added a commit
that referenced
this pull request
May 16, 2026
…k logging, procfs test - Use getcontext() instead of zeroed ucontext in tests (Finding rust-minidump#3) so register extraction is actually tested with non-zero values. - Assert exception thread_id exists in thread list (Finding rust-minidump#2) to catch orphaned exception references. - Store mapping names as OsString instead of String (Finding rust-minidump#5) to preserve non-UTF-8 paths until lossy conversion at write time, matching Linux implementation. - Log stack copy failures instead of silently ignoring (Finding rust-minidump#4) with log::warn for both crash and non-crash thread paths. - Make handle_data_stream test procfs-aware (Finding #1) so it doesn't silently pass when /proc/<pid>/fd is absent.
G36maid
force-pushed
the
freebsd
branch
5 times, most recently
from
May 16, 2026 10:07
12c9339 to
2a46b57
Compare
G36maid
force-pushed
the
freebsd
branch
5 times, most recently
from
May 26, 2026 16:44
f60892f to
99ca085
Compare
…ess/06-basic-libc-backend Isolated Processes 6: Add a basic libc backend
This data comes from a process that has potentially corrupted memory, it's probably a good idea to validate the data as much as possible. We also abstract LinkMap over the Iterator trait to make it easier to reuse it later on, e.g. for module list generation.
We'll need this elsewhere as well. We also use the read_until helper rather than rolling our own, thus avoid the arbitrary 256 char limit.
At this stage, the main effect of suspend_threads is to attach ptrace, which we'll need when we start reading the target's memory to build the module list. Co-Authored-By: Simon Chopin <schopin@mozilla.com>
…DEBUG We use the dso_debug data source, enhanced with data mined out of module_reader to create an alternative module list source. Since the output data format is a bit limited, each candidate spans all of the module's segments. The main executable needs a bit of massaging as it's sometimes unnamed and we can't really have that, hence the pid-based fallback. Not wired up yet. Co-authored-by: Chris Martin <marti4d@live.ca>
Wire up a config toggle to switch to the rendezvous data source. If the primary source fails, log the error and fall back to the secondary source.
linux: optionally get module data from the debugger rendez-vous
While playing around with edge cases scenarii, one of them stood out: what would happen if there was a crash *during* a dlopen() call? That's what this patch is about. Luckily for us, the libc folks know their stuff, and have a marker field in the RT_DEBUG structure: `r_state`. It is present in both bionic and glibc, with the same standard values, so we can probably assume it's fairly standard, probably part of the SVR4 ABI – not that it's documented anywhere besides random blog articles that lamented at the same thing. In any case, we can now bail early if the linker doesn't explicitly mark its data as consistent. Note that this impacts the DSO data dump, that will now be empty rather than filled with garbage, as well as the module stream that'll fall back to procmaps.
…atus linux: don't walk the rendez-vous while the linker is mid-update
In recent glibc (>= 2.42), guard pages use the MADV_GUARD_INSTALL mechanism which isn't reflected in procmaps, so some stacks are merged together in a single mapping, and reading that entire mapping fails due to some pages within it being guarded. Instead, we take another approach: we know where the stack starts, so we just read from there up until we can't anymore, which would be our guard page. Fixes rust-minidump#244
More functions to be used later on, with only one small observable effect: when get_stack_info can't find the end of the guard area, it now errors out rather than return the last visited page, which would inevitably trigger a failure down the road.
As it turns out, just because a page permissions tell you it's readable doesn't actually mean it is. You can madvise() the kernel to segfault on that page via MADV_GUARD_INSTALL, so we actually try and read stuff to be sure that we're safe.
This should allow us a decent coverage of the various glibc quirks over time. That would have caught the madvise thing.
…-regions Linux: handle stack guards protected via MADV_GUARD_INSTALL
G36maid
force-pushed
the
freebsd
branch
5 times, most recently
from
October 21, 2026 19:33
6ec5404 to
1a32551
Compare
G36maid
force-pushed
the
freebsd
branch
2 times, most recently
from
November 2, 2026 12:01
bfeae55 to
30a14a9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements a complete FreeBSD x86_64 platform module for minidump-writer,
enabling minidump generation for FreeBSD processes
Core components:
Stream writers:
Infrastructure:
36 files changed, 4089 insertions(+)