Skip to content

Rust-gpu main fails to build #242

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

Open
simensgreen opened this issue Apr 24, 2025 · 8 comments
Open

Rust-gpu main fails to build #242

simensgreen opened this issue Apr 24, 2025 · 8 comments
Labels
bug Something isn't working

Comments

@simensgreen
Copy link

Expected Behaviour

Successful compilation

Example & Steps To Reproduce

  1. clone repository https://github.com./simensgreen/rust_gpu_union_issue
  2. cargo build

System Info

  • Rust: rustc 1.84.0-nightly (b19329a37 2024-11-21)
  • OS: MacOS 15.3.2
  • GPU: M2 Max

Backtrace

Backtrace

thread 'rustc' panicked at compiler/rustc_middle/src/ty/mod.rs:1676:13:
Box<dyn Any>
stack backtrace:
   0:        0x1129ed7b0 - std::backtrace::Backtrace::create::hf5e5ba1728bb8de7
   1:        0x110844da8 - <alloc[e2e5e8515d00274d]::boxed::Box<rustc_driver_impl[c6ade677a6b0e20c]::install_ice_hook::{closure#0}> as core[924c651d484e1a25]::ops::function::Fn<(&dyn for<'a, 'b> core[924c651d484e1a25]::ops::function::Fn<(&'a std[fc297465fa958267]::panic::PanicHookInfo<'b>,), Output = ()> + core[924c651d484e1a25]::marker::Send + core[924c651d484e1a25]::marker::Sync, &std[fc297465fa958267]::panic::PanicHookInfo)>>::call
   2:        0x110844bb0 - <alloc[e2e5e8515d00274d]::boxed::Box<rustc_driver_impl[c6ade677a6b0e20c]::install_ice_hook::{closure#0}> as core[924c651d484e1a25]::ops::function::Fn<(&dyn for<'a, 'b> core[924c651d484e1a25]::ops::function::Fn<(&'a std[fc297465fa958267]::panic::PanicHookInfo<'b>,), Output = ()> + core[924c651d484e1a25]::marker::Send + core[924c651d484e1a25]::marker::Sync, &std[fc297465fa958267]::panic::PanicHookInfo)>>::call
   3:        0x112a07edc - std::panicking::rust_panic_with_hook::heb73fc7746f92ba7
   4:        0x1108e9718 - std[fc297465fa958267]::panicking::begin_panic::<rustc_errors[caf545eadef7fdd]::ExplicitBug>::{closure#0}
   5:        0x1108e94d0 - std[fc297465fa958267]::sys::backtrace::__rust_end_short_backtrace::<std[fc297465fa958267]::panicking::begin_panic<rustc_errors[caf545eadef7fdd]::ExplicitBug>::{closure#0}, !>
   6:        0x11516c04c - std[fc297465fa958267]::panicking::begin_panic::<rustc_errors[caf545eadef7fdd]::ExplicitBug>
   7:        0x1108efad4 - <rustc_errors[caf545eadef7fdd]::diagnostic::BugAbort as rustc_errors[caf545eadef7fdd]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
   8:        0x111590098 - rustc_middle[dc5a577fd6f5eb51]::util::bug::opt_span_bug_fmt::<rustc_span[60df94d8028129a3]::span_encoding::Span>::{closure#0}
   9:        0x11158eb1c - rustc_middle[dc5a577fd6f5eb51]::ty::context::tls::with_opt::<rustc_middle[dc5a577fd6f5eb51]::util::bug::opt_span_bug_fmt<rustc_span[60df94d8028129a3]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  10:        0x11158eae8 - rustc_middle[dc5a577fd6f5eb51]::ty::context::tls::with_context_opt::<rustc_middle[dc5a577fd6f5eb51]::ty::context::tls::with_opt<rustc_middle[dc5a577fd6f5eb51]::util::bug::opt_span_bug_fmt<rustc_span[60df94d8028129a3]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  11:        0x115218d90 - rustc_middle[dc5a577fd6f5eb51]::util::bug::bug_fmt
  12:        0x11154678c - <rustc_middle[dc5a577fd6f5eb51]::ty::context::TyCtxt>::item_name
  13:        0x10a88e08c - rustc_codegen_spirv::codegen_cx::declare::<impl rustc_codegen_spirv::codegen_cx::CodegenCx>::declare_fn_ext::h62af5aed91b065ab
  14:        0x10a88f6bc - rustc_codegen_spirv::codegen_cx::declare::<impl rustc_codegen_spirv::maybe_pqp_cg_ssa::traits::declare::PreDefineCodegenMethods for rustc_codegen_spirv::codegen_cx::CodegenCx>::predefine_fn::hb68792579dcb451d
  15:        0x10a81f738 - <rustc_middle::mir::mono::MonoItem as rustc_codegen_spirv::maybe_pqp_cg_ssa::mono_item::MonoItemExt>::predefine::h9fc0a1eadbbb089b
  16:        0x10a803d74 - <rustc_codegen_spirv::SpirvCodegenBackend as rustc_codegen_spirv::maybe_pqp_cg_ssa::traits::backend::ExtraBackendMethods>::compile_codegen_unit::{{closure}}::h0debe4e59a7b21f1
  17:        0x10a803820 - <rustc_codegen_spirv::SpirvCodegenBackend as rustc_codegen_spirv::maybe_pqp_cg_ssa::traits::backend::ExtraBackendMethods>::compile_codegen_unit::h1919ebc51166cdfc
  18:        0x10a8a55e0 - rustc_codegen_spirv::maybe_pqp_cg_ssa::base::codegen_crate::hef28e44872569f65
  19:        0x10a8024f8 - <rustc_codegen_spirv::SpirvCodegenBackend as rustc_codegen_spirv::maybe_pqp_cg_ssa::traits::backend::CodegenBackend>::codegen_crate::hffbf186d2f0b9484
  20:        0x1110dbad8 - <rustc_session[3e2f7db2cc04b493]::session::Session>::time::<alloc[e2e5e8515d00274d]::boxed::Box<dyn core[924c651d484e1a25]::any::Any>, rustc_interface[fb6f1569d3f1850c]::passes::start_codegen::{closure#0}>
  21:        0x11120add4 - rustc_interface[fb6f1569d3f1850c]::passes::start_codegen
  22:        0x1111985f0 - <rustc_interface[fb6f1569d3f1850c]::queries::Linker>::codegen_and_build_linker
  23:        0x11082dd20 - <rustc_middle[dc5a577fd6f5eb51]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[c6ade677a6b0e20c]::run_compiler::{closure#0}::{closure#1}::{closure#7}, core[924c651d484e1a25]::result::Result<core[924c651d484e1a25]::option::Option<rustc_interface[fb6f1569d3f1850c]::queries::Linker>, rustc_span[60df94d8028129a3]::ErrorGuaranteed>>
  24:        0x1107f51b0 - <rustc_interface[fb6f1569d3f1850c]::interface::Compiler>::enter::<rustc_driver_impl[c6ade677a6b0e20c]::run_compiler::{closure#0}::{closure#1}, core[924c651d484e1a25]::result::Result<core[924c651d484e1a25]::option::Option<rustc_interface[fb6f1569d3f1850c]::queries::Linker>, rustc_span[60df94d8028129a3]::ErrorGuaranteed>>
  25:        0x110837588 - rustc_span[60df94d8028129a3]::create_session_globals_then::<core[924c651d484e1a25]::result::Result<(), rustc_span[60df94d8028129a3]::ErrorGuaranteed>, rustc_interface[fb6f1569d3f1850c]::util::run_in_thread_with_globals<rustc_interface[fb6f1569d3f1850c]::util::run_in_thread_pool_with_globals<rustc_interface[fb6f1569d3f1850c]::interface::run_compiler<core[924c651d484e1a25]::result::Result<(), rustc_span[60df94d8028129a3]::ErrorGuaranteed>, rustc_driver_impl[c6ade677a6b0e20c]::run_compiler::{closure#0}>::{closure#1}, core[924c651d484e1a25]::result::Result<(), rustc_span[60df94d8028129a3]::ErrorGuaranteed>>::{closure#0}, core[924c651d484e1a25]::result::Result<(), rustc_span[60df94d8028129a3]::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}>
  26:        0x11081f588 - std[fc297465fa958267]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[fb6f1569d3f1850c]::util::run_in_thread_with_globals<rustc_interface[fb6f1569d3f1850c]::util::run_in_thread_pool_with_globals<rustc_interface[fb6f1569d3f1850c]::interface::run_compiler<core[924c651d484e1a25]::result::Result<(), rustc_span[60df94d8028129a3]::ErrorGuaranteed>, rustc_driver_impl[c6ade677a6b0e20c]::run_compiler::{closure#0}>::{closure#1}, core[924c651d484e1a25]::result::Result<(), rustc_span[60df94d8028129a3]::ErrorGuaranteed>>::{closure#0}, core[924c651d484e1a25]::result::Result<(), rustc_span[60df94d8028129a3]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[924c651d484e1a25]::result::Result<(), rustc_span[60df94d8028129a3]::ErrorGuaranteed>>
  27:        0x110822b54 - <<std[fc297465fa958267]::thread::Builder>::spawn_unchecked_<rustc_interface[fb6f1569d3f1850c]::util::run_in_thread_with_globals<rustc_interface[fb6f1569d3f1850c]::util::run_in_thread_pool_with_globals<rustc_interface[fb6f1569d3f1850c]::interface::run_compiler<core[924c651d484e1a25]::result::Result<(), rustc_span[60df94d8028129a3]::ErrorGuaranteed>, rustc_driver_impl[c6ade677a6b0e20c]::run_compiler::{closure#0}>::{closure#1}, core[924c651d484e1a25]::result::Result<(), rustc_span[60df94d8028129a3]::ErrorGuaranteed>>::{closure#0}, core[924c651d484e1a25]::result::Result<(), rustc_span[60df94d8028129a3]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[924c651d484e1a25]::result::Result<(), rustc_span[60df94d8028129a3]::ErrorGuaranteed>>::{closure#1} as core[924c651d484e1a25]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  28:        0x112a11fe8 - std::sys::pal::unix::thread::Thread::new::thread_start::h5a3f92a0fdbf8eb0
  29:        0x1978002e4 - __pthread_deallocate


rustc version: 1.84.0-nightly (b19329a37 2024-11-21)
platform: aarch64-apple-darwin

query stack during panic:
end of query stack
thread 'rustc' panicked at compiler/rustc_middle/src/ty/mod.rs:1676:13:
Box<dyn Any>
stack backtrace:
   0:        0x1129ed7b0 - std::backtrace::Backtrace::create::hf5e5ba1728bb8de7
   1:        0x110844da8 - <alloc[e2e5e8515d00274d]::boxed::Box<rustc_driver_impl[c6ade677a6b0e20c]::install_ice_hook::{closure#0}> as core[924c651d484e1a25]::ops::function::Fn<(&dyn for<'a, 'b> core[924c651d484e1a25]::ops::function::Fn<(&'a std[fc297465fa958267]::panic::PanicHookInfo<'b>,), Output = ()> + core[924c651d484e1a25]::marker::Send + core[924c651d484e1a25]::marker::Sync, &std[fc297465fa958267]::panic::PanicHookInfo)>>::call
   2:        0x112a07edc - std::panicking::rust_panic_with_hook::heb73fc7746f92ba7
   3:        0x1108e9718 - std[fc297465fa958267]::panicking::begin_panic::<rustc_errors[caf545eadef7fdd]::ExplicitBug>::{closure#0}
   4:        0x1108e94d0 - std[fc297465fa958267]::sys::backtrace::__rust_end_short_backtrace::<std[fc297465fa958267]::panicking::begin_panic<rustc_errors[caf545eadef7fdd]::ExplicitBug>::{closure#0}, !>
   5:        0x11516c04c - std[fc297465fa958267]::panicking::begin_panic::<rustc_errors[caf545eadef7fdd]::ExplicitBug>
   6:        0x1108efad4 - <rustc_errors[caf545eadef7fdd]::diagnostic::BugAbort as rustc_errors[caf545eadef7fdd]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
   7:        0x111590098 - rustc_middle[dc5a577fd6f5eb51]::util::bug::opt_span_bug_fmt::<rustc_span[60df94d8028129a3]::span_encoding::Span>::{closure#0}
   8:        0x11158eb1c - rustc_middle[dc5a577fd6f5eb51]::ty::context::tls::with_opt::<rustc_middle[dc5a577fd6f5eb51]::util::bug::opt_span_bug_fmt<rustc_span[60df94d8028129a3]::span_encoding::Span>::{closure#0}, !>::{closure#0}
   9:        0x11158eae8 - rustc_middle[dc5a577fd6f5eb51]::ty::context::tls::with_context_opt::<rustc_middle[dc5a577fd6f5eb51]::ty::context::tls::with_opt<rustc_middle[dc5a577fd6f5eb51]::util::bug::opt_span_bug_fmt<rustc_span[60df94d8028129a3]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  10:        0x115218d90 - rustc_middle[dc5a577fd6f5eb51]::util::bug::bug_fmt
  11:        0x11154678c - <rustc_middle[dc5a577fd6f5eb51]::ty::context::TyCtxt>::item_name
  12:        0x10a88e08c - rustc_codegen_spirv::codegen_cx::declare::<impl rustc_codegen_spirv::codegen_cx::CodegenCx>::declare_fn_ext::h62af5aed91b065ab
  13:        0x10a88f6bc - rustc_codegen_spirv::codegen_cx::declare::<impl rustc_codegen_spirv::maybe_pqp_cg_ssa::traits::declare::PreDefineCodegenMethods for rustc_codegen_spirv::codegen_cx::CodegenCx>::predefine_fn::hb68792579dcb451d
  14:        0x10a81f738 - <rustc_middle::mir::mono::MonoItem as rustc_codegen_spirv::maybe_pqp_cg_ssa::mono_item::MonoItemExt>::predefine::h9fc0a1eadbbb089b
  15:        0x10a803d74 - <rustc_codegen_spirv::SpirvCodegenBackend as rustc_codegen_spirv::maybe_pqp_cg_ssa::traits::backend::ExtraBackendMethods>::compile_codegen_unit::{{closure}}::h0debe4e59a7b21f1
  16:        0x10a803820 - <rustc_codegen_spirv::SpirvCodegenBackend as rustc_codegen_spirv::maybe_pqp_cg_ssa::traits::backend::ExtraBackendMethods>::compile_codegen_unit::h1919ebc51166cdfc
  17:        0x10a8a55e0 - rustc_codegen_spirv::maybe_pqp_cg_ssa::base::codegen_crate::hef28e44872569f65
  18:        0x10a8024f8 - <rustc_codegen_spirv::SpirvCodegenBackend as rustc_codegen_spirv::maybe_pqp_cg_ssa::traits::backend::CodegenBackend>::codegen_crate::hffbf186d2f0b9484
  19:        0x1110dbad8 - <rustc_session[3e2f7db2cc04b493]::session::Session>::time::<alloc[e2e5e8515d00274d]::boxed::Box<dyn core[924c651d484e1a25]::any::Any>, rustc_interface[fb6f1569d3f1850c]::passes::start_codegen::{closure#0}>
  20:        0x11120add4 - rustc_interface[fb6f1569d3f1850c]::passes::start_codegen
  21:        0x1111985f0 - <rustc_interface[fb6f1569d3f1850c]::queries::Linker>::codegen_and_build_linker
  22:        0x11082dd20 - <rustc_middle[dc5a577fd6f5eb51]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[c6ade677a6b0e20c]::run_compiler::{closure#0}::{closure#1}::{closure#7}, core[924c651d484e1a25]::result::Result<core[924c651d484e1a25]::option::Option<rustc_interface[fb6f1569d3f1850c]::queries::Linker>, rustc_span[60df94d8028129a3]::ErrorGuaranteed>>
  23:        0x1107f51b0 - <rustc_interface[fb6f1569d3f1850c]::interface::Compiler>::enter::<rustc_driver_impl[c6ade677a6b0e20c]::run_compiler::{closure#0}::{closure#1}, core[924c651d484e1a25]::result::Result<core[924c651d484e1a25]::option::Option<rustc_interface[fb6f1569d3f1850c]::queries::Linker>, rustc_span[60df94d8028129a3]::ErrorGuaranteed>>
  24:        0x110837588 - rustc_span[60df94d8028129a3]::create_session_globals_then::<core[924c651d484e1a25]::result::Result<(), rustc_span[60df94d8028129a3]::ErrorGuaranteed>, rustc_interface[fb6f1569d3f1850c]::util::run_in_thread_with_globals<rustc_interface[fb6f1569d3f1850c]::util::run_in_thread_pool_with_globals<rustc_interface[fb6f1569d3f1850c]::interface::run_compiler<core[924c651d484e1a25]::result::Result<(), rustc_span[60df94d8028129a3]::ErrorGuaranteed>, rustc_driver_impl[c6ade677a6b0e20c]::run_compiler::{closure#0}>::{closure#1}, core[924c651d484e1a25]::result::Result<(), rustc_span[60df94d8028129a3]::ErrorGuaranteed>>::{closure#0}, core[924c651d484e1a25]::result::Result<(), rustc_span[60df94d8028129a3]::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}>
  25:        0x11081f588 - std[fc297465fa958267]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[fb6f1569d3f1850c]::util::run_in_thread_with_globals<rustc_interface[fb6f1569d3f1850c]::util::run_in_thread_pool_with_globals<rustc_interface[fb6f1569d3f1850c]::interface::run_compiler<core[924c651d484e1a25]::result::Result<(), rustc_span[60df94d8028129a3]::ErrorGuaranteed>, rustc_driver_impl[c6ade677a6b0e20c]::run_compiler::{closure#0}>::{closure#1}, core[924c651d484e1a25]::result::Result<(), rustc_span[60df94d8028129a3]::ErrorGuaranteed>>::{closure#0}, core[924c651d484e1a25]::result::Result<(), rustc_span[60df94d8028129a3]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[924c651d484e1a25]::result::Result<(), rustc_span[60df94d8028129a3]::ErrorGuaranteed>>
  26:        0x110822b54 - <<std[fc297465fa958267]::thread::Builder>::spawn_unchecked_<rustc_interface[fb6f1569d3f1850c]::util::run_in_thread_with_globals<rustc_interface[fb6f1569d3f1850c]::util::run_in_thread_pool_with_globals<rustc_interface[fb6f1569d3f1850c]::interface::run_compiler<core[924c651d484e1a25]::result::Result<(), rustc_span[60df94d8028129a3]::ErrorGuaranteed>, rustc_driver_impl[c6ade677a6b0e20c]::run_compiler::{closure#0}>::{closure#1}, core[924c651d484e1a25]::result::Result<(), rustc_span[60df94d8028129a3]::ErrorGuaranteed>>::{closure#0}, core[924c651d484e1a25]::result::Result<(), rustc_span[60df94d8028129a3]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[924c651d484e1a25]::result::Result<(), rustc_span[60df94d8028129a3]::ErrorGuaranteed>>::{closure#1} as core[924c651d484e1a25]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  27:        0x112a11fe8 - std::sys::pal::unix::thread::Thread::new::thread_start::h5a3f92a0fdbf8eb0
  28:        0x1978002e4 - __pthread_deallocate


query stack during panic:
end of query stack

@simensgreen simensgreen added the bug Something isn't working label Apr 24, 2025
@simensgreen simensgreen changed the title (my bug report) Rust-gpu main fails to build Apr 24, 2025
@LegNeato

This comment has been minimized.

@LegNeato
Copy link
Collaborator

LegNeato commented Apr 24, 2025

I am getting a panic here:

"missing libm intrinsic {symbol_name}, which is {instance}"

@LegNeato

This comment has been minimized.

@LegNeato
Copy link
Collaborator

Ok, looks like updating the lockfile causes issues:

https://github.com./Rust-GPU/rust-gpu/actions/runs/14645774261/job/41099428403?pr=243

So it is in one of those.

@LegNeato
Copy link
Collaborator

LegNeato commented Apr 24, 2025

This was probably caused by libm releasing 0.2.13 2 days ago. Can't find the issue right now, will look later if someone hasn't beaten me to it.

@simensgreen
Copy link
Author

Yeah, if force libm to 0.2.11 this error disappears. Check out https://github.com./simensgreen/rust_gpu_union_issue/tree/libm-fixed

@LegNeato
Copy link
Collaborator

Ok, so something about our symbol resolution when swapping out libm intrinsics is messing up with the new versions.

@LegNeato
Copy link
Collaborator

I don't have time to bisect, but a good candidate is rust-lang/compiler-builtins@161036a. My hunch is because these are inlined, we can't replace the symbol because the symbol doesn't exist because they're inlined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants