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

Panic when setting RUST_MIN_STACK incorrectly #126431

Open
jeffreyssmith2nd opened this issue Jun 13, 2024 · 5 comments
Open

Panic when setting RUST_MIN_STACK incorrectly #126431

jeffreyssmith2nd opened this issue Jun 13, 2024 · 5 comments
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@jeffreyssmith2nd
Copy link

This has been fixed in nightly, but was an unexpected panic to encounter on stable. The weird number format is thanks to CircleCI/YAML mangling, I would probably expect this to fail but with at least the error message as seen in nightly.

Code

cargo new bad-env
cd bad-env
RUST_MIN_STACK=1e+07 cargo +stable build

Meta

rustc --version --verbose:

rustc 1.79.0 (129f3b996 2024-06-10)

Error output

<output>
Backtrace

Caused by:
  process didn't exit successfully: `/Users/jeffrey/.rustup/toolchains/stable-aarch64-apple-darwin/bin/rustc - --crate-name ___ --print=file-names -C link-arg=--ld-path=/Users/jeffrey/workspace/Build/sold/build/ld64 --crate-type bin --cra
te-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=split-debuginfo --print=crate-name --print=cfg` (exit status: 101)
  --- stderr
  thread 'main' panicked at compiler/rustc_interface/src/util.rs:63:48:
  called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
  stack backtrace:
     0:        0x1010ed750 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h1f3776e0b5c7517d
     1:        0x101130470 - core::fmt::write::heedef092c8c0962e
     2:        0x1010e3a1c - std::io::Write::write_fmt::h7178e8e2ea928914
     3:        0x1010ed5a8 - std::sys_common::backtrace::print::h417292deb95532ed
     4:        0x1010efb2c - std::panicking::default_hook::{{closure}}::h0cb68f1228c4613a
     5:        0x1010ef820 - std::panicking::default_hook::h24535936bc1f51de
     6:        0x10a5bb828 - <alloc[d07bc629de031c28]::boxed::Box<rustc_driver_impl[17630cf877ef70bb]::install_ice_hook::{closure#0}> as core[fca7800875c611c6]::ops::function::Fn<(&dyn for<'a, 'b> core[fca7800875c611c6]::ops::function::Fn
<(&'a core[fca7800875c611c6]::panic::panic_info::PanicInfo<'b>,), Output = ()> + core[fca7800875c611c6]::marker::Sync + core[fca7800875c611c6]::marker::Send, &core[fca7800875c611c6]::panic::panic_info::PanicInfo)>>::call
     7:        0x1010f0524 - std::panicking::rust_panic_with_hook::h5db4d2345b297bed
     8:        0x1010eff2c - std::panicking::begin_panic_handler::{{closure}}::h3fd558f09a0d5492
     9:        0x1010edbd8 - std::sys_common::backtrace::__rust_end_short_backtrace::hfc76eebe1ce501b2
    10:        0x1010efc9c - _rust_begin_unwind
    11:        0x10114c140 - core::panicking::panic_fmt::hc2b459a5bd3dce66
    12:        0x10114c540 - core::result::unwrap_failed::h88d7eb352f20b747
    13:        0x10ad0633c - <std[e84bc52996b8b382]::sync::once::Once>::call_once_force::<<std[e84bc52996b8b382]::sync::once_lock::OnceLock<usize>>::initialize<<std[e84bc52996b8b382]::sync::once_lock::OnceLock<usize>>::get_or_init<rustc_i
nterface[617d4417f0fbb0b3]::util::init_stack_size::{closure#0}>::{closure#0}, !>::{closure#0}>::{closure#0}
    14:        0x10114ad9c - std::sys::sync::once::queue::Once::call::h4d48f66a899a23f1
    15:        0x10e6698f8 - <std[e84bc52996b8b382]::sync::once_lock::OnceLock<usize>>::initialize::<<std[e84bc52996b8b382]::sync::once_lock::OnceLock<usize>>::get_or_init<rustc_interface[617d4417f0fbb0b3]::util::init_stack_size::{closure
#0}>::{closure#0}, !>
    16:        0x10a5c4988 - rustc_interface[617d4417f0fbb0b3]::util::run_in_thread_with_globals::<rustc_interface[617d4417f0fbb0b3]::interface::run_compiler<core[fca7800875c611c6]::result::Result<(), rustc_span[984a238feadb13f5]::ErrorGu
aranteed>, rustc_driver_impl[17630cf877ef70bb]::run_compiler::{closure#0}>::{closure#1}, core[fca7800875c611c6]::result::Result<(), rustc_span[984a238feadb13f5]::ErrorGuaranteed>>
    17:        0x10a580160 - rustc_interface[617d4417f0fbb0b3]::interface::run_compiler::<core[fca7800875c611c6]::result::Result<(), rustc_span[984a238feadb13f5]::ErrorGuaranteed>, rustc_driver_impl[17630cf877ef70bb]::run_compiler::{closu
re#0}>
    18:        0x10a56baa0 - <rustc_driver_impl[17630cf877ef70bb]::RunCompiler>::run
    19:        0x10a5c5600 - std[e84bc52996b8b382]::panicking::try::<core[fca7800875c611c6]::result::Result<(), rustc_span[984a238feadb13f5]::ErrorGuaranteed>, core[fca7800875c611c6]::panic::unwind_safe::AssertUnwindSafe<rustc_driver_impl
[17630cf877ef70bb]::main::{closure#1}>>
    20:        0x10a573a74 - rustc_driver_impl[17630cf877ef70bb]::main
    21:        0x100284580 - rustc_main[393026df47323ce6]::main
    22:        0x100284534 - std[e84bc52996b8b382]::sys_common::backtrace::__rust_begin_short_backtrace::<fn(), ()>
    23:        0x10028454c - std[e84bc52996b8b382]::rt::lang_start::<()>::{closure#0}
    24:        0x1010d5e40 - std::rt::lang_start_internal::hecc68fef83c8f44d
    25:        0x1002845b4 - _main

@jeffreyssmith2nd jeffreyssmith2nd added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 13, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jun 13, 2024
@jeffreyssmith2nd jeffreyssmith2nd changed the title Panic when setting RUST_MIN_STACK Panic when setting RUST_MIN_STACK incorrectly Jun 13, 2024
@carols10cents
Copy link
Member

#125302 looks like the PR I would nominate for backporting. Not sure if this rises to the level of doing a point release if this is the only problem, given that it requires a bad env var value.

@workingjubilee
Copy link
Member

I am nominating #125302 for a stable backport. I recommend actually carrying out such a backport only if there are other reasons to do a stable release, at which point it may make sense for it to a catch a ride.

@workingjubilee workingjubilee added the regression-from-stable-to-stable Performance or correctness regression from one stable version to another. label Jun 13, 2024
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Jun 13, 2024
@workingjubilee workingjubilee added I-prioritize Issue: Indicates that prioritization has been requested for this issue. and removed 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 Jun 13, 2024
@workingjubilee
Copy link
Member

@jeffreyssmith2nd fwiw, if this was happening before, my understanding is that it was not erroring, but rather simply being ignored, so you can probably unset it.

@apiraino
Copy link
Contributor

@jeffreyssmith2nd can you report back if #125302 fix the issue for you? Should be available in a nightly (maybe also already in beta) . Thanks

@apiraino apiraino removed the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Jul 11, 2024
@jeffreyssmith2nd
Copy link
Author

error: `RUST_MIN_STACK` should be a number of bytes, but was "1e+07"
    |
    = note: you can also unset `RUST_MIN_STACK` to use the default stack size

Looks good to me, available on both nightly and beta 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants