Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Crash with "misaligned pointer dereference" in xi_input.rs in 32-bit Linux #394

Open
rsaarelm opened this issue Jul 23, 2023 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@rsaarelm
Copy link
Contributor

rsaarelm commented Jul 23, 2023

Miniquad v0.4.0-alpha.5, uname -m is armv7l, this is on a Raspberry Pi. The code seems to expect 64-bit pointer alignment on the 32-bit platform ("multiple of 0x8"). The panic only shows up when running a debug build.

thread 'main' panicked at 'misaligned pointer dereference: address must be a multiple of 0x8 but is 0x1b73ed4', ~/.cargo/registry/src/index.crates.io-1cd66030c949c28d/miniquad-0.4.0-alpha.5/src/native/linux_x11/xi_input.rs:152:18
stack backtrace:
   0: rust_begin_unwind
             at /rustc/5ea66686467d3ec5f8c81570e7f0f16ad8dd8cc3/library/std/src/panicking.rs:593:5
   1: core::panicking::panic_nounwind_fmt
             at /rustc/5ea66686467d3ec5f8c81570e7f0f16ad8dd8cc3/library/core/src/panicking.rs:96:14
   2: core::panicking::panic_misaligned_pointer_dereference
             at /rustc/5ea66686467d3ec5f8c81570e7f0f16ad8dd8cc3/library/core/src/panicking.rs:175:5
   3: miniquad::native::linux_x11::xi_input::LibXi::read_cookie
             at ~/.cargo/registry/src/index.crates.io-1cd66030c949c28d/miniquad-0.4.0-alpha.5/src/native/linux_x11/xi_input.rs:152:18
   4: miniquad::native::linux_x11::X11MainLoopData::process_event
             at ~/.cargo/registry/src/index.crates.io-1cd66030c949c28d/miniquad-0.4.0-alpha.5/src/native/linux_x11.rs:435:36
   5: miniquad::native::linux_x11::glx_main_loop
             at ~/.cargo/registry/src/index.crates.io-1cd66030c949c28d/miniquad-0.4.0-alpha.5/src/native/linux_x11.rs:502:13
   6: miniquad::native::linux_x11::run
             at ~/.cargo/registry/src/index.crates.io-1cd66030c949c28d/miniquad-0.4.0-alpha.5/src/native/linux_x11.rs:656:39
   7: miniquad::start
             at ~/.cargo/registry/src/index.crates.io-1cd66030c949c28d/miniquad-0.4.0-alpha.5/src/lib.rs:232:17
@not-fl3 not-fl3 added bug Something isn't working help wanted Extra attention is needed good first issue Good for newcomers labels Jul 23, 2023
@rsaarelm
Copy link
Contributor Author

How to reproduce: Be on a 32-bit linux (not sure if this just happens on Raspberry Pi / Raspbian), get miniquad sources, run cargo run --example quad, move mouse cursor in the example window.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants