Repository navigation
Conversation
12c9339 to
2a46b57
Compare
|
Thank you for this work, FreeBSD support in this crate together with some upstream work I'm making in Firefox would make it possible to have proper crash reporting enabled on the platform. It's worth mentioning that we're refactoring the interfaces we use to read from a process to make room from a proxy'd process reader which we need on Android. Check the changes in both the pending and already merged PRs that are called "Isolated Processes X: ...". Those changes are largely mechanical and do not affect the logic, just where some pieces live and how they're accessed. |
|
Thanks for the quick response! It's great to know this work could help. I'm currently running some bare-metal testing on FreeBSD — things are looking good so far. I'd be happy if you'd like to start reviewing this PR while I finish up the testing. I've also taken a peek at the Isolated Processes PR series (#/174–#/182). Once the testing is done and this PR is in a good state, I plan to follow up by adapting ProcessInspector for FreeBSD to align with the new architecture. One question: would you prefer I do it as a follow-up PR after this one lands, or fold it in here? I 'd prefer to keep them separate — this PR is already fairly large. Happy to go either way though. |
It's fine to make that a follow up if it makes life easier for you. |
f60892f to
99ca085
Compare
|
Sorry for the delay over the past few weeks. I was caught up with some unexpected interviews and tests, so I didn't have time to push this PR forward. I have some free time now, so I'll review where I left off and pick this back up. |
|
np, I've been very busy myself and I also need to spin up a FreeBSD VM to test |
|
Quick update: I still haven't found the time to spin up a FreeBSD VM because I've been constantly putting out fires at work and churning through other reviews. I should have some time the next week to look into this, or at the absolute worst at the end of the month. I wish I could be more responsive to contributions because they genuinely interest me and I'm always happy to receive them but work has been absolutely hectic leaving me with very little time and energy for anything else. |
|
No worries at all! That actually works out because I haven't finished organizing and polishing up my side of the PR yet either. |
|
Sorry again for the huge delay here, the good news is we're done messing with the crate interface to deal with remote dumpers so now would be a good time to rebase this as the crate's interface and internals should remain stable. |
|
Thanks for the heads-up! Rebased onto main — some small conflicts. The FreeBSD side needs a bit of rework to fit the new trait (our reader currently owns the ptrace logic directly), I'll push the updated branch once that's done. |
794d69e to
34e6513
Compare
6ec5404 to
1a32551
Compare
|
All set and marked ready for review! Rebased onto the latest main with the ProcessInspector refactor in place. Verified on FreeBSD action with CI on my fork. I'm currently prototyping and testing the follow-ups on my end. Take your time with the review, and let me know if anything needs tweaking! |
bfeae55 to
30a14a9
Compare
|
Another quick update: I'm wrapping up some stuff downstream in Firefox, then I'll cut a new release of this crate and then I'll proceed with review & merging this. Again sorry for the delay but it's a bit of a hectic period because we have at least three major projects within Firefox crash reporting machinery that are being finished at the same time and some days I'm doing reviews almost non-stop. |
CLOSES #162
Adds FreeBSD (x86_64) support, reworked onto the post-Isolated-Processes architecture.
All process state goes through a
ProcessInspectortrait (src/freebsd/process_inspection/), same shape as the Linux implementation: the writer holds aBox<dyn ProcessInspector>and nothing below it touches ptrace/sysctl directly. The local inspector usesPT_IOfor memory reads,PT_ATTACH/PT_DETACHfor tracing,PT_SUSPEND/PT_RESUMEfor per-thread control,PT_GETREGS/PT_GETFPREGSfor registers, andkinfo_getvmmap/KERN_PROC_AUXVfor maps and auxv.A few FreeBSD-specific things worth knowing:
AT_EXECPATHwhen the binary has been deleted from disk (FreeBSD'skinfo_getvmmapreports no path for deleted files, unlike Linux's(deleted)suffix in/proc/pid/maps).KVME_TYPE_GUARDandKVME_TYPE_DEADmappings are filtered from the vm map, mirroring howMADV_GUARD_INSTALLpages are invisible on Linux.src/freebsd/module_reader.rsis a port of the Linux ELF machinery. Sharing it between platforms requires splittingModuleReaderError(which has Linux-specific variants); I'd like to do that as a follow-up rather than expanding this PR further.CI runs the full test suite on FreeBSD 14.4 and 15.0 (MSRV 1.90.0) via
vmactions/freebsd-vm.Follow-ups: split the backend into
crates/+ remote support, FreeBSD branch forcrash-context(unblocks the zed-on-FreeBSD chain, EmbarkStudios/crash-handling#108), deduplicate the ELF module reading, dso_debug, i386/aarch64.