Skip to content

Crash building libstd on FreeBSD after miri const eval changes. #48888

Description

@bdrewery

Bisecting it seems to be an issue with #46882.
It appears this may be a double crash? Like it's hitting some error and then unwinding improperly and crashing again. Not familiar enough with the traces to know.

Building stage1 std artifacts (x86_64-unknown-freebsd -> x86_64-unknown-freebsd)
        c Sysroot { compiler: Compiler { stage: 1, host: "x86_64-unknown-freebsd" } }
Dirty - /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1-std
        c Sysroot { compiler: Compiler { stage: 1, host: "x86_64-unknown-freebsd" } }
        c Sysroot { compiler: Compiler { stage: 1, host: "x86_64-unknown-freebsd" } }
        c Sysroot { compiler: Compiler { stage: 1, host: "x86_64-unknown-freebsd" } }
running: "/root/git/rust/rust/build/x86_64-unknown-freebsd/stage0/bin/cargo" "build" "--target" "x86_64-unknown-freebsd" "-j" "16" "--release" "--features" "panic-unwind jemalloc backtrace" "--manifest-path" "/root/git/rust/rust/src/libstd/Cargo.toml" "--message-format" "json"
   Compiling cfg-if v0.1.2
   Compiling core v0.0.0 (file:///root/git/rust/rust/src/libcore)
   Compiling unwind v0.0.0 (file:///root/git/rust/rust/src/libunwind)
   Compiling libc v0.2.39
   Compiling cc v1.0.4
   Compiling filetime v0.1.15
   Compiling build_helper v0.1.0 (file:///root/git/rust/rust/src/build_helper)
   Compiling std v0.0.0 (file:///root/git/rust/rust/src/libstd)
   Compiling alloc_jemalloc v0.0.0 (file:///root/git/rust/rust/src/liballoc_jemalloc)
   Compiling compiler_builtins v0.0.0 (file:///root/git/rust/rust/src/rustc/compiler_builtins_shim)
   Compiling std_unicode v0.0.0 (file:///root/git/rust/rust/src/libstd_unicode)
   Compiling libc v0.0.0 (file:///root/git/rust/rust/src/rustc/libc_shim)
   Compiling alloc v0.0.0 (file:///root/git/rust/rust/src/liballoc)
   Compiling panic_abort v0.0.0 (file:///root/git/rust/rust/src/libpanic_abort)
   Compiling panic_unwind v0.0.0 (file:///root/git/rust/rust/src/libpanic_unwind)
   Compiling alloc_system v0.0.0 (file:///root/git/rust/rust/src/liballoc_system)
error: Could not compile `std`.

Caused by:
  process didn't exit successfully: `/root/git/rust/rust/build/bootstrap/debug/rustc --crate-name std libstd/lib.rs --error-format json --crate-type dylib --crate-type rlib --emit=dep-info,link -C prefer-dynamic -C opt-level=2 --cfg feature="alloc_jemalloc" --cfg feature="backtrace
" --cfg feature="jemalloc" --cfg feature="panic-unwind" --cfg feature="panic_unwind" -C metadata=e8572c2cb37bf2cb -C extra-filename=-e8572c2cb37bf2cb --out-dir /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1-std/x86_64-unknown-freebsd/release/deps --target x86_64-unknown-fr
eebsd -L dependency=/root/git/rust/rust/build/x86_64-unknown-freebsd/stage1-std/x86_64-unknown-freebsd/release/deps -L dependency=/root/git/rust/rust/build/x86_64-unknown-freebsd/stage1-std/release/deps --extern alloc_jemalloc=/root/git/rust/rust/build/x86_64-unknown-freebsd/stage1
-std/x86_64-unknown-freebsd/release/deps/liballoc_jemalloc-cf2d57f8dace9f40.rlib --extern panic_unwind=/root/git/rust/rust/build/x86_64-unknown-freebsd/stage1-std/x86_64-unknown-freebsd/release/deps/libpanic_unwind-60b856e8a64e8b13.rlib --extern libc=/root/git/rust/rust/build/x86_6
4-unknown-freebsd/stage1-std/x86_64-unknown-freebsd/release/deps/liblibc-592e5c24413ae3ae.rlib --extern unwind=/root/git/rust/rust/build/x86_64-unknown-freebsd/stage1-std/x86_64-unknown-freebsd/release/deps/libunwind-a0476c58d58d35a6.rlib --extern std_unicode=/root/git/rust/rust/bu
ild/x86_64-unknown-freebsd/stage1-std/x86_64-unknown-freebsd/release/deps/libstd_unicode-91afc60c4ed4ab41.rlib --extern compiler_builtins=/root/git/rust/rust/build/x86_64-unknown-freebsd/stage1-std/x86_64-unknown-freebsd/release/deps/libcompiler_builtins-ec7788b40c37f4ab.rlib --ext
ern alloc=/root/git/rust/rust/build/x86_64-unknown-freebsd/stage1-std/x86_64-unknown-freebsd/release/deps/liballoc-07f2cf36f01b1079.rlib --extern core=/root/git/rust/rust/build/x86_64-unknown-freebsd/stage1-std/x86_64-unknown-freebsd/release/deps/libcore-2ea65697d9edc883.rlib --ext
ern alloc_system=/root/git/rust/rust/build/x86_64-unknown-freebsd/stage1-std/x86_64-unknown-freebsd/release/deps/liballoc_system-ab04d18a01831de1.rlib --extern panic_abort=/root/git/rust/rust/build/x86_64-unknown-freebsd/stage1-std/x86_64-unknown-freebsd/release/deps/libpanic_abort
-e572d5139a455f8f.rlib -L native=/root/git/rust/rust/build/x86_64-unknown-freebsd/native/libbacktrace/.libs -l static=backtrace -l execinfo -l pthread -L native=/root/git/rust/rust/build/x86_64-unknown-freebsd/native/jemalloc/lib -L native=/root/git/rust/rust/build/x86_64-unknown-f
reebsd/stage1-std/x86_64-unknown-freebsd/release/build/compiler_builtins-ecd678163c4f0137/out` (signal: 11, SIGSEGV: invalid memory reference)
thread 'main' panicked at 'command did not execute successfully: "/root/git/rust/rust/build/x86_64-unknown-freebsd/stage0/bin/cargo" "build" "--target" "x86_64-unknown-freebsd" "-j" "16" "--release" "--features" "panic-unwind jemalloc backtrace" "--manifest-path" "/root/git/rust/ru
st/src/libstd/Cargo.toml" "--message-format" "json"
expected success, got: exit code: 101', bootstrap/compile.rs:1092:9
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
   1: std::sys_common::backtrace::_print
   2: std::panicking::default_hook::{{closure}}
   3: std::panicking::default_hook
   4: std::panicking::rust_panic_with_hook
   5: std::panicking::begin_panic
   6: std::panicking::begin_panic_fmt
   7: bootstrap::compile::run_cargo
   8: <bootstrap::compile::Std as bootstrap::builder::Step>::run
             at bootstrap/compile.rs:109
   9: bootstrap::builder::Builder::ensure
             at bootstrap/builder.rs:846
  10: <bootstrap::compile::Test as bootstrap::builder::Step>::run
  11: bootstrap::builder::Builder::ensure
             at bootstrap/builder.rs:846
  12: <bootstrap::compile::Rustc as bootstrap::builder::Step>::run
  13: bootstrap::builder::Builder::ensure
             at bootstrap/builder.rs:846
  14: <bootstrap::compile::Assemble as bootstrap::builder::Step>::run
  15: bootstrap::builder::Builder::ensure
             at bootstrap/builder.rs:846
  16: bootstrap::builder::Builder::compiler
             at bootstrap/builder.rs:423
  17: <bootstrap::compile::Std as bootstrap::builder::Step>::make_run
             at bootstrap/compile.rs:56
  18: bootstrap::builder::StepDescription::maybe_run
             at bootstrap/builder.rs:185
  19: bootstrap::builder::StepDescription::run
             at bootstrap/builder.rs:205
  20: bootstrap::builder::Builder::run
             at bootstrap/builder.rs:410
  21: bootstrap::Build::build
             at bootstrap/lib.rs:392
  22: bootstrap::main
             at bootstrap/bin/main.rs:29
  23: std::rt::lang_start::{{closure}}
             at /checkout/src/libstd/rt.rs:74
  24: std::panicking::try::do_call
  25: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:102
  26: std::rt::lang_start_internal


#0  libunwind::LocalAddressSpace::get64 (this=<optimized out>, addr=<optimized out>) at /usr/src/contrib/llvm/projects/libunwind/src/AddressSpace.hpp:137
137         memcpy(&val, (void *)addr, sizeof(val));
[Current thread is 1 (LWP 102119)]
(gdb) bt                                                                                                                                                                                                                                                                                  #0  libunwind::LocalAddressSpace::get64 (this=<optimized out>, addr=<optimized out>) at /usr/src/contrib/llvm/projects/libunwind/src/AddressSpace.hpp:137
#1  libunwind::LocalAddressSpace::getP (this=<optimized out>, addr=<optimized out>) at /usr/src/contrib/llvm/projects/libunwind/src/AddressSpace.hpp:166
#2  libunwind::DwarfInstructions<libunwind::LocalAddressSpace, libunwind::Registers_x86_64>::getSavedRegister (addressSpace=..., registers=..., cfa=16, savedReg=...) at /usr/src/contrib/llvm/projects/libunwind/src/DwarfInstructions.hpp:86
#3  0x00000008012a284b in libunwind::DwarfInstructions<libunwind::LocalAddressSpace, libunwind::Registers_x86_64>::stepWithDwarf (addressSpace=..., pc=<optimized out>, fdeStart=<optimized out>, registers=...)
    at /usr/src/contrib/llvm/projects/libunwind/src/DwarfInstructions.hpp:191
#4  0x00000008012a228d in libunwind::UnwindCursor<libunwind::LocalAddressSpace, libunwind::Registers_x86_64>::stepWithDwarfFDE (this=0x7fffdffeffd0) at /usr/src/contrib/llvm/projects/libunwind/src/UnwindCursor.hpp:465
#5  libunwind::UnwindCursor<libunwind::LocalAddressSpace, libunwind::Registers_x86_64>::step (this=0x7fffdffeffd0) at /usr/src/contrib/llvm/projects/libunwind/src/UnwindCursor.hpp:1337
#6  0x00000008012994d6 in _Unwind_Backtrace (callback=0x8058aee60 <backtrace::backtrace::libunwind::trace::trace_fn>, ref=0x7fffdfff0168) at /usr/src/contrib/llvm/projects/libunwind/src/UnwindLevel1-gcc-ext.c:128
#7  0x00000008058b0b1d in backtrace::backtrace::trace () from /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1/lib/librustc-65547986dd27258e.so
#8  0x00000008058aded3 in backtrace::capture::Backtrace::new_unresolved () from /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1/lib/librustc-65547986dd27258e.so
#9  0x000000080563a5d3 in <rustc::mir::interpret::error::EvalError<'tcx> as core::convert::From<rustc::mir::interpret::error::EvalErrorKind<'tcx>>>::from () from /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1/lib/librustc-65547986dd27258e.so
#10 0x000000080482f977 in <rustc_mir::interpret::eval_context::EvalContext<'a, 'mir, 'tcx, M>>::write_value () from /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1/lib/librustc_mir-00858990fbea75d7.so
#11 0x0000000804845d9b in rustc_mir::interpret::terminator::<impl rustc_mir::interpret::eval_context::EvalContext<'a, 'mir, 'tcx, M>>::eval_fn_call () from /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1/lib/librustc_mir-00858990fbea75d7.so
#12 0x000000080484385a in rustc_mir::interpret::step::<impl rustc_mir::interpret::eval_context::EvalContext<'a, 'mir, 'tcx, M>>::step () from /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1/lib/librustc_mir-00858990fbea75d7.so
#13 0x00000008048c6b62 in rustc_mir::interpret::const_eval::eval_body_and_ecx () from /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1/lib/librustc_mir-00858990fbea75d7.so
#14 0x00000008048ca0e2 in rustc_mir::interpret::const_eval::const_eval_provider () from /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1/lib/librustc_mir-00858990fbea75d7.so
#15 0x0000000805193097 in rustc::ty::maps::<impl rustc::ty::maps::queries::const_eval<'tcx>>::compute_result () from /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1/lib/librustc-65547986dd27258e.so
#16 0x000000080585b51e in rustc::dep_graph::graph::DepGraph::with_task_impl () from /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1/lib/librustc-65547986dd27258e.so
#17 0x000000080521edc8 in rustc_errors::Handler::track_diagnostics () from /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1/lib/librustc-65547986dd27258e.so
#18 0x000000080549e0f8 in rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::cycle_check () from /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1/lib/librustc-65547986dd27258e.so
#19 0x000000080519315f in rustc::ty::maps::<impl rustc::ty::maps::queries::const_eval<'tcx>>::force () from /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1/lib/librustc-65547986dd27258e.so
#20 0x0000000805193a50 in rustc::ty::maps::<impl rustc::ty::maps::queries::const_eval<'tcx>>::try_get () from /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1/lib/librustc-65547986dd27258e.so
#21 0x00000008054c655b in rustc::ty::maps::TyCtxtAt::const_eval () from /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1/lib/librustc-65547986dd27258e.so
#22 0x00000008054c2cb5 in rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::const_eval () from /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1/lib/librustc-65547986dd27258e.so
#23 0x000000080478dd83 in rustc_mir::monomorphize::collector::collect_items_rec () from /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1/lib/librustc_mir-00858990fbea75d7.so
#24 0x000000080478e674 in rustc_mir::monomorphize::collector::collect_items_rec () from /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1/lib/librustc_mir-00858990fbea75d7.so
#25 0x000000080478e674 in rustc_mir::monomorphize::collector::collect_items_rec () from /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1/lib/librustc_mir-00858990fbea75d7.so
#26 0x000000080478d3eb in rustc_mir::monomorphize::collector::collect_crate_mono_items () from /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1/lib/librustc_mir-00858990fbea75d7.so
#27 0x000000080901dc4f in rustc::util::common::time () from /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1/lib/rustlib/x86_64-unknown-freebsd/codegen-backends/librustc_trans-llvm.so
#28 0x000000080903179b in rustc_trans::base::collect_and_partition_translation_items () from /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1/lib/rustlib/x86_64-unknown-freebsd/codegen-backends/librustc_trans-llvm.so
#29 0x00000008058388ac in rustc::dep_graph::graph::DepGraph::with_task_impl () from /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1/lib/librustc-65547986dd27258e.so
#30 0x0000000805230629 in rustc_errors::Handler::track_diagnostics () from /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1/lib/librustc-65547986dd27258e.so
#31 0x0000000805484298 in rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::cycle_check () from /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1/lib/librustc-65547986dd27258e.so
#32 0x0000000805202f2e in rustc::ty::maps::<impl rustc::ty::maps::queries::collect_and_partition_translation_items<'tcx>>::force () from /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1/lib/librustc-65547986dd27258e.so
#33 0x0000000805203527 in rustc::ty::maps::<impl rustc::ty::maps::queries::collect_and_partition_translation_items<'tcx>>::try_get () from /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1/lib/librustc-65547986dd27258e.so
#34 0x00000008054cb298 in rustc::ty::maps::TyCtxtAt::collect_and_partition_translation_items () from /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1/lib/librustc-65547986dd27258e.so
#35 0x00000008054c3f7f in rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::collect_and_partition_translation_items () from /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1/lib/librustc-65547986dd27258e.so
#36 0x000000080902fbd3 in rustc_trans::base::trans_crate () from /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1/lib/rustlib/x86_64-unknown-freebsd/codegen-backends/librustc_trans-llvm.so
#37 0x0000000809052c48 in <rustc_trans::LlvmTransCrate as rustc_trans_utils::trans_crate::TransCrate>::trans_crate () from /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1/lib/rustlib/x86_64-unknown-freebsd/codegen-backends/librustc_trans-llvm.so
#38 0x0000000801569631 in rustc::util::common::time () from /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1/lib/librustc_driver-37a825abd95bc4d6.so
#39 0x00000008014aad56 in rustc_driver::driver::phase_4_translate_to_llvm () from /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1/lib/librustc_driver-37a825abd95bc4d6.so
#40 0x00000008015372ca in rustc_driver::driver::compile_input::{{closure}} () from /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1/lib/librustc_driver-37a825abd95bc4d6.so
#41 0x000000080153065d in <std::thread::local::LocalKey<T>>::with () from /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1/lib/librustc_driver-37a825abd95bc4d6.so
#42 0x000000080152fbb4 in <std::thread::local::LocalKey<T>>::with () from /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1/lib/librustc_driver-37a825abd95bc4d6.so
#43 0x000000080159c8ed in rustc::ty::context::TyCtxt::create_and_enter () from /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1/lib/librustc_driver-37a825abd95bc4d6.so
#44 0x00000008014a4220 in rustc_driver::driver::compile_input () from /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1/lib/librustc_driver-37a825abd95bc4d6.so
#45 0x0000000801550e37 in rustc_driver::run_compiler () from /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1/lib/librustc_driver-37a825abd95bc4d6.so
#46 0x0000000801469ba9 in std::sys_common::backtrace::__rust_begin_short_backtrace () from /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1/lib/librustc_driver-37a825abd95bc4d6.so
#47 0x000000080191a49f in __rust_maybe_catch_panic () at libpanic_unwind/lib.rs:102
#48 0x00000008014cf9e8 in <F as alloc::boxed::FnBox<A>>::call_box () from /root/git/rust/rust/build/x86_64-unknown-freebsd/stage1/lib/librustc_driver-37a825abd95bc4d6.so
#49 0x00000008019052e8 in _$LT$alloc..boxed..Box$LT$alloc..boxed..FnBox$LT$A$C$$u20$Output$u3d$R$GT$$u20$$u2b$$u20$$u27$a$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h0e4b66c3d8f91271 () at /root/git/rust/rust/src/liballoc/boxed.rs:793
#50 std::sys_common::thread::start_thread () at libstd/sys_common/thread.rs:24
#51 0x00000008018d8e99 in std::sys::unix::thread::Thread::new::thread_start () at libstd/sys/unix/thread.rs:90
#52 0x0000000801274426 in thread_start (curthread=0x801357500) at /usr/src/lib/libthr/thread/thr_create.c:291
#53 0x0000000000000000 in ?? ()
Backtrace stopped: Cannot access memory at address 0x7fffdfffe000

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)C-bugCategory: This is a bug.I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions