rust-lang/rust

internal compiler error on 'assertion failed: bpos.to_u32() >= mbc.pos.to_u32() + mbc.bytes as u32'

dwrensha opened this issue · 3 comments

I'm seeing an internal compiler error on the following input (found by fuzz-rustc):

$ echo ICPNiAAAAAAAAAAAAAAAAAAAAAAAAAoLHTYdAAA= | base64 --decode > main.rs
$ rustc main.rs
error: unknown start of token: \u{348}
 --> main.rs:1:3
  |
1 |  #͈
  |   ^

...

error: unknown start of token: \u{0}
 --> main.rs:2:6
  |
2 | 
    6
  |  ^

thread 'rustc' panicked at 'assertion failed: bpos.to_u32() >= mbc.pos.to_u32() + mbc.bytes as u32', src/libsyntax/source_map.rs:867:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

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

note: rustc 1.41.0-nightly (1bd30ce2a 2019-11-15) running on x86_64-apple-darwin

error: aborting due to 23 previous errors

Note that a similar issue (#58094) was recently closed. The fix for that (#66054 it seems) apparently does not prevent this crash.

This issue has been assigned to @CosineP via this comment.

It seems the ICE has been fixed in latest nightly.

Bisected, I think it has been fixed by #68084. Adding regression test is reasonable so marked as E-needstest.