rust-lang / miri

An interpreter for Rust's mid-level intermediate representation
Apache License 2.0
4.38k stars 339 forks source link

FreeBSD: implement support for pthread synchronization primitives #3571

Closed RalfJung closed 2 weeks ago

RalfJung commented 5 months ago

We currently don't support the pthread synchronization primitives on FreeBSD. And it turns out that supporting them will require some refactoring of how we implement those primitives: on FreeBSD, pthread_mutex_t et al are just a pointer to the actual data. That means on a 32bit system they are only 4 bytes large, which is not large enough for us to store the data we need to store directly in the pthread_mutex_t.

So we should move that data out of machine memory into dedicated machine state, which also has the advantage of making it more tamper-resistant. Once that's done, implementing FreeBSD support should be fairly easy.

RalfJung commented 2 months ago

Blocked on https://github.com/rust-lang/miri/issues/3749.