Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICE on invalid UTF-8 on stdin #22387

Closed
a-p- opened this issue Feb 15, 2015 · 2 comments
Closed

ICE on invalid UTF-8 on stdin #22387

a-p- opened this issue Feb 15, 2015 · 2 comments
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@a-p-
Copy link

a-p- commented Feb 15, 2015

Compiler version (running on OS X 10.10.1):

$ /usr/local/bin/rustc --version --verbose
rustc 1.0.0-nightly (b63cee4a1 2015-02-14 17:01:11 +0000)
binary: rustc
commit-hash: b63cee4a11fcfecf20ed8419bc3bd6859e6496bc
commit-date: 2015-02-14 17:01:11 +0000
host: x86_64-apple-darwin
release: 1.0.0-nightly
$ 

To reproduce the ICE:

$ echo -e '\xD2' | RUST_BACKTRACE=1 /usr/local/bin/rustc -
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: FromUtf8Error { bytes: [210, 10], error: InvalidByte(0) }', /Users/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-mac/build/src/libcore/result.rs:743

stack backtrace:
   1:        0x108844a77 - sys::backtrace::write::h159c9303aa56d993QnB
   2:        0x108870852 - failure::on_fail::h30a5d63a5824ccdbmFK
   3:        0x1087a8da8 - rt::unwind::begin_unwind_inner::h83398b7af9be1f1fCmK
   4:        0x1087a9511 - rt::unwind::begin_unwind_fmt::hfc0db89fc8ff3c8e8kK
   5:        0x10887035e - rust_begin_unwind
   6:        0x1088be757 - panicking::panic_fmt::haa2c8b833452fc7bSvw
   7:        0x104d4fa9c - run_compiler::hc6f18cb42f019cd65bc
   8:        0x104d4c6c2 - thunk::F.Invoke<A, R>::invoke::h879112612084553930
   9:        0x104d4b390 - rt::unwind::try::try_fn::h8170179712122257581
  10:        0x1088e81a9 - rust_try_inner
  11:        0x1088e8196 - rust_try
  12:        0x104d4ba89 - thunk::F.Invoke<A, R>::invoke::h7305889020475335315
  13:        0x10885a3e3 - sys::thread::thread_start::hdb5ed57d70bcc7bcoVF
  14:     0x7fff87abf2fc - _pthread_body
  15:     0x7fff87abf279 - _pthread_body

$ 
@steveklabnik steveklabnik added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Feb 16, 2015
@tamird
Copy link
Contributor

tamird commented Apr 22, 2015

Triage: still ICEs.

wheals added a commit to wheals/glacier that referenced this issue Oct 26, 2015
See rust-lang/rust#22387. It seems this requires reading from stdin, so
it must use the script; it greps explicitly for 'internal compiler error'
because it would never actually compile even without compiler bugs.
@Mark-Simulacrum
Copy link
Member

Mark-Simulacrum commented Sep 18, 2016

Triage: Still ICEs.

Given information on what should happen here, I'd be willing to look into fixing this, [this] function seems to be the likely location of the fix.

From IRC:

13:50 nrc: simulacrum: I haven't touched the error code since the big overhaul, but it used to be the case that you could always get an error handler - if you were this early in compilation it would be a special, less functional one (early_handler or something) and you would output error messages through that. However, a (very) quick through the source code and I
13:50 nrc: couldn't find it anywhere. I suppose it is still around though? I'd look at libsyntax_errs and see if anything there fits that bill, then grep for it

@Mark-Simulacrum Mark-Simulacrum changed the title rustc: thread 'rustc' panicked at 'called Result::unwrap() on an Err value: FromUtf8Error { bytes: [210, 10], error: InvalidByte(0) }', /Users/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-mac/build/src/libcore/result.rs:743 ICE on invalid UTF-8 on stdin May 13, 2017
@Mark-Simulacrum Mark-Simulacrum added C-bug Category: This is a bug. and removed C-bug Category: This is a bug. labels Jul 22, 2017
varkor added a commit to varkor/rust that referenced this issue Jan 31, 2018
kennytm added a commit to kennytm/rust that referenced this issue Jan 31, 2018
Fix ICE when reading non-UTF-8 input from stdin

Fixes rust-lang#22387.
steveklabnik added a commit to rust-lang/glacier that referenced this issue Feb 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

4 participants