top | item 39446838

(no title)

jcmoyer | 2 years ago

>Without compiler bugs, on stock Linux, you can achieve the same thing via /proc/self/mem.

The documentation addresses this case specifically: https://doc.rust-lang.org/stable/std/os/unix/io/index.html#p...

"Rust’s safety guarantees only cover what the program itself can do, and not what entities outside the program can do to it. /proc/self/mem is considered to be such an external entity..."

discuss

order

fweimer|2 years ago

The /proc/self/mem thing shouldn't be a problem because you won't run into it accidentally. What I'm wondering if this compiler bug is in the same category, or if a Rust programmer is somewhat likely to run into this bug by accident (or other I-unsound compiler bugs) if their approach is more or less “tweak things until they typecheck and pass the borrow checker”.

steveklabnik|2 years ago

I have been programming in Rust since late 2012. I don’t think I have ever run into a soundness bug like this in the wild.

That doesn’t mean that it never happens, but it is a very rare occurrence, not something that Rust programmers deal with regularly.