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

ICE on Linux kernel 2.6 #7577

Closed
cjgillot opened this issue Nov 10, 2019 · 2 comments · Fixed by #7580
Closed

ICE on Linux kernel 2.6 #7577

cjgillot opened this issue Nov 10, 2019 · 2 comments · Fixed by #7580
Labels
C-bug Category: bug

Comments

@cjgillot
Copy link

I tried to compile rustc on an elderly Linux box.
cargo panicked.

I traced the cause to https://github.com/rust-lang/cargo/blob/master/src/cargo/util/cpu.rs#L66
The unwrap panics because the /proc/stat file on this version only has 9 columns.

Backtrace:

thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:378:21                                                                                     [62/528]
stack backtrace:
   0:     0x55d3d4e19914 - backtrace::backtrace::libunwind::trace::h7ad6a8b922fcbc6b
                               at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/backtrace/libunwind.rs:88
   1:     0x55d3d4e19914 - backtrace::backtrace::trace_unsynchronized::hbac2e1529d61bd77
                               at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/backtrace/mod.rs:66
   2:     0x55d3d4e19914 - std::sys_common::backtrace::_print_fmt::hbe7c998fd23d81c1
                               at src/libstd/sys_common/backtrace.rs:76
   3:     0x55d3d4e19914 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hd16e96c1802eeddf
                               at src/libstd/sys_common/backtrace.rs:60
   4:     0x55d3d4e44efc - core::fmt::write::h6eabb3ca7a98a71e
                               at src/libcore/fmt/mod.rs:1030
   5:     0x55d3d4e12317 - std::io::Write::write_fmt::h9ff2cb44f8ed5906
                               at src/libstd/io/mod.rs:1412
   6:     0x55d3d4e1d675 - std::sys_common::backtrace::_print::h156faaaa311a1c35
                               at src/libstd/sys_common/backtrace.rs:64
   7:     0x55d3d4e1d675 - std::sys_common::backtrace::print::hd8f44adca3b9c7af
                               at src/libstd/sys_common/backtrace.rs:49
   8:     0x55d3d4e1d675 - std::panicking::default_hook::{{closure}}::h7d7cdcb2c7cdbed8
                               at src/libstd/panicking.rs:196
   9:     0x55d3d4e1d366 - std::panicking::default_hook::hb4a9065c39b6e99a
                               at src/libstd/panicking.rs:210
  10:     0x55d3d4e1dd75 - std::panicking::rust_panic_with_hook::haa206b44ed70b8bb
                               at src/libstd/panicking.rs:473
  11:     0x55d3d4e1d912 - std::panicking::continue_panic_fmt::h4f54b156fa6d4e21
                               at src/libstd/panicking.rs:380
  12:     0x55d3d4e1d806 - rust_begin_unwind
                               at src/libstd/panicking.rs:307
  13:     0x55d3d4e4151a - core::panicking::panic_fmt::h6f2ecda11bddbc92
                               at src/libcore/panicking.rs:85
  14:     0x55d3d4e41459 - core::panicking::panic::h0aaff6652230cf96
                               at src/libcore/panicking.rs:49
  15:     0x55d3d499e3c4 - cargo::util::cpu::imp::current::h9802aac11537b886
  16:     0x55d3d48ac488 - cargo::core::compiler::job_queue::JobQueue::new::h2597d495a607c29f
  17:     0x55d3d46608b2 - cargo::core::compiler::context::Context::compile::ha8ff39d166541d11
  18:     0x55d3d4674d9f - cargo::ops::cargo_compile::compile_ws::h6cf0023976f380bb
  19:     0x55d3d466fbe7 - cargo::ops::cargo_compile::compile::he794ebb8a966f792
  20:     0x55d3d45b9276 - cargo::commands::build::exec::h64fcef8244062342
  21:     0x55d3d456fd81 - cargo::cli::main::h1d2b305aba351553
  22:     0x55d3d45bcc11 - cargo::main::hd0239c9be1c49e24
  23:     0x55d3d45a72d3 - std::rt::lang_start::{{closure}}::h7c37522af7759eb6
  24:     0x55d3d4e1d7a3 - std::rt::lang_start_internal::{{closure}}::hb544445db001314b
                               at src/libstd/rt.rs:49
  25:     0x55d3d4e1d7a3 - std::panicking::try::do_call::hb9787e39316b7f40
                               at src/libstd/panicking.rs:292
  26:     0x55d3d4e28daa - __rust_maybe_catch_panic
                               at src/libpanic_unwind/lib.rs:80

Possible Solution(s)

Remove that unwrap by a unwrap_or_else("0").

Output of cargo version:

cargo 1.39.0-beta (b6c6f68 2019-09-19)

@ehuss
Copy link
Contributor

ehuss commented Nov 11, 2019

cargo 1.39.0-beta (b6c6f68 2019-09-19)

FWIW, this version is very old, and this issue was fixed in #7430. Can you try a newer version of Rust?

bors added a commit that referenced this issue Nov 11, 2019
Don't panic when parsing `/proc/stat`

Use more robust error handling than `.unwrap()`!

Closes #7577
@bors bors closed this as completed in 540fb9d Nov 12, 2019
@cjgillot
Copy link
Author

This is the version which is downloaded by the rustc bootstrap process. I managed to get it working by manually downloading the previous (2019-08-23) version. I will try a newer version when convenient.

Otherwise, thank you for the fix :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants