project-serum / serum-dex

Project Serum Rust Monorepo
https://projectserum.com
Apache License 2.0
627 stars 330 forks source link

`client::tests::test_cluster_bad_parse` triggers undefined behaviour #219

Closed c410-f3r closed 2 years ago

c410-f3r commented 2 years ago

Miri (https://github.com/rust-lang/miri) is an interpreter, used by several Rust projects including the official compiler, that detects undefined behavior. So if you run miri test, client::tests::test_cluster_bad_parse will trigger the following UB.

I don't know if the error is legit but judging from the fact that this project makes extensive use of arbitrary bit casts, unsafe operations, unchecked arithmetic operations and unchecked primitive casts, it might be worth auditing the codebase

c410-f3r commented 2 years ago

Oopss, my bad. The UB is unrelated, therefore, I will close this issue but that hints about the codebase are still valid