Rust-GPU / Rust-GPU/rust-gpu

[Migrated] Compiling uom crashes the compiler

Aperta
#56 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
Rust
Stelle
3.4k
Fork
126
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Issue automatically imported from old repo: https://github.com/EmbarkStudios/rust-gpu/issues/1150
Old labels: t: bug
Originally creatd by JensGM on 2024-05-21T12:17:15Z


Expected Behaviour

Compile doesn't fail

Example & Steps To Reproduce
  1. Write a shader with a dependency on uom

System Info

  • Rust: rustc 1.74.0-nightly (8ce4540bd 2023-09-29)
  • OS: macos 14.5 (23F79)
  • GPU: m1 pro

Backtrace

Updating crates.io index Compiling uom v0.36.0 thread 'rustc' panicked at /Users/jens/sources/rust-gpu/crates/rustc_codegen_spirv/src/builder/builder_methods.rs:521:34: attempt to divide by zero stack backtrace: 0: 0x1052144dc - ::fmt::h8895b8b562a90ee4 1: 0x105267f58 - core::fmt::write::h7a9cc4d1d610bd71 2: 0x10520a08c - std::io::Write::write_fmt::h87ff59bc697656ff 3: 0x10521431c - std::sys_common::backtrace::print::ha692d990665b4a43 4: 0x105216f18 - std::panicking::default_hook::{{closure}}::hf23c7dbcec5e5d80 5: 0x105216c30 - std::panicking::default_hook::h6d5fe0c884e09021 6: 0x10d7596fc - as core[49eafda268333cb]::ops::function::Fn<(&dyn for<'a, 'b> core[49eafda268333cb]::ops::func tion::Fn<(&'a core[49eafda268333cb]::panic::panic_info::PanicInfo<'b>,), Output = ()> + core[49eafda268333cb]::marker::Sync + core[49eafda268333cb]::marker::Send, &core[49eafda268333cb]::panic::panic_info::PanicInfo)>>::call 7: 0x10d7596fc - as core[49eafda268333cb]::ops::function::Fn<(&dyn for<'a, 'b> core[49eafda268333cb]::ops::func tion::Fn<(&'a core[49eafda268333cb]::panic::panic_info::PanicInfo<'b>,), Output = ()> + core[49eafda268333cb]::marker::Sync + core[49eafda268333cb]::marker::Send, &core[49eafda268333cb]::panic::panic_info::PanicInfo)>>::call 8: 0x1052176b0 - std::panicking::rust_panic_with_hook::h7c3b2a0098acc318 9: 0x10521743c - std::panicking::begin_panic_handler::{{closure}}::h5a56c37d4253c5c6 10: 0x105214968 - std::sys_common::backtrace::__rust_end_short_backtrace::h6240b1fcaf592476 11: 0x1052171e8 - _rust_begin_unwind 12: 0x1052932c0 - core::panicking::panic_fmt::h665dccaf061d2198 13: 0x105293334 - core::panicking::panic::he1ba182bf716bbc2 14: 0x106c7099c - rustc_codegen_spirv::builder::builder_methods::::recover_access_chain_from_offset::he6b0c04ddb3305e7 15: 0x106c76c2c - rustc_codegen_spirv::builder::builder_methods::::pointercast::h9cc3e414ef1f966a 16: 0x106c75fe0 - rustc_codegen_spirv::builder::builder_methods::::bitcast::h95bef7ee067e6e52 17: 0x106c72388 - rustc_codegen_spirv::builder::builder_methods::::ret::hea66e4be1e6f30df 18: 0x106c37b04 - rustc_codegen_ssa::mir::block::>::codegen_terminator::ha5211e4b8b8ed3fc 19: 0x106c34f08 - rustc_codegen_ssa::mir::codegen_mir::h680cf704b650ab2a 20: 0x106cc9080 - rustc_codegen_ssa::base::codegen_instance::hf2c0f9e676c3fe71 21: 0x106c0e9b4 - ::define::hf389f7022ecbfada 22: 0x106c24f6c - ::compile_codegen_unit::{{closure}}::h0218353bb7111ed5 23: 0x106c2491c - ::compile_codegen_unit::h91c26f9a6763dca3 24: 0x106cc8a9c - rustc_codegen_ssa::base::codegen_crate::h54fbe7881ae09c5c 25: 0x106c23ccc - ::codegen_crate::ha25804fa111ed196 26: 0x10d8bb7d4 - ::time::, rustc_interface[698431996f4b6697]::passes::start_codegen::{closur e#0}> 27: 0x10d89dd28 - rustc_interface[698431996f4b6697]::passes::start_codegen 28: 0x10d8bf5e4 - ::enter::<::ongoing_codegen::{closure#0}, core[49eafda268333cb]::result::Result, rustc_span[de8f35f4add29872]::ErrorGuaranteed>> 29: 0x10d88f4a0 - ::ongoing_codegen 30: 0x10d7860b4 - rustc_span[de8f35f4add29872]::set_source_map::, rustc_interface[698431996f4b6697]::interface::run_compiler, rustc_driver_impl[19b3a9f15fe02931]::run_compiler::{closure#1}>::{closure#0}::{closure#0}> 31: 0x10d757618 - std[3254da1c1438db11]::sys_common::backtrace::__rust_begin_short_backtrace::, rustc_driver_impl[19b3a9f15fe02931]::run_compiler::{closure#1}>::{closure#0}, core[49eafda268333cb]::result::Result<(), rustc_span[de 8f35f4add29872]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[49eafda268333cb]::result::Result<(), rustc_span[de8f35f4add29872]::ErrorGuaranteed>> 32: 0x10d758738 - <::spawn_unchecked_, rustc_driver_impl[19b3a9f15fe02931]::run_compiler::{closure#1}>::{closure#0}, core[49eafda268333cb]::result::Result<(), rustc_span[de8f35f4add29872]:: ErrorGuaranteed>>::{closure#0}::{closure#0}, core[49eafda268333cb]::result::Result<(), rustc_span[de8f35f4add29872]::ErrorGuaranteed>>::{closure#1} as core[49eafda268333cb]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} 33: 0x105220558 - std::sys::unix::thread::Thread::new::thread_start::h86fccd826fc7dcb1 34: 0x197ecaf94 - __pthread_joiner_wake

<backtrace>

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Riproduci il crash con uno shader Rust che dipende da uom v0.36.0, usando come riferimento iniziale i dettagli del compilatore e dell’ambiente riportati. Inizia in crates/rustc_codegen_spirv/src/builder/builder_methods.rs, in recover_access_chain_from_offset, dove il backtrace segnala una divisione per zero. Il lavoro è completato quando la compilazione dello shader dipendente da uom non causa più una panic.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
rust
Ambito
compilers
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.