Skip to content

platform::platform::x11::util::input::PointerState` uninitialized, which is invalid #1811

@amarao

Description

@amarao

After upgrading from Rust 1.47.0 to 1.48.0 existing code (based on piston) start to crash in event.next() if mouse is moved over the window (X, Linux).

Versions:
winit 0.19.5
piston 0.52.1
piston_window 0.116.0

The code to reproduce the problem: https://github.com/amarao/equart/tree/c20a1a6188da076ef3791f94ffa662a2da1ce00c

Under Rust 1.47.0 it's working without panic, with Rust 1.48.0 it's panicking:

thread 'main' panicked at 'attempted to leave type `platform::platform::x11::util::input::PointerState` uninitialized, which is invalid', /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/core/src/mem/mod.rs:658:9
stack backtrace:
   0: rust_begin_unwind
             at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:483
   1: core::panicking::panic_fmt
             at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/core/src/panicking.rs:85
   2: core::panicking::panic
             at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/core/src/panicking.rs:50
   3: winit::platform::platform::x11::util::input::<impl winit::platform::platform::x11::xdisplay::XConnection>::query_pointer
   4: winit::platform::platform::x11::EventsLoop::process_event
   5: winit::platform::platform::EventsLoop::poll_events
   6: glutin_window::GlutinWindow::poll_event
   7: <glutin_window::GlutinWindow as window::Window>::poll_event
   8: event_loop::Events::next
   9: equart::main

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions