Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

misaligned pointer dereference #29

Closed
WilfredC64 opened this issue Jul 8, 2023 · 1 comment
Closed

misaligned pointer dereference #29

WilfredC64 opened this issue Jul 8, 2023 · 1 comment

Comments

@WilfredC64
Copy link

Since Rust 1.70 using stable-i686-pc-windows-msvc on Windows, calling:

if_addrs::get_if_addrs()

results in the following error in debug mode:

thread 'main' panicked at 'misaligned pointer dereference: address must be a multiple of 0x8 but is 0x14bc664', ..cargo\registry\src\index.crates.io-1cd66030c949c28d\if-addrs-0.10.1\src\windows.rs:194:26
stack backtrace:
0: std::panicking::begin_panic_handler
at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library\std\src\panicking.rs:578
1: core::panicking::panic_fmt
at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library\core\src\panicking.rs:67
2: core::panicking::panic_misaligned_pointer_dereference
at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library\core\src\panicking.rs:174
3: if_addrs::windows::impl$5::next
at ..cargo\registry\src\index.crates.io-1cd66030c949c28d\if-addrs-0.10.1\src\windows.rs:194
4: if_addrs::getifaddrs_windows::get_if_addrs
at ..cargo\registry\src\index.crates.io-1cd66030c949c28d\if-addrs-0.10.1\src\lib.rs:235
5: if_addrs::get_if_addrs
at ..cargo\registry\src\index.crates.io-1cd66030c949c28d\if-addrs-0.10.1\src\lib.rs:359

This has to do with the following change in Rust 1.70:

rust-lang/rust#98112

The issue doesn't occur in older version of Rust.

@WilfredC64
Copy link
Author

Issue is solved in Rust 1.71

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant