rust-lang / docker-rust

The official Docker images for Rust
428 stars 89 forks source link

rustc fails on 1.72.0-bookworm #157

Closed zazabe closed 9 months ago

zazabe commented 9 months ago

How to reproduce:

$ podman run -it --rm docker.io/library/rust:1.72.0-bookworm /bin/bash
root@bc65922f665e:/# echo 'fn main() { println!("Hello World!"); }' > hello.rs
root@bc65922f665e:/# rustc hello.rs 
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 1, kind: PermissionDenied, message: "Operation not permitted" }', /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/compiler/rustc_interface/src/util.rs:162:14
stack backtrace:
   0:     0x7f6a80ca3b61 - std::backtrace_rs::backtrace::libunwind::trace::he648b5c8dd376705
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f6a80ca3b61 - std::backtrace_rs::backtrace::trace_unsynchronized::h5da3e203eef39e9f
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f6a80ca3b61 - std::sys_common::backtrace::_print_fmt::h8d28d3f20588ae4c
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f6a80ca3b61 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hd9a5b0c9c6b058c0
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f6a80d0a77f - core::fmt::rt::Argument::fmt::h0afc04119f252b53
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/fmt/rt.rs:138:9
   5:     0x7f6a80d0a77f - core::fmt::write::h50b1b3e73851a6fe
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/fmt/mod.rs:1094:21
   6:     0x7f6a80c964a7 - std::io::Write::write_fmt::h184eaf275e4484f0
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/io/mod.rs:1714:15
   7:     0x7f6a80ca3975 - std::sys_common::backtrace::_print::hf58c3a5a25090e71
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f6a80ca3975 - std::sys_common::backtrace::print::hb9cf0a7c7f077819
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f6a80ca6753 - std::panicking::default_hook::{{closure}}::h066adb2e3f3e2c07
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panicking.rs:269:22
  10:     0x7f6a80ca64e4 - std::panicking::default_hook::h277fa2776900ff14
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panicking.rs:288:9
  11:     0x7f6a83fa856b - <rustc_driver_impl[10725d833993dc31]::install_ice_hook::{closure#0} as core[f12ae36cc2e1ecf0]::ops::function::FnOnce<(&core[f12ae36cc2e1ecf0]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
  12:     0x7f6a80ca6f7e - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h09cad52ea08435f2
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/alloc/src/boxed.rs:2007:9
  13:     0x7f6a80ca6f7e - std::panicking::rust_panic_with_hook::hceaf38da6d9db792
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panicking.rs:709:13
  14:     0x7f6a80ca6d07 - std::panicking::begin_panic_handler::{{closure}}::h2bce3ed2516af7df
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panicking.rs:597:13
  15:     0x7f6a80ca3fc6 - std::sys_common::backtrace::__rust_end_short_backtrace::h090f3faf8f98a395
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/sys_common/backtrace.rs:151:18
  16:     0x7f6a80ca6a52 - rust_begin_unwind
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panicking.rs:593:5
  17:     0x7f6a80d069f3 - core::panicking::panic_fmt::h4ec8274704d163a3
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/panicking.rs:67:14
  18:     0x7f6a80d07013 - core::result::unwrap_failed::h170bc2721a6c6ff2
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/result.rs:1651:5
  19:     0x7f6a835609ad - <core[f12ae36cc2e1ecf0]::panic::unwind_safe::AssertUnwindSafe<std[7c7acd4e376d60d3]::thread::scoped::scope<rustc_interface[7e6a9899d53a1fe5]::util::run_in_thread_pool_with_globals<rustc_interface[7e6a9899d53a1fe5]::interface::run_compiler<core[f12ae36cc2e1ecf0]::result::Result<(), rustc_span[14af2d27fb997609]::ErrorGuaranteed>, rustc_driver_impl[10725d833993dc31]::run_compiler::{closure#1}>::{closure#0}, core[f12ae36cc2e1ecf0]::result::Result<(), rustc_span[14af2d27fb997609]::ErrorGuaranteed>>::{closure#0}, core[f12ae36cc2e1ecf0]::result::Result<(), rustc_span[14af2d27fb997609]::ErrorGuaranteed>>::{closure#0}> as core[f12ae36cc2e1ecf0]::ops::function::FnOnce<()>>::call_once
  20:     0x7f6a83560750 - std[7c7acd4e376d60d3]::thread::scoped::scope::<rustc_interface[7e6a9899d53a1fe5]::util::run_in_thread_pool_with_globals<rustc_interface[7e6a9899d53a1fe5]::interface::run_compiler<core[f12ae36cc2e1ecf0]::result::Result<(), rustc_span[14af2d27fb997609]::ErrorGuaranteed>, rustc_driver_impl[10725d833993dc31]::run_compiler::{closure#1}>::{closure#0}, core[f12ae36cc2e1ecf0]::result::Result<(), rustc_span[14af2d27fb997609]::ErrorGuaranteed>>::{closure#0}, core[f12ae36cc2e1ecf0]::result::Result<(), rustc_span[14af2d27fb997609]::ErrorGuaranteed>>
  21:     0x7f6a8356063d - rustc_interface[7e6a9899d53a1fe5]::util::run_in_thread_pool_with_globals::<rustc_interface[7e6a9899d53a1fe5]::interface::run_compiler<core[f12ae36cc2e1ecf0]::result::Result<(), rustc_span[14af2d27fb997609]::ErrorGuaranteed>, rustc_driver_impl[10725d833993dc31]::run_compiler::{closure#1}>::{closure#0}, core[f12ae36cc2e1ecf0]::result::Result<(), rustc_span[14af2d27fb997609]::ErrorGuaranteed>>
  22:     0x7f6a835604a7 - rustc_interface[7e6a9899d53a1fe5]::interface::run_compiler::<core[f12ae36cc2e1ecf0]::result::Result<(), rustc_span[14af2d27fb997609]::ErrorGuaranteed>, rustc_driver_impl[10725d833993dc31]::run_compiler::{closure#1}>
  23:     0x7f6a8355c7ae - <rustc_driver_impl[10725d833993dc31]::RunCompiler>::run
  24:     0x7f6a8355ba80 - <core[f12ae36cc2e1ecf0]::panic::unwind_safe::AssertUnwindSafe<rustc_driver_impl[10725d833993dc31]::main::{closure#1}> as core[f12ae36cc2e1ecf0]::ops::function::FnOnce<()>>::call_once
  25:     0x7f6a83614ce6 - rustc_driver_impl[10725d833993dc31]::main
  26:     0x5642db9f2c87 - rustc_main[354ec624efe51880]::main
  27:     0x5642db9f2c73 - std[7c7acd4e376d60d3]::sys_common::backtrace::__rust_begin_short_backtrace::<fn(), ()>
  28:     0x5642db9f2c69 - <std[7c7acd4e376d60d3]::rt::lang_start<()>::{closure#0} as core[f12ae36cc2e1ecf0]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  29:     0x7f6a80c86f7b - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h75ba4244a1c7bb54
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/ops/function.rs:284:13
  30:     0x7f6a80c86f7b - std::panicking::try::do_call::h0a2baa36dea975a1
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panicking.rs:500:40
  31:     0x7f6a80c86f7b - std::panicking::try::h0e42aa233d4224d4
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panicking.rs:464:19
  32:     0x7f6a80c86f7b - std::panic::catch_unwind::hefdfd8f482606434
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panic.rs:142:14
  33:     0x7f6a80c86f7b - std::rt::lang_start_internal::{{closure}}::h457959f0f91da23b
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/rt.rs:148:48
  34:     0x7f6a80c86f7b - std::panicking::try::do_call::h112cfd1acb38183b
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panicking.rs:500:40
  35:     0x7f6a80c86f7b - std::panicking::try::ha64f15b20cec18ca
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panicking.rs:464:19
  36:     0x7f6a80c86f7b - std::panic::catch_unwind::hbacc2b68ee2c119e
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panic.rs:142:14
  37:     0x7f6a80c86f7b - std::rt::lang_start_internal::h5f408694586c2a05
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/rt.rs:148:20
  38:     0x5642db9f2db7 - main
  39:     0x7f6a809d51ca - <unknown>
  40:     0x7f6a809d5285 - __libc_start_main
  41:     0x5642db9f2cb2 - <unknown>
  42:                0x0 - <unknown>

error: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.72.0 (5680fa18f 2023-08-23) running on x86_64-unknown-linux-gnu

query stack during panic:
end of query stack

It works with 1.72.0-bulleye:

$ podman run -it --rm docker.io/library/rust:1.72.0-bullseye /bin/bash
root@3d5dea7e3664:/# echo 'fn main() { println!("Hello World!"); }' > hello.rs
root@3d5dea7e3664:/# rustc hello.rs 
root@3d5dea7e3664:/# 
zazabe commented 9 months ago

I was a bit quick here, it fails on my pc with podman:

$ uname -a
Linux xxx 6.5.3-arch1-1 #1 SMP PREEMPT_DYNAMIC Wed, 13 Sep 2023 08:37:40 +0000 x86_64 GNU/Linux

$ docker --version
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
podman version 4.6.2

but it works on a debian host with docker 24.0.6, like:

$ uname -a
Linux xxx 4.19.0-25-cloud-amd64 #1 SMP Debian 4.19.289-2 (2023-08-08) x86_64 GNU/Linux
$ docker --version
Docker version 24.0.6, build ed223bc
zazabe commented 9 months ago

It's a podman issue, works with --privileged podman flag.