8000 linux: add memory-reading helpers for reading POD values from a process by schopin-mozilla · Pull Request #220 · rust-minidump/minidump-writer · GitHub
[go: up one dir, main page]

Skip to content

linux: add memory-reading helpers for reading POD values from a process - #220

Merged
marti4d merged 1 commit into
rust-minidump:mainfrom
schopin-mozilla:pod-reader
Aug 26, 2026
Merged

marti4d merged 1 commit into
rust-minidump:mainfrom
schopin-mozilla:pod-reader

Conversation

@schopin-mozilla
Copy link
Copy Markdown
Collaborator

Pulled off #195

@schopin-mozilla
Copy link
Copy Markdown
Collaborator Author

@marti4d FYI

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

Sorry, but could I please ask you to implement read_exact in process_inspection and not in process-backend?

The issue is that any API that's added to process-backend is an API that will need to be remoted to a crashed content process running in a signal handler context -- Which means it can't allocate and has to use fixed-sized buffers.

So all the APIs that are in process-backend have been designed to either have output types that are a fairly-small, fixed size (maybe a few hundred bytes), or-else they return a buffer that is dynamically sized but can be truncated from what the user requested (the way that read()-like APIs behave, where you can give the user less than they asked for if you don't have the buffer space for it).

So, unfortunately, putting read_exact() into process-backend breaks that contract - It could make an atomic request that is larger than the remote backend can buffer, causing a guaranteed failure to ever serve the request.

@schopin-mozilla
Copy link
Copy Markdown
Collaborator Author

My initial thought was to just move the current implementation (process_reader::ProcessReader::read_exact_at) into a default method implementation on the reader backend trait, but then I would have had to wire up the errors, etc... which makes any other implementor's life harder, so instead I just duplicated the algorithm where you wanted instead. After all, it was already present in two places!

That's a lie. My initial thought was "there's too many things called the same thing in this mess".

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

LGTM... Thanks!

@marti4d
marti4d merged commit bb0517e into rust-minidump:main Aug 26, 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