error[E0793]: reference to packed field is unaligned. Ubuntu 20.04
nyx-net git:(main) ./setup.sh
[?] Checking submodules ...
[?] Checking QEMU-NYX ...
[?] Checking NYX-Net fuzzer ...
[*] Compiling NYX-Net fuzzer ...
[?] Checking submodules ...
[?] Checking rust_fuzzer ...
Compiling fuzz_runner v0.1.0 (/home/ilorj/Desktop/protocols/nyx-net/fuzzer/libnyx/fuzz_runner)
error[E0793]: reference to packed field is unaligned
--> /home/ilorj/Desktop/protocols/nyx-net/fuzzer/libnyx/fuzz_runner/src/lib.rs:221:9
|
221 | &self.feedback_data.shared.ijon.max_data
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use read_unaligned/write_unaligned (loads and stores via *p must be properly aligned even when using raw pointers)
For more information about this error, try rustc --explain E0793.
error: could not compile fuzz_runner due to previous error
nyx-net git:(main) cargo --version cargo 1.69.0 (6e9a83356 2023-04-12) nyx-net git:(main) rustc --version rustc 1.69.0 (84c898d65 2023-04-16)
same error
same error
@ilorj @nj00001 @bluestar628
Hi, I had the same error and resolved it by downgrading rust to 1.63.0, which was done by executing rustup override set 1.63.0 in nyx-net directory.
I solved this problem by downgrading rust to 1.65.0
Ubuntu 22.04, rustup override set 1.65.0
add #[allow(unaligned_references)] before fn ijon_max_buffer(&self)->&[64] in nyx-net/fuzzer/libnyx/fuzz_runner/src/lib.rs file
for example,
#[allow(unaligned_references)]
fn ijon_max_buffer(&self) -> &[u64] {
&self.feedback_data.shared.ijon.max_data
}
@RIeFre @zengman sorry to bother. But the same error still exists after I did as you said