Skip to content

Cargo build fails on Utf8Error #33910

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

Closed
johnjelinek opened this issue May 27, 2016 · 3 comments
Closed

Cargo build fails on Utf8Error #33910

johnjelinek opened this issue May 27, 2016 · 3 comments

Comments

@johnjelinek
Copy link

$ RUST_BACKTRACE=1 cargo run --verbose

I tried this code:

pub fn main() {
    println!("Hello world");
}

I expected to see this happen: Hello world

Instead, this happened:

   Compiling my_project v0.1.0 (file:///Users/administrator/Projects/my_project)
     Running `rustc main.rs --crate-name my_project --crate-type bin -g --out-dir /Users/administrator/Projects/my_project/target/debug --emit=dep-info,link -L dependency=/Users/administrator/Projects/my_project/target/debug -L dependency=/Users/administrator/Projects/my_project/target/debug/deps`
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: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: Utf8Error { valid_up_to: 0 }', ../src/libcore/result.rs:746
stack backtrace:
   1:        0x10f9403a8 - std::sys::backtrace::tracing::imp::write::h4c73fcd3363076f5
   2:        0x10f94c7f5 - std::panicking::default_hook::_$u7b$$u7b$closure$u7d$$u7d$::h0422dbb3077e6747
   3:        0x10f94c32f - std::panicking::default_hook::haac48fa641db8fa2
   4:        0x10f910f86 - std::sys_common::unwind::begin_unwind_inner::h39d40f52add53ef7
   5:        0x10f91308e - std::sys_common::unwind::begin_unwind_fmt::h64c0ff793199cc1b
   6:        0x10f93dba7 - rust_begin_unwind
   7:        0x10f988df0 - core::panicking::panic_fmt::h73bf9d7e8e891a73
   8:        0x10f76459a - core::result::unwrap_failed::h82c81d60621f70bd
   9:        0x10f764500 - rbml::Doc::as_str_slice::hd88d17b04c3f2cca
  10:        0x10ba6bac4 - rustc_metadata::decoder::maybe_get_crate_hash::h1c0939ce4d9ba236
  11:        0x10baa0874 - rustc_metadata::loader::Context::extract_one::h56453781fb65bffa
  12:        0x10ba98953 - rustc_metadata::loader::Context::find_library_crate::h30ea71d32623d713
  13:        0x10ba7da99 - rustc_metadata::loader::Context::load_library_crate::h7787c1fa9559d604
  14:        0x10ba7cae6 - rustc_metadata::creader::CrateReader::resolve_crate::h98decfaedbcfe12a
  15:        0x10ba7e1fb - rustc_metadata::creader::CrateReader::resolve_crate_deps::_$u7b$$u7b$closure$u7d$$u7d$::h4bd0eba4f8aa0bca
  16:        0x10ba7df9b - _<std..collections..HashMap<K, V, S> as std..iter..FromIterator<(K, V)>>::from_iter::h7ccc89cd3e9da036
  17:        0x10ba79e6c - rustc_metadata::creader::CrateReader::register_crate::hdfd966766b932c68
  18:        0x10ba7f028 - rustc_metadata::creader::CrateReader::read_extension_crate::hb0997de4fb0918fb
  19:        0x10ba81315 - rustc_metadata::creader::CrateReader::read_exported_macros::hf3b61431145aafb6
  20:        0x10baa5a7c - _<macro_import..MacroLoader<'a> as syntax..visit..Visitor<'v>>::visit_item::h668e7bfc1acab9b3
  21:        0x10baa488a - rustc_metadata::macro_import::read_macro_defs::h240a20dad60749cc
  22:        0x10b47e8ab - rustc_driver::driver::phase_2_configure_and_expand::h505e157de342d54f
  23:        0x10b464ea6 - rustc_driver::driver::compile_input::h6491aaddd9e61258
  24:        0x10b44dd8f - rustc_driver::run_compiler::h80b2ba5e4d787c5f
  25:        0x10b44b122 - std::sys_common::unwind::try::try_fn::h34e27823ddd1d5e9
  26:        0x10f93db3b - __rust_try
  27:        0x10f93dac3 - std::sys_common::unwind::inner_try::h9eebd8dc83f388a6
  28:        0x10b44b9b9 - _<F as std..boxed..FnBox<A>>::call_box::h3d5d78986dfac5b2
  29:        0x10f94b6c8 - std::sys::thread::Thread::new::thread_start::h471ad90789353b5b
  30:     0x7fff8aeeb059 - _pthread_body
  31:     0x7fff8aeeafd6 - _pthread_start

error: Could not compile `my_project`.

Caused by:
  Process didn't exit successfully: `rustc main.rs --crate-name my_project --crate-type bin -g --out-dir /Users/administrator/Projects/my_project/target/debug --emit=dep-info,link -L dependency=/Users/administrator/Projects/my_project/target/debug -L dependency=/Users/administrator/Projects/my_project/target/debug/deps` (exit code: 101)

Meta

rustc --version --verbose:

rustc 1.9.0 (e4e8b6668 2016-05-18)
binary: rustc
commit-hash: e4e8b666850a763fdf1c3c2c142856ab51e32779
commit-date: 2016-05-18
host: x86_64-apple-darwin
release: 1.9.0
@nagisa
Copy link
Member

nagisa commented May 27, 2016

Duplicate of #33778

@nagisa nagisa closed this as completed May 27, 2016
@nagisa
Copy link
Member

nagisa commented May 27, 2016

@johnjelinek a question: is this a completely new cargo project? This is a first case I see this reported for something without any dependencies.

@johnjelinek
Copy link
Author

it's not a completely new cargo project. I added a dependency for sdl2 and core-native and then removed the dependencies and changed main.rs to what it is in the bug report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants