after updating from Rust 1.79 to Rust 1.80(.1) I can’t compile my code in debug mode (–release works), as apparently something in the library seems to be broken. As others on my team can compile the code with their setup it probably comes from something in my setup.
My setup uses
WSL version: 2.2.4.0
Kernel version: 5.15.153.1-2
WSLg version: 1.0.61
MSRDC version: 1.2.5326
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26091.1-240325-1447.ge-release
Windows version: 10.0.22631.4037
with VS code 1.92.2
and Rust is
stable-x86_64-unknown-linux-gnu (default)
The full backtrace is:
thread '<unnamed>' panicked at library/core/src/panicking.rs:219:5:
unsafe precondition(s) violated: ptr::replace requires that the pointer argument is aligned and non-null
stack backtrace:
0: 0x7f7cafdda0d5 - std::backtrace_rs::backtrace::libunwind::trace::h23054e327d0d4b55
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/../../backtrace/src/backtrace/libunwind.rs:116:5
1: 0x7f7cafdda0d5 - std::backtrace_rs::backtrace::trace_unsynchronized::h0cc587407d7f7f64
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2: 0x7f7cafdda0d5 - std::sys_common::backtrace::_print_fmt::h4feeb59774730d6b
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/sys_common/backtrace.rs:68:5
3: 0x7f7cafdda0d5 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hd736fd5964392270
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/sys_common/backtrace.rs:44:22
4: 0x7f7cafdfe97b - core::fmt::rt::Argument::fmt::h105051d8ea1ade1e
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/core/src/fmt/rt.rs:165:63
5: 0x7f7cafdfe97b - core::fmt::write::hc6043626647b98ea
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/core/src/fmt/mod.rs:1168:21
6: 0x7f7cafdd782f - std::io::Write::write_fmt::h0d24b3e0473045db
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/io/mod.rs:1835:15
7: 0x7f7cafdd9eae - std::sys_common::backtrace::_print::h62df6fc36dcebfc8
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/sys_common/backtrace.rs:47:5
8: 0x7f7cafdd9eae - std::sys_common::backtrace::print::h45eb8174d25a1e76
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/sys_common/backtrace.rs:34:9
9: 0x7f7cafddb5c9 - std::panicking::default_hook::{{closure}}::haf3f0170eb4f3b53
10: 0x7f7cafddb36a - std::panicking::default_hook::hb5d3b27aa9f6dcda
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panicking.rs:298:9
11: 0x7f7cafddbc3b - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h2026a29033a1b9f6
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/alloc/src/boxed.rs:2077:9
12: 0x7f7cafddbc3b - std::panicking::rust_panic_with_hook::h6b49d59f86ee588c
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panicking.rs:799:13
13: 0x7f7cafddb97b - std::panicking::begin_panic_handler::{{closure}}::hd4c2f7ed79b82b70
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panicking.rs:656:13
14: 0x7f7cafdda599 - std::sys_common::backtrace::__rust_end_short_backtrace::h2946d6d32d7ea1ad
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/sys_common/backtrace.rs:171:18
15: 0x7f7cafddb6e7 - rust_begin_unwind
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panicking.rs:652:5
16: 0x7f7cafdfcfe0 - core::panicking::panic_nounwind_fmt::runtime::hffa5266293589c8f
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/core/src/panicking.rs:110:18
17: 0x7f7cafdfcfe0 - core::panicking::panic_nounwind_fmt::h123fa496fdd47ecd
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/core/src/panicking.rs:120:5
18: 0x7f7cafdfd072 - core::panicking::panic_nounwind::h09f605755f992025
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/core/src/panicking.rs:219:5
19: 0x7f7caf9d0f05 - core::ptr::replace::precondition_check::hf20f00ad1d905a21
20: 0x7f7caf9ce42a - std::sys::thread_local::fast_local::lazy::Storage<T,D>::initialize::h87c2a084294369d9
21: 0x7f7caf9ce661 - std::sys::thread_local::fast_local::lazy::Storage<T,D>::get_or_init::hc579a800cfa259e6
22: 0x7f7caf9ce705 - std::hash::random::RandomState::new::KEYS::{{constant}}::{{closure}}::h9f6529e3287e74dc
23: 0x7f7caf9ab0ec - core::ops::function::FnOnce::call_once::hdf5cb44b3e16d2c4
24: 0x7f7caf9d257c - std::thread::local::LocalKey<T>::try_with::h2722dba6367cd24e
25: 0x7f7caf94b11e - <std::hash::random::RandomState as core::default::Default>::default::hd1b14e68bce8c516
26: 0x7f7caf94b382 - <indexmap::map::IndexMap<K,V,S> as core::default::Default>::default::h351d51e5aed9dec8
27: 0x7f7caf96fe02 - <toml_edit::table::Table as core::default::Default>::default::hfa5d93b1212599fb
28: 0x7f7caf96ef9d - toml_edit::table::Table::new::h3180ed6ba6128add
29: 0x7f7caf96b884 - toml_edit::parser::state::ParseState::new::hf41a7f7a0e6cc62b
30: 0x7f7caf91f871 - toml_edit::parser::parse_document::h43d561311bc9b1d5
31: 0x7f7caf91fcfe - toml_edit::document::ImDocument<S>::parse::hec29c32d2a976f85
32: 0x7f7caf9247de - toml_edit::de::Deserializer<S>::parse::h04cd88928dd41f04
33: 0x7f7caf91fdca - <toml::de::Deserializer as serde::de::Deserializer>::deserialize_any::h1eda7d9dca6f7794
34: 0x7f7caf91fffe - <toml::de::Deserializer as serde::de::Deserializer>::deserialize_map::hc095dfd3b80966ee
35: 0x7f7caf91dace - <toml::map::Map<alloc::string::String,toml::value::Value> as serde::de::Deserialize>::deserialize::h2f82cb050922911c
36: 0x7f7caf91fd4c - toml::de::from_str::hb765caddf00fdd98
37: 0x7f7caf91e0ae - toml::table::<impl core::str::traits::FromStr for toml::map::Map<alloc::string::String,toml::value::Value>>::from_str::hb0176c7f20e29202
38: 0x7f7caf8cb36b - docify_macros::caller_crate_root::h868cec2a28ae94d2
39: 0x7f7caf8d1f65 - docify_macros::embed_internal_str::h91a5731518eed86d
40: 0x7f7caf8d31cf - docify_macros::embed_internal::h1da7eae1fd626ea6
41: 0x7f7caf8ccaad - docify_macros::embed::hb872250b4bf0af43
42: 0x7f7caf8f1f4e - core::ops::function::Fn::call::h742266565bb27963
43: 0x7f7caf8e520e - proc_macro::bridge::client::Client<proc_macro::TokenStream,proc_macro::TokenStream>::expand1::{{closure}}::{{closure}}::h4a2d29d72484ae66
44: 0x7f7caf8e50e6 - proc_macro::bridge::client::run_client::{{closure}}::{{closure}}::h44d61490e0a9a57a
45: 0x7f7caf8d85d1 - proc_macro::bridge::client::state::set::hf29d45e50f3ab2c8
46: 0x7f7caf8e3e61 - proc_macro::bridge::client::run_client::{{closure}}::h0b78fe73508a88de
47: 0x7f7caf8e5a30 - <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::hed4c85ab4fd9ec06
48: 0x7f7caf8d8f1c - std::panicking::try::do_call::h5d81c4b133d33bf9
49: 0x7f7caf8dc03b - __rust_try
50: 0x7f7caf8d8e92 - std::panicking::try::he316a7eacc51c30a
51: 0x7f7caf8e314e - proc_macro::bridge::client::run_client::h4bdd8a5fd08aa04b
52: 0x7f7caf8e51de - proc_macro::bridge::client::Client<proc_macro::TokenStream,proc_macro::TokenStream>::expand1::{{closure}}::h8b2f45eb6adb42c6
53: 0x7f7caf8c4464 - proc_macro::bridge::selfless_reify::reify_to_extern_c_fn_hrt_bridge::wrapper::haf9205621186c748
54: 0x7f7cc9943793 - <proc_macro[6cef755cecc62568]::bridge::server::MaybeCrossThread<rustc_expand[d71556ce221f3cc4]::proc_macro::MessagePipe<proc_macro[6cef755cecc62568]::bridge::buffer::Buffer>> as proc_macro[6cef755cecc62568]::bridge::server::ExecutionStrategy>::run_bridge_and_client::<proc_macro[6cef755cecc62568]::bridge::server::Dispatcher<proc_macro[6cef755cecc62568]::bridge::server::MarkedTypes<rustc_expand[d71556ce221f3cc4]::proc_macro_server::Rustc>>>
55: 0x7f7cc99434d5 - <proc_macro[6cef755cecc62568]::bridge::client::Client<proc_macro[6cef755cecc62568]::TokenStream, proc_macro[6cef755cecc62568]::TokenStream>>::run::<rustc_expand[d71556ce221f3cc4]::proc_macro_server::Rustc, proc_macro[6cef755cecc62568]::bridge::server::MaybeCrossThread<rustc_expand[d71556ce221f3cc4]::proc_macro::MessagePipe<proc_macro[6cef755cecc62568]::bridge::buffer::Buffer>>>
56: 0x7f7cc9bd0b64 - <rustc_expand[d71556ce221f3cc4]::proc_macro::BangProcMacro as rustc_expand[d71556ce221f3cc4]::base::BangProcMacro>::expand
57: 0x7f7cc5c11ff3 - <rustc_expand[d71556ce221f3cc4]::expand::MacroExpander>::fully_expand_fragment
58: 0x7f7cc9d2645c - <rustc_expand[d71556ce221f3cc4]::expand::MacroExpander>::expand_crate
59: 0x7f7cc95d0bcf - rustc_interface[c31201428b712578]::passes::resolver_for_lowering_raw
60: 0x7f7cc95d010d - rustc_query_impl[c1633093ec927e0e]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[c1633093ec927e0e]::query_impl::resolver_for_lowering_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle[ecc07153edf3c281]::query::erase::Erased<[u8; 16usize]>>
61: 0x7f7cc95d00e7 - <rustc_query_impl[c1633093ec927e0e]::query_impl::resolver_for_lowering_raw::dynamic_query::{closure#2} as core[1a380081440346cb]::ops::function::FnOnce<(rustc_middle[ecc07153edf3c281]::ty::context::TyCtxt, ())>>::call_once
62: 0x7f7cc9d614cc - rustc_query_system[b257ee99c2874caa]::query::plumbing::try_execute_query::<rustc_query_impl[c1633093ec927e0e]::DynamicConfig<rustc_query_system[b257ee99c2874caa]::query::caches::SingleCache<rustc_middle[ecc07153edf3c281]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[c1633093ec927e0e]::plumbing::QueryCtxt, true>
63: 0x7f7cc9d60fe6 - rustc_query_impl[c1633093ec927e0e]::query_impl::resolver_for_lowering_raw::get_query_incr::__rust_end_short_backtrace
64: 0x7f7cc9c120be - rustc_interface[c31201428b712578]::interface::run_compiler::<core[1a380081440346cb]::result::Result<(), rustc_span[4d50fd03223eefaa]::ErrorGuaranteed>, rustc_driver_impl[ce01f96e2e949677]::run_compiler::{closure#0}>::{closure#1}
65: 0x7f7cc9d47869 - std[fba9fafec3bdacf8]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[c31201428b712578]::util::run_in_thread_with_globals<rustc_interface[c31201428b712578]::interface::run_compiler<core[1a380081440346cb]::result::Result<(), rustc_span[4d50fd03223eefaa]::ErrorGuaranteed>, rustc_driver_impl[ce01f96e2e949677]::run_compiler::{closure#0}>::{closure#1}, core[1a380081440346cb]::result::Result<(), rustc_span[4d50fd03223eefaa]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[1a380081440346cb]::result::Result<(), rustc_span[4d50fd03223eefaa]::ErrorGuaranteed>>
66: 0x7f7cc9d4766a - <<std[fba9fafec3bdacf8]::thread::Builder>::spawn_unchecked_<rustc_interface[c31201428b712578]::util::run_in_thread_with_globals<rustc_interface[c31201428b712578]::interface::run_compiler<core[1a380081440346cb]::result::Result<(), rustc_span[4d50fd03223eefaa]::ErrorGuaranteed>, rustc_driver_impl[ce01f96e2e949677]::run_compiler::{closure#0}>::{closure#1}, core[1a380081440346cb]::result::Result<(), rustc_span[4d50fd03223eefaa]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[1a380081440346cb]::result::Result<(), rustc_span[4d50fd03223eefaa]::ErrorGuaranteed>>::{closure#2} as core[1a380081440346cb]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
67: 0x7f7ccb0cae3b - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hdf5fcef8be77a431
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/alloc/src/boxed.rs:2063:9
68: 0x7f7ccb0cae3b - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h8e8c5ceee46ee198
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/alloc/src/boxed.rs:2063:9
69: 0x7f7ccb0cae3b - std::sys::pal::unix::thread::Thread::new::thread_start::hb85dbfa54ba503d6
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/sys/pal/unix/thread.rs:108:17
70: 0x7f7cc4a5aac3 - <unknown>
71: 0x7f7cc4aec850 - <unknown>
72: 0x0 - <unknown>
thread caused non-unwinding panic. aborting.
Any hints what could’ve gone wrong?
There are only two parts using unsafe code, both using methods from the hashbrown
crate, one using
hashbrown::raw::inner::RawTable
impl<T, A> RawTable<T, A>
pub unsafe fn iter(&self) -> RawIter<T>
the other using
hashbrown::raw::inner::Bucket
impl<T> Bucket<T>
pub unsafe fn as_ref<'a>(&self) -> &'a T
Since the problem appears only on my machine, this is a bit strange.
Tried to wait for the next Rust update (problem consists since 1.80.0). dist-upgrade
to make sure WSL Ubuntu is up to date. Cargo clear cache to make sure everything is really clean re-build.
Minimal example which fails:
fn main() {
println!("Hello, world!");
}
#[doc = docify::embed!("src/main.rs", example_env)]
pub mod something {}
#[cfg(test)]
mod tests {
#[test]
#[docify::export_content]
fn example_env() {}
}
with Rust 1.82 beta I get
error: proc macro panicked
--> src/main.rs:5:9
|
5 | #[doc = docify::embed!("src/main.rs", example_env)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: message: attempt to subtract with overflow
7