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

rustc panics on non-utf8 filenames #32427

Closed
sp3d opened this issue Mar 22, 2016 · 2 comments
Closed

rustc panics on non-utf8 filenames #32427

sp3d opened this issue Mar 22, 2016 · 2 comments

Comments

@sp3d
Copy link
Contributor

sp3d commented Mar 22, 2016

When invoking "rustc file-ÿ.rs", with the file stored on a Latin-1 encoded filesystem, rustc immediately panics:

thread '<main>' panicked at 'called `Result::unwrap()` on an `Err` value: "file-\u{fffd}"', ../src/libcore/result.rs:746
stack backtrace:
   1:     0x7f48876bf170 - sys::backtrace::tracing::imp::write::hbb9e76a649a66a56ZRu
   2:     0x7f48876cc95b - panicking::default_hook::_$u7b$$u7b$closure$u7d$$u7d$::closure.45161
   3:     0x7f48876cc5a3 - panicking::default_hook::h52b379d7e28163dbOoA
   4:     0x7f4887690faf - sys_common::unwind::begin_unwind_inner::hbc816cb06424e5a1dHt
   5:     0x7f48876929a8 - sys_common::unwind::begin_unwind_fmt::h2ffe904d33bcabedjGt
   6:     0x7f48876bca71 - rust_begin_unwind
   7:     0x7f48877162ef - panicking::panic_fmt::h02e62dce441c8af9USL
   8:     0x7f4887692069 - result::unwrap_failed::h573141488342841329
   9:     0x7f48876946e9 - env::Args.Iterator::next::hbd5e03814c81dfb5Jhe
  10:     0x7f4887bd3ac8 - main::ha3761125df75122eQ0d
  11:     0x7f48876cc044 - sys_common::unwind::try::try_fn::h17561491976180921527
  12:     0x7f48876bc9fb - __rust_try
  13:     0x7f48876cbadb - rt::lang_start::h123d5d5aa2b127831gA
  14:     0x7f488727c70f - __libc_start_main
  15:     0x556a19e88788 - <unknown>
@ivanceras
Copy link

I could not reproduce the error. What version of rust are you using?

$rustc -V
rustc 1.7.0 (a5d1e7a59 2016-02-29)

$cat file-ÿ.rs 
use std::io::prelude::*;
use std::fs::File;

fn main(){
    println!("hello world!");
    let mut f = File::open("file-ÿ.rs").unwrap();
    let mut s = String::new();
    f.read_to_string(&mut s);
    println!("{}",s);
}

@alexcrichton
Copy link
Member

I think this is a dupe of #15890, but thanks for the 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

3 participants