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

Rustc SIGSEGV in proc_macro bridge #116976

Closed
bjorn3 opened this issue Oct 20, 2023 · 8 comments · Fixed by #117436
Closed

Rustc SIGSEGV in proc_macro bridge #116976

bjorn3 opened this issue Oct 20, 2023 · 8 comments · Fixed by #117436
Assignees
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-bug Category: This is a bug. I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. P-high High priority regression-untriaged Untriaged performance or correctness regression. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@bjorn3
Copy link
Member

bjorn3 commented Oct 20, 2023

Code

I tried these commands:

git clone https://github.com/bjorn3/rustc_codegen_cranelift cg_clif
cd cg_clif
git checkout b97201088788c11b66e711d1e9cfa480c947f3d3
./y.sh prepare
CARGO_BUILD_INCREMENTAL=false ./y.sh test --use-backend llvm --skip-test testsuite.no_sysroot --skip-test testsuite.base_sysroot

I expected to see this happen: Compiles

Instead, this happened: Rustc SIGSEGV's.

error: could not compile `ciborium` (lib)

Caused by:
  process didn't exit successfully: `/home/gh-bjorn3/cg_clif/./dist/rustc-clif --crate-name ciborium --edition=2021 /home/gh-bjorn3/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ciborium-0.2.1/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=189 --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=ee969c0aaab7f0dc -C extra-filename=-ee969c0aaab7f0dc --out-dir /home/gh-bjorn3/cg_clif/./build/rand_target/x86_64-unknown-linux-gnu/debug/deps --target x86_64-unknown-linux-gnu -L dependency=/home/gh-bjorn3/cg_clif/./build/rand_target/x86_64-unknown-linux-gnu/debug/deps -L dependency=/home/gh-bjorn3/cg_clif/./build/rand_target/debug/deps --extern ciborium_io=/home/gh-bjorn3/cg_clif/./build/rand_target/x86_64-unknown-linux-gnu/debug/deps/libciborium_io-d90c9196178c220e.rmeta --extern ciborium_ll=/home/gh-bjorn3/cg_clif/./build/rand_target/x86_64-unknown-linux-gnu/debug/deps/libciborium_ll-b18ba9871e77c28b.rmeta --extern serde=/home/gh-bjorn3/cg_clif/./build/rand_target/x86_64-unknown-linux-gnu/debug/deps/libserde-7b6ee54c55134327.rmeta --cap-lints allow --cap-lints=allow` (signal: 11, SIGSEGV: invalid memory reference)
warning: build failed, waiting for other jobs to finish...
CARGO_ENCODED_RUSTDOCFLAGS="" CARGO_ENCODED_RUSTFLAGS="--cap-lints=allow" RUSTC="/home/gh-bjorn3/cg_clif/./dist/rustc-clif" RUSTDOC="/home/gh-bjorn3/cg_clif/./dist/rustdoc-clif" "/home/gh-bjorn3/.rustup/toolchains/nightly-2023-10-19-x86_64-unknown-linux-gnu/bin/cargo" "test" "--manifest-path" "/home/gh-bjorn3/cg_clif/./build/rand/Cargo.toml" "--target-dir" "/home/gh-bjorn3/cg_clif/./build/rand_target" "--locked" "--target" "x86_64-unknown-linux-gnu" "--workspace" "--" "-q" exited with status ExitStatus(unix_wait_status(25856))

Version it worked on

It most recently worked on: nightly-2023-10-09

Version with regression

rustc --version --verbose:

rustc 1.75.0-nightly (0039d739d 2023-10-18)
binary: rustc
commit-hash: 0039d739d40a076334e111488946441378d11cd7
commit-date: 2023-10-18
host: x86_64-unknown-linux-gnu
release: 1.75.0-nightly
LLVM version: 17.0.3

Backtrace

Backtrace

#0  _rjem_je_free_default (ptr=0x1) at src/jemalloc.c:3014
#1  0x00007fffdf8208b9 in alloc::alloc::dealloc () at library/alloc/src/alloc.rs:117
#2  alloc::alloc::{impl#1}::deallocate (layout=..., self=<optimized out>, ptr=...) at library/alloc/src/alloc.rs:254
#3  alloc::raw_vec::{impl#3}::drop<u8, alloc::alloc::Global> (self=<optimized out>) at library/alloc/src/raw_vec.rs:495
#4  core::ptr::drop_in_place<alloc::raw_vec::RawVec<u8, alloc::alloc::Global>> () at library/core/src/ptr/mod.rs:498
#5  core::ptr::drop_in_place<alloc::vec::Vec<u8, alloc::alloc::Global>> () at library/core/src/ptr/mod.rs:498
#6  core::mem::drop<alloc::vec::Vec<u8, alloc::alloc::Global>> (_x=...) at library/core/src/mem/mod.rs:987
#7  proc_macro::bridge::buffer::{impl#8}::from::drop (b=...) at library/proc_macro/src/bridge/buffer.rs:151
#8  proc_macro::bridge::buffer::{impl#7}::drop (self=0x7fffe9fe3fc0) at library/proc_macro/src/bridge/buffer.rs:125
#9  core::ptr::drop_in_place<proc_macro::bridge::buffer::Buffer> () at library/core/src/ptr/mod.rs:498
#10 proc_macro::bridge::buffer::Buffer::extend_from_array<4> (self=0x7fffe9fe3fc0, xs=<optimized out>) at library/proc_macro/src/bridge/buffer.rs:66
#11 proc_macro::bridge::rpc::{impl#25}::encode<()> (self=<optimized out>, w=<optimized out>) at library/proc_macro/src/bridge/rpc.rs:129
#12 proc_macro::bridge::rpc::{impl#8}::encode<()> (self=..., w=<optimized out>, s=<optimized out>) at library/proc_macro/src/bridge/rpc.rs:162
#13 proc_macro::bridge::client::{impl#43}::encode<()> (self=..., w=0x7fffe9fe3fc0, s=<optimized out>) at library/proc_macro/src/bridge/client.rs:143
#14 proc_macro::bridge::{impl#101}::encode<(), proc_macro::bridge::client::TokenStream, proc_macro::bridge::client::Span, proc_macro::bridge::symbol::Symbol> (self=..., w=0x7fffe9fe3fc0, 
    s=<optimized out>) at library/proc_macro/src/bridge/rpc.rs:76
#15 0x00007fffdf81dcdd in proc_macro::bridge::rpc::{impl#18}::encode<(), proc_macro::bridge::TokenTree<proc_macro::bridge::client::TokenStream, proc_macro::bridge::client::Span, proc_macro::bridge::symbol::Symbol>> (self=..., w=0x7fffe9fe3fc0, s=0x7fffe9fe3f8f) at library/proc_macro/src/bridge/rpc.rs:231
#16 0x00007fffdf81974c in proc_macro::bridge::client::{impl#55}::concat_trees::{closure#0} (bridge=<optimized out>) at library/proc_macro/src/bridge/client.rs:235
#17 proc_macro::bridge::client::{impl#8}::with::{closure#0}<proc_macro::bridge::client::TokenStream, proc_macro::bridge::client::{impl#55}::concat_trees::{closure_env#0}> (
    state=<optimized out>) at library/proc_macro/src/bridge/client.rs:316
#18 proc_macro::bridge::client::{impl#7}::with::{closure#0}::{closure#0}<proc_macro::bridge::client::TokenStream, proc_macro::bridge::client::{impl#8}::with::{closure_env#0}<proc_macro::bridge::client::TokenStream, proc_macro::bridge::client::{impl#55}::concat_trees::{closure_env#0}>> (state=...) at library/proc_macro/src/bridge/client.rs:301
#19 proc_macro::bridge::scoped_cell::ScopedCell<proc_macro::bridge::client::BridgeStateL>::replace<proc_macro::bridge::client::BridgeStateL, proc_macro::bridge::client::TokenStream, proc_macro::bridge::client::{impl#7}::with::{closure#0}::{closure_env#0}<proc_macro::bridge::client::TokenStream, proc_macro::bridge::client::{impl#8}::with::{closure_env#0}<proc_macro::bridge::client::TokenStream, proc_macro::bridge::client::{impl#55}::concat_trees::{closure_env#0}>>> (self=0x7fffe8e51508, replacement=..., f=...) at library/proc_macro/src/bridge/scoped_cell.rs:74
#20 0x00007fffdf81ccf3 in proc_macro::bridge::client::{impl#7}::with::{closure#0}<proc_macro::bridge::client::TokenStream, proc_macro::bridge::client::{impl#8}::with::{closure_env#0}<proc_macro::bridge::client::TokenStream, proc_macro::bridge::client::{impl#55}::concat_trees::{closure_env#0}>> (state=0x0) at library/proc_macro/src/bridge/client.rs:299
#21 std::thread::local::LocalKey<proc_macro::bridge::scoped_cell::ScopedCell<proc_macro::bridge::client::BridgeStateL>>::try_with<proc_macro::bridge::scoped_cell::ScopedCell<proc_macro::bridge::client::BridgeStateL>, proc_macro::bridge::client::{impl#7}::with::{closure_env#0}<proc_macro::bridge::client::TokenStream, proc_macro::bridge::client::{impl#8}::with::{closure_env#0}<proc_macro::bridge::client::TokenStream, proc_macro::bridge::client::{impl#55}::concat_trees::{closure_env#0}>>, proc_macro::bridge::client::TokenStream> (f=..., self=<optimized out>)
    at library/std/src/thread/local.rs:270
#22 std::thread::local::LocalKey<proc_macro::bridge::scoped_cell::ScopedCell<proc_macro::bridge::client::BridgeStateL>>::with<proc_macro::bridge::scoped_cell::ScopedCell<proc_macro::bridge::client::BridgeStateL>, proc_macro::bridge::client::{impl#7}::with::{closure_env#0}<proc_macro::bridge::client::TokenStream, proc_macro::bridge::client::{impl#8}::with::{closure_env#0}<proc_macro::bridge::client::TokenStream, proc_macro::bridge::client::{impl#55}::concat_trees::{closure_env#0}>>, proc_macro::bridge::client::TokenStream> (self=<optimized out>, f=...)
    at library/std/src/thread/local.rs:246
#23 0x00007fffdf817f74 in proc_macro::bridge::client::BridgeState::with<proc_macro::bridge::client::TokenStream, proc_macro::bridge::client::{impl#8}::with::{closure_env#0}<proc_macro::bridge::client::TokenStream, proc_macro::bridge::client::{impl#55}::concat_trees::{closure_env#0}>> (f=<error reading variable: Cannot access memory at address 0x18>)
    at library/proc_macro/src/bridge/client.rs:298
#24 proc_macro::bridge::client::Bridge::with<proc_macro::bridge::client::TokenStream, proc_macro::bridge::client::{impl#55}::concat_trees::{closure_env#0}> (
    f=<error reading variable: Cannot access memory at address 0x18>) at library/proc_macro/src/bridge/client.rs:309
#25 proc_macro::bridge::client::TokenStream::concat_trees (base=..., trees=...) at library/proc_macro/src/bridge/client.rs:230
#26 proc_macro::ConcatTreesHelper::append_to (self=..., stream=0x7fffe9fe4288) at library/proc_macro/src/lib.rs:271
#27 0x00007fffdf80a7bd in proc_macro::{impl#21}::extend<alloc::vec::drain::Drain<proc_macro::TokenTree, alloc::alloc::Global>> (self=0x7fffe9fe4288, trees=...)
    at /home/gh-bjorn3/cg_clif/build/stdlib/library/proc_macro/src/lib.rs:342
#28 0x00007fffdf808084 in proc_macro2::imp::DeferredTokenStream::evaluate_now (self=0x7fffe9fe4270) at src/wrapper.rs:62
#29 0x00007fffdf80809f in proc_macro2::imp::DeferredTokenStream::into_token_stream (self=...) at src/wrapper.rs:67
--Type <RET> for more, q to quit, c to continue without paging--
#30 0x00007fffdf809155 in proc_macro2::imp::Group::new (delimiter=proc_macro2::Delimiter::Brace, stream=...) at src/wrapper.rs:547
#31 0x00007fffdf80f8da in proc_macro2::Group::new (delimiter=proc_macro2::Delimiter::Brace, stream=...) at src/lib.rs:677
#32 0x00007fffdf7f6773 in quote::__private::push_group (tokens=0x7fffe9fe5560, delimiter=proc_macro2::Delimiter::Brace, inner=...) at src/runtime.rs:243
#33 0x00007fffdf6fed5c in serde_derive::ser::expand_derive_serialize (input=0x7fffe9fe56f8) at src/ser.rs:42
#34 0x00007fffdf77274a in serde_derive::derive_serialize (input=...) at src/lib.rs:91
#35 0x00007fffdf71ad46 in core::ops::function::Fn::call<fn(proc_macro::TokenStream) -> proc_macro::TokenStream, (proc_macro::TokenStream)> ()
    at /home/gh-bjorn3/cg_clif/build/stdlib/library/core/src/ops/function.rs:79
#36 0x00007fffdf73481d in proc_macro::bridge::client::{impl#11}::expand1::{closure#0}::{closure#0}<fn(proc_macro::TokenStream) -> proc_macro::TokenStream> (input=...)
    at /home/gh-bjorn3/cg_clif/build/stdlib/library/proc_macro/src/bridge/client.rs:435
#37 0x00007fffdf73418f in proc_macro::bridge::client::run_client::{closure#0}::{closure#0}::{closure#0}<proc_macro::bridge::client::TokenStream, core::option::Option<proc_macro::bridge::client::TokenStream>, proc_macro::bridge::client::{impl#11}::expand1::{closure#0}::{closure_env#0}<fn(proc_macro::TokenStream) -> proc_macro::TokenStream>> ()
    at /home/gh-bjorn3/cg_clif/build/stdlib/library/proc_macro/src/bridge/client.rs:399
#38 0x00007fffdf76431d in proc_macro::bridge::scoped_cell::{impl#3}::set::{closure#0}<proc_macro::bridge::client::BridgeStateL, (), proc_macro::bridge::client::run_client::{closure#0}::{closure#0}::{closure_env#0}<proc_macro::bridge::client::TokenStream, core::option::Option<proc_macro::bridge::client::TokenStream>, proc_macro::bridge::client::{impl#11}::expand1::{closure#0}::{closure_env#0}<fn(proc_macro::TokenStream) -> proc_macro::TokenStream>>> () at /home/gh-bjorn3/cg_clif/build/stdlib/library/proc_macro/src/bridge/scoped_cell.rs:79
#39 0x00007fffdf76469e in proc_macro::bridge::scoped_cell::ScopedCell<proc_macro::bridge::client::BridgeStateL>::replace<proc_macro::bridge::client::BridgeStateL, (), proc_macro::bridge::scoped_cell::{impl#3}::set::{closure_env#0}<proc_macro::bridge::client::BridgeStateL, (), proc_macro::bridge::client::run_client::{closure#0}::{closure#0}::{closure_env#0}<proc_macro::bridge::client::TokenStream, core::option::Option<proc_macro::bridge::client::TokenStream>, proc_macro::bridge::client::{impl#11}::expand1::{closure#0}::{closure_env#0}<fn(proc_macro::TokenStream) -> proc_macro::TokenStream>>>> (self=0x7fffe8e51508, replacement=..., f=...) at /home/gh-bjorn3/cg_clif/build/stdlib/library/proc_macro/src/bridge/scoped_cell.rs:74
#40 0x00007fffdf734162 in proc_macro::bridge::scoped_cell::ScopedCell<proc_macro::bridge::client::BridgeStateL>::set<proc_macro::bridge::client::BridgeStateL, (), proc_macro::bridge::client::run_client::{closure#0}::{closure#0}::{closure_env#0}<proc_macro::bridge::client::TokenStream, core::option::Option<proc_macro::bridge::client::TokenStream>, proc_macro::bridge::client::{impl#11}::expand1::{closure#0}::{closure_env#0}<fn(proc_macro::TokenStream) -> proc_macro::TokenStream>>> (self=<optimized out>, 
    value=<error reading variable: Cannot access memory at address 0x0>, f=...) at /home/gh-bjorn3/cg_clif/build/stdlib/library/proc_macro/src/bridge/scoped_cell.rs:79
#41 proc_macro::bridge::client::run_client::{closure#0}::{closure#0}<proc_macro::bridge::client::TokenStream, core::option::Option<proc_macro::bridge::client::TokenStream>, proc_macro::bridge::client::{impl#11}::expand1::{closure#0}::{closure_env#0}<fn(proc_macro::TokenStream) -> proc_macro::TokenStream>> (state=0x7fffe8e51508)
    at /home/gh-bjorn3/cg_clif/build/stdlib/library/proc_macro/src/bridge/client.rs:398
#42 0x00007fffdf719097 in std::thread::local::LocalKey<proc_macro::bridge::scoped_cell::ScopedCell<proc_macro::bridge::client::BridgeStateL>>::try_with<proc_macro::bridge::scoped_cell::ScopedCell<proc_macro::bridge::client::BridgeStateL>, proc_macro::bridge::client::run_client::{closure#0}::{closure_env#0}<proc_macro::bridge::client::TokenStream, core::option::Option<proc_macro::bridge::client::TokenStream>, proc_macro::bridge::client::{impl#11}::expand1::{closure#0}::{closure_env#0}<fn(proc_macro::TokenStream) -> proc_macro::TokenStream>>, ()> (
    self=0x7fffdf873c80, f=...) at /home/gh-bjorn3/cg_clif/build/stdlib/library/std/src/thread/local.rs:270
#43 0x00007fffdf718e63 in std::thread::local::LocalKey<proc_macro::bridge::scoped_cell::ScopedCell<proc_macro::bridge::client::BridgeStateL>>::with<proc_macro::bridge::scoped_cell::ScopedCell<proc_macro::bridge::client::BridgeStateL>, proc_macro::bridge::client::run_client::{closure#0}::{closure_env#0}<proc_macro::bridge::client::TokenStream, core::option::Option<proc_macro::bridge::client::TokenStream>, proc_macro::bridge::client::{impl#11}::expand1::{closure#0}::{closure_env#0}<fn(proc_macro::TokenStream) -> proc_macro::TokenStream>>, ()> (
    self=0x7fffdf873c80, f=...) at /home/gh-bjorn3/cg_clif/build/stdlib/library/std/src/thread/local.rs:246
#44 0x00007fffdf734039 in proc_macro::bridge::client::run_client::{closure#0}<proc_macro::bridge::client::TokenStream, core::option::Option<proc_macro::bridge::client::TokenStream>, proc_macro::bridge::client::{impl#11}::expand1::{closure#0}::{closure_env#0}<fn(proc_macro::TokenStream) -> proc_macro::TokenStream>> ()
    at /home/gh-bjorn3/cg_clif/build/stdlib/library/proc_macro/src/bridge/client.rs:397
#45 0x00007fffdf72cf60 in core::panic::unwind_safe::{impl#23}::call_once<(), proc_macro::bridge::client::run_client::{closure_env#0}<proc_macro::bridge::client::TokenStream, core::option::Option<proc_macro::bridge::client::TokenStream>, proc_macro::bridge::client::{impl#11}::expand1::{closure#0}::{closure_env#0}<fn(proc_macro::TokenStream) -> proc_macro::TokenStream>>> (
    self=...) at /home/gh-bjorn3/cg_clif/build/stdlib/library/core/src/panic/unwind_safe.rs:265
#46 0x00007fffdf76d104 in std::panicking::try::do_call<core::panic::unwind_safe::AssertUnwindSafe<proc_macro::bridge::client::run_client::{closure_env#0}<proc_macro::bridge::client::TokenStream, core::option::Option<proc_macro::bridge::client::TokenStream>, proc_macro::bridge::client::{impl#11}::expand1::{closure#0}::{closure_env#0}<fn(proc_macro::TokenStream) -> proc_macro::TokenStream>>>, ()> (data=0x7fffe9fe6250) at /home/gh-bjorn3/cg_clif/build/stdlib/library/std/src/panicking.rs:504
#47 0x00007fffdf76d011 in std::panicking::try<(), core::panic::unwind_safe::AssertUnwindSafe<proc_macro::bridge::client::run_client::{closure_env#0}<proc_macro::bridge::client::TokenStream, core::option::Option<proc_macro::bridge::client::TokenStream>, proc_macro::bridge::client::{impl#11}::expand1::{closure#0}::{closure_env#0}<fn(proc_macro::TokenStream) -> proc_macro::TokenStream>>>> (f=...) at /home/gh-bjorn3/cg_clif/build/stdlib/library/std/src/panicking.rs:468
#48 0x00007fffdf73389a in std::panic::catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<proc_macro::bridge::client::run_client::{closure_env#0}<proc_macro::bridge::client::TokenStream--Type <RET> for more, q to quit, c to continue without paging--
, core::option::Option<proc_macro::bridge::client::TokenStream>, proc_macro::bridge::client::{impl#11}::expand1::{closure#0}::{closure_env#0}<fn(proc_macro::TokenStream) -> proc_macro::TokenStream>>>, ()> (f=...) at /home/gh-bjorn3/cg_clif/build/stdlib/library/std/src/panic.rs:142
#49 proc_macro::bridge::client::run_client<proc_macro::bridge::client::TokenStream, core::option::Option<proc_macro::bridge::client::TokenStream>, proc_macro::bridge::client::{impl#11}::expand1::{closure#0}::{closure_env#0}<fn(proc_macro::TokenStream) -> proc_macro::TokenStream>> (config=..., f=...)
    at /home/gh-bjorn3/cg_clif/build/stdlib/library/proc_macro/src/bridge/client.rs:384
#50 0x00007fffdf73479d in proc_macro::bridge::client::{impl#11}::expand1::{closure#0}<fn(proc_macro::TokenStream) -> proc_macro::TokenStream> (bridge=...)
    at /home/gh-bjorn3/cg_clif/build/stdlib/library/proc_macro/src/bridge/client.rs:435
#51 0x00007fffdf757bb6 in proc_macro::bridge::selfless_reify::reify_to_extern_c_fn_hrt_bridge::wrapper<proc_macro::bridge::buffer::Buffer, proc_macro::bridge::client::{impl#11}::expand1::{closure_env#0}<fn(proc_macro::TokenStream) -> proc_macro::TokenStream>> (bridge=...) at /home/gh-bjorn3/cg_clif/build/stdlib/library/proc_macro/src/bridge/selfless_reify.rs:64
#52 0x00007ffff6cd7be5 in <proc_macro::bridge::server::MaybeCrossThread<rustc_expand::proc_macro::CrossbeamMessagePipe<proc_macro::bridge::buffer::Buffer>> as proc_macro::bridge::server::ExecutionStrategy>::run_bridge_and_client::<proc_macro::bridge::server::Dispatcher<proc_macro::bridge::server::MarkedTypes<rustc_expand::proc_macro_server::Rustc>>> ()
   from /home/gh-bjorn3/.rustup/toolchains/nightly-2023-10-19-x86_64-unknown-linux-gnu/lib/librustc_driver-23a67d38c44b77fd.so
#53 0x00007ffff6cd787b in <proc_macro::bridge::client::Client<proc_macro::TokenStream, proc_macro::TokenStream>>::run::<rustc_expand::proc_macro_server::Rustc, proc_macro::bridge::server::MaybeCrossThread<rustc_expand::proc_macro::CrossbeamMessagePipe<proc_macro::bridge::buffer::Buffer>>> ()
   from /home/gh-bjorn3/.rustup/toolchains/nightly-2023-10-19-x86_64-unknown-linux-gnu/lib/librustc_driver-23a67d38c44b77fd.so
#54 0x00007ffff6f02df0 in <rustc_expand::proc_macro::DeriveProcMacro as rustc_expand::base::MultiItemModifier>::expand ()
   from /home/gh-bjorn3/.rustup/toolchains/nightly-2023-10-19-x86_64-unknown-linux-gnu/lib/librustc_driver-23a67d38c44b77fd.so
#55 0x00007ffff6bbf9ea in <rustc_expand::expand::MacroExpander>::fully_expand_fragment ()
   from /home/gh-bjorn3/.rustup/toolchains/nightly-2023-10-19-x86_64-unknown-linux-gnu/lib/librustc_driver-23a67d38c44b77fd.so
#56 0x00007ffff6bbde78 in <rustc_expand::expand::MacroExpander>::expand_crate ()
   from /home/gh-bjorn3/.rustup/toolchains/nightly-2023-10-19-x86_64-unknown-linux-gnu/lib/librustc_driver-23a67d38c44b77fd.so
#57 0x00007ffff6f1ac5f in rustc_interface::passes::resolver_for_lowering ()
   from /home/gh-bjorn3/.rustup/toolchains/nightly-2023-10-19-x86_64-unknown-linux-gnu/lib/librustc_driver-23a67d38c44b77fd.so
#58 0x00007ffff6f1a12b in rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::resolver_for_lowering::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>> () from /home/gh-bjorn3/.rustup/toolchains/nightly-2023-10-19-x86_64-unknown-linux-gnu/lib/librustc_driver-23a67d38c44b77fd.so
#59 0x00007ffff6f191b3 in rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false> ()
   from /home/gh-bjorn3/.rustup/toolchains/nightly-2023-10-19-x86_64-unknown-linux-gnu/lib/librustc_driver-23a67d38c44b77fd.so
#60 0x00007ffff6f18849 in rustc_query_impl::query_impl::resolver_for_lowering::get_query_non_incr::__rust_end_short_backtrace ()
   from /home/gh-bjorn3/.rustup/toolchains/nightly-2023-10-19-x86_64-unknown-linux-gnu/lib/librustc_driver-23a67d38c44b77fd.so
#61 0x00007ffff6f27ccb in std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>> () from /home/gh-bjorn3/.rustup/toolchains/nightly-2023-10-19-x86_64-unknown-linux-gnu/lib/librustc_driver-23a67d38c44b77fd.so
#62 0x00007ffff6f271b3 in <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} ()
   from /home/gh-bjorn3/.rustup/toolchains/nightly-2023-10-19-x86_64-unknown-linux-gnu/lib/librustc_driver-23a67d38c44b77fd.so
#63 0x00007ffff2576f05 in alloc::boxed::{impl#47}::call_once<(), dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global> () at library/alloc/src/boxed.rs:2007
#64 alloc::boxed::{impl#47}::call_once<(), alloc::boxed::Box<dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global>, alloc::alloc::Global> ()
    at library/alloc/src/boxed.rs:2007
#65 std::sys::unix::thread::{impl#2}::new::thread_start () at library/std/src/sys/unix/thread.rs:108
#66 0x00007ffff2302ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#67 0x00007ffff2394a40 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

@bjorn3 bjorn3 added I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-bug Category: This is a bug. regression-untriaged Untriaged performance or correctness regression. labels Oct 20, 2023
@rustbot rustbot added I-prioritize Issue: Indicates that prioritization has been requested for this issue. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Oct 20, 2023
@bjorn3
Copy link
Member Author

bjorn3 commented Oct 20, 2023

This requires disabling incremental compilation as well as using a custom built sysroot. I'm not passing any weird arguments when building the sysroot and because of the --use-backend llvm everything is compiled using the regular LLVM backend.

@bjorn3
Copy link
Member Author

bjorn3 commented Oct 20, 2023

This is causing cg_clif's CI to fail as it checks that it's test suite passes with LLVM: https://github.com/bjorn3/rustc_codegen_cranelift/actions/runs/6574776266/job/17861480553

@DianQK
Copy link
Member

DianQK commented Oct 21, 2023

A workaround is:

[profile.dev.package.proc_macro]
codegen-units = 1

A small reproduction is:

use serde::Serialize;

#[derive(Serialize)]
struct Internal {
}

@DianQK
Copy link
Member

DianQK commented Oct 22, 2023

It may be an alias related issue. I am not really sure. But I started trying to address it.

@rustbot claim

@apiraino
Copy link
Contributor

WG-prioritization assigning priority (Zulip discussion).

@rustbot label -I-prioritize +P-high T-compiler

@rustbot rustbot added P-high High priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Oct 23, 2023
@DianQK
Copy link
Member

DianQK commented Oct 25, 2023

Possible upstream issue: llvm/llvm-project#70158.

@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 28, 2023
@DianQK
Copy link
Member

DianQK commented Oct 29, 2023

Upstream issue: llvm/llvm-project#70578.
I'm pretty sure I got it right this time.

bors added a commit to rust-lang-ci/rust that referenced this issue Nov 1, 2023
@bors bors closed this as completed in d1611e3 Nov 1, 2023
3tilley pushed a commit to 3tilley/rust that referenced this issue Nov 1, 2023
@bjorn3
Copy link
Member Author

bjorn3 commented Nov 2, 2023

It is indeed fixed now: https://github.com/rust-lang/rustc_codegen_cranelift/actions/runs/6731313582/job/18295728423

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-bug Category: This is a bug. I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. P-high High priority regression-untriaged Untriaged performance or correctness regression. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants