News for hackers. Stuff that matters.
Re:Porting C to Rust for a Fast and Safe AV1 Media Decoder by Vecr on Monday September 09, 2024 @10:09PM (#41496499)
Did they check the assembly code an the exported C API for issues with aliasing related problems and other C/Rust differences?

For example in a similar translation there was UB here: https://gitlab.com/sequoia-pgp/sha1collisiondetection/-/comm...

And here: https://gitlab.com/sequoia-pgp/sha1collisiondetection/-/comm...

I thought there was a fancier/weirder programming error in that crate but I can't find it right now.

Re:Porting C to Rust for a Fast and Safe AV1 Media Decoder by kkysen on Tuesday September 10, 2024 @03:43AM (#41498221)
I don't think we do either of those errors. Obviously if the C caller does weird stuff, all bets are off, but we don't mutate through `&T`s or not initialize memory. `MaybeUninit` is only used in a few isolated and carefully checked places. Most of the rest of the buffers are zero initialized, which is usually done for free by the kernel.
Re:Porting C to Rust for a Fast and Safe AV1 Media Decoder by Vecr on Tuesday September 10, 2024 @01:29PM (#41503307)
I'm thinking more about the differences between how C and Rust uses noalias, but I can't find an example of it going wrong in real translated code currently.