1.26 local rebuild panicked at 'slice index starts at 1 but ends at 0' #50786
Labels
C-bug
Category: This is a bug.
regression-from-stable-to-stable
Performance or correctness regression from one stable version to another.
T-bootstrap
Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
When testing a local rebuild in Fedora -- using rustc 1.26.0 as stage0 to build rustc 1.26.0 again -- I ran into this ICE:
The "slice index starts at 1 but ends at 0" comes from here:
rust/src/librustc_driver/lib.rs
Lines 1366 to 1368 in a775680
With GDB I found that
args
is completely empty!Stepping through from the very beginning,
std::rt::lang_start_internal
does get the right argc and argv, callingsys::args::init
appropriately. But the addresses ofsys::unix::args::imp::ARGC
andARGV
are not whereenv::args_os
accesses later fromlibrustc_driver
, so that just sees0
andptr::null()
.It turns out that the bootstrap
LD_LIBRARY_PATH
was causing my/usr/bin/rustc
to load the freshly-built libraries, rather than its own in/usr/lib64/
. The bootstraprustc
wrapper does try to set a libdir at the front of that path, but it uses$sysroot/lib
, here/usr/lib
, so that doesn't help.This only hits local-rebuild, because normal prior-release stage0 builds have different library metadata.
The text was updated successfully, but these errors were encountered: