3 ms·
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 transla
by Vecr 2y ago
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/-/commit/f7f56f2258af1fc3ce67424e96b3d1930a63ee42 https://gitlab.com/sequoia-pgp/sha1collisiondetection/-/comm...
And here:
https://gitlab.com/sequoia-pgp/sha1collisiondetection/-/commit/232f2b52b700472c717bb5db81ab45960ef6dfa5 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.
- kkysen 2y agoI 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.
- Vecr 2y agoI'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.