oxidecomputer / oxidecomputer/usdt
Justification around `nomem` specifier
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 145
- Forks
- 15
- Avg merge
- 14m
- Merged PRs (30d)
- 6
Description
This crate specifies nomem in the asm!(), and casts pointers to usize.
The inline assembly docs specify
The assembly code does not read from or write to any memory accessible outside of the assembly code. This allows the compiler to cache the values of modified global variables in registers across execution of the assembly code since it knows that they are not read from or written to by it.
It's quite clear that reading from a pointer value when nomem is set is UB. The probe function would necessarily need to read the pointer when tracing.
Wouldn't it be more appropriate to use readonly?
Thanks
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the asm!() usage in usdt-impl/src/no-linker.rs:112 and the pointer cast in usdt-impl/src/common.rs:182, then read Rust’s documented nomem and readonly options. Trace the probe path to determine whether the assembly accesses the pointed-to memory. Done means the selected option is technically correct and the rationale is documented in the issue or code.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100