Skip to content

ICE: rustc panics on empty output filename #26092

Closed
@jashank

Description

@jashank

I don't think this has been reported yet.

> rustc --version
rustc 1.2.0-nightly (613e57b44 2015-06-01) (built 2015-06-02)
> rustc --emit obj -g -o "" file.rs
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libcore/option.rs:362

stack backtrace:
   1:     0x7fbbc7bfd733 - sys::backtrace::write::h8f69c25b82e602958cs
   2:     0x7fbbc7c05669 - panicking::on_panic::hfa966c25addcbd02XXw
   3:     0x7fbbc7bc5cfa - rt::unwind::begin_unwind_inner::h75eec641d76d2f34HDw
   4:     0x7fbbc7bc6a97 - rt::unwind::begin_unwind_fmt::hc239ae9d69c6846fNCw
   5:     0x7fbbc7c05246 - rust_begin_unwind
   6:     0x7fbbc7c55fd4 - panicking::panic_fmt::ha901275921e4ec4ei5B
   7:     0x7fbbc7c506a4 - panicking::panic::h196721530e70dcfbP3B
   8:     0x7fbbc814071e - driver::build_output_filenames::hcd916d7252ec0a91g2a
   9:     0x7fbbc8134d63 - driver::compile_input::hda494d426ffc5b8bQba
  10:     0x7fbbc81ebcc1 - run_compiler::hd539ddde81e1e162n6b
  11:     0x7fbbc81e9512 - boxed::F.FnBox<A>::call_box::h2241471336346299975
  12:     0x7fbbc81e8d19 - rt::unwind::try::try_fn::h1392995902660742682
  13:     0x7fbbc7c7e4e8 - rust_try_inner
  14:     0x7fbbc7c7e4d5 - rust_try
  15:     0x7fbbc7bf0ee7 - rt::unwind::try::inner_try::hfac58a0de8636543Azw
  16:     0x7fbbc81e8f39 - boxed::F.FnBox<A>::call_box::h9914386528590371672
  17:     0x7fbbc7c04321 - sys::thread::Thread::new::thread_start::h5dbb55e110740b5cMJv
  18:     0x7fbbc1c0d373 - start_thread
  19:     0x7fbbc785527c - clone
  20:                0x0 - <unknown>

I think better error handling in rustc_driver::driver::build_output_filenames L953..974 would make this go away.

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions