Skip to content

Bootstrapping fails with --opt-level=1 #13320

Closed
@alexcrichton

Description

@alexcrichton

Sadly, I'm unable to reduce this test case further, but bootstrapping rust with --opt-level=1 causes an assertion failure:

$ ./configure --disable-optimize
...
$ make RUSTFLAGS=--opt-level=1
...
oxidize: x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd
task '<main>' failed at 'assertion failed: !contains_nul(path.container_as_bytes())', /home/alex/code/rust2/src/libs
td/path/mod.rs:161
make: *** [x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/stamp.std] Error 101
stack backtrace:
   1:     0x2afc8575d3d0 - rt::backtrace::imp::write::hf4a317cb26f6dbdcCYb::v0.11.pre
   2:     0x2afc8568f320 - rt::unwind::begin_unwind_inner::hc4d1b90c74aff9505yb::v0.11.pre
   3:     0x2afc8568ee80 - rt::unwind::begin_unwind_fmt::ha138a63726a8610ffyb::v0.11.pre
   4:     0x2afc88ab51b0 - path::GenericPath::new::h9338406b1241c33bhtc::v0.11.pre
   5:     0x2afc88ab5160 - path::posix::Path::new::hc0024b98d3428ebe3sc::v0.11.pre
   6:     0x2afc88aaee90 - terminfo::searcher::get_dbpath_for_term::hb9860c7e7fc3fd526aa::v0.11.pre
   7:     0x2afc88ab6650 - terminfo::searcher::open::hf62724575cfe88cbhfa::v0.11.pre
   8:     0x2afc86659550 - Terminal$LT$T$GT$::new::hdabfc77b7ac55d88Qo5::v0.11.pre
   9:     0x2afc86652420 - diagnostic::EmitterWriter::stderr::hfd23d008f940811626b::v0.11.pre
  10:     0x2afc8351b620 - monitor::hba5a4a2b7e13d4ecikm::v0.11.pre
  11:     0x2afc835370d0 - main_args::hbd9a5c72232d6063Qom::v0.11.pre
  12:     0x2afc83537040 - main::h69153f0097da5909Gom::v0.11.pre
  13:     0x2afc853dd240 - run::hf16768b59fb57517ixd::v0.11.pre
  14:     0x2afc853dd180 - start::closure.7826
  15:     0x2afc857564d0 - unstable::finally::try_finally::h8293b253ac1a0b2fP9U::v0.11.pre
  16:     0x2afc85756440 - unstable::finally::_$x27a$x7c$x7c$x20.$GT$$x20T.Finally$LT$T$GT$::finally::ha3168e974cad9
dd5v8U::v0.11.pre
  17:     0x2afc857563e0 - rt::task::Task::run::closure.41772
  18:     0x2afc857672b0 - rust_try
  19:     0x2afc85756b70 - rt::unwind::Unwinder::try::h072d99d58e638ae0Wkb::v0.11.pre
  20:     0x2afc85756300 - rt::task::Task::run::hdd5dcbf94d6bade1Br9::v0.11.pre
  21:     0x2afc853dcc10 - start::h4100553b9a0fcee0Ktd::v0.11.pre
  22:     0x2afc853dcb90 - lang_start::he63000f25bb5087f4sd::v0.11.pre
  23:     0x2afc85e11cf0 - __libc_start_main
  24:           0x400780 - <unknown>
  25:                0x0 - <unknown>

This is because Path::new("/etc/terminfo") is failing, because it thinks there's a null byte in that slice. I added some debug printing and the slice did indeed not have a null byte, but the contains_nul function returned true anyway. Additionally, if I inlined the contents of contains_nul it correctly reported that the slice did not have a nul byte.

This may be fixed with an LLVM upgrade, but I wanted to get an issue to help track this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions