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

thread 'main' panicked at 'attempted to leave type uninitialized, which is invalid (regression 1.47 -> 1.48) #80485

Closed
amarao opened this issue Dec 29, 2020 · 7 comments

Comments

@amarao
Copy link

amarao commented Dec 29, 2020

Code

I tried this code:
https://github.com/amarao/equart/tree/b07f31318b0529d3c01fe5d077497f3511dbc779

(sorry, it happens somewhere deep inside Piston library I use, so the whole application is needed to make it runable).

I expected to see this happen:

Application should work (display a picture).

Instead, this happened:

Application crashes if mouse is moved over the window (Linux).

thread 'main' panicked at 'attempted to leave type platform::platform::x11::util::input::PointerState uninitialized, which is invalid', .rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/mem/mod.rs:658:9

It most recently worked on: Rust 1.47

Version with regression

Rust 1.48.0

rustc 1.48.0 (7eac88abb 2020-11-16)
binary: rustc
commit-hash: 7eac88abb2e57e752f3302f02be5f3ce3d7adfb4
commit-date: 2020-11-16
host: x86_64-unknown-linux-gnu
release: 1.48.0
LLVM version: 11.0

Backtrace

thread 'main' panicked at 'attempted to leave type `platform::platform::x11::util::input::PointerState` uninitialized, which is invalid', /home/amarao/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/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: glutin_window::GlutinWindow::poll_event
   6: <glutin_window::GlutinWindow as window::Window>::poll_event
   7: event_loop::Events::next
   8: equart::main
@RalfJung
Copy link
Member

This message is intentional, it indicates a bug in the code where the panic is raised. See #66151 for further details.

@RalfJung
Copy link
Member

RalfJung commented Dec 29, 2020

It looks like you are using a rather old version of winit (0.19.5 according to your lockfile). Does updating to the latest version help? There were some bugfixes there, such as rust-windowing/winit@468b6b8 (though the backtrace does not fit for that error).

@jonas-schievink
Copy link
Contributor

Closing as expected behavior

@amarao
Copy link
Author

amarao commented Dec 30, 2020

Yes, I've tried to upgrade all dependencies, it does not help. Thanks for reply, I'll try to report it to the piston repo.

@RalfJung
Copy link
Member

Potentially some dependency needs to change its upstream version as well -- you can check the lockfile to see which version of winit you are using. cargo tree can help to figure out where the dependency comes from.

@momomo
Copy link

momomo commented Jul 17, 2022

I have the same issue:

sslocal -b "127.0.0.1:1080" -s "[::1]:8388" -m "aes-256-gcm" -k "hello-kitty" --plugin "v2ray-plugin" --plugin-opts "server;tls;host=github.com" thread 'main' panicked at 'UDP_REDIR is not an id of an argument or a group.
Make sure you're using the name of the argument itself and not the name of short or long flags.', src/service/local.rs:568:31
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

sslocal -b "127.0.0.1:1080" -s "[::1]:8388" -m "aes-256-gcm" -k "hello-kitty" --plugin "v2ray-plugin" --plugin-opts "server;tls;host=github.com" thread 'main' panicked at 'UDP_REDIR is not an id of an argument or a group.
Make sure you're using the name of the argument itself and not the name of short or long flags.', src/service/local.rs:568:31
stack backtrace:
0: rust_begin_unwind
at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panicking.rs:584:5
1: core::panicking::panic_fmt
at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/core/src/panicking.rs:142:14
2: clap::parser::matches::arg_matches::ArgMatches::get_arg
at /Users/j/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/clap-3.2.8/src/parser/matches/arg_matches.rs:1273:17
3: clap::parser::matches::arg_matches::ArgMatches::value_of
at /Users/j/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/clap-3.2.8/src/parser/matches/arg_matches.rs:352:19
4: clap::parser::matches::arg_matches::ArgMatches::value_of_t
at /Users/j/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/clap-3.2.8/src/parser/matches/arg_matches.rs:490:17
5: shadowsocks_rust::service::local::main
at /Volumes/m/software/tunnels/shadowsocksrust/git/src/service/local.rs:568:23
6: sslocal::main
at /Volumes/m/software/tunnels/shadowsocksrust/git/bin/sslocal.rs:19:5
7: core::ops::function::FnOnce::call_once
at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/core/src/ops/function.rs:248:5
note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.

@RalfJung
Copy link
Member

@momomo that is not the same issue, your panic message is very different. You will have to talk to the sslocal developers about this one.

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

No branches or pull requests

4 participants