{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/36622","repository_url":"https://api.github.com/repos/rust-lang/rust","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/36622/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/36622/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/36622/events","html_url":"https://github.com/rust-lang/rust/issues/36622","id":178342259,"number":36622,"title":"ICE with RUST_LOG=debug and dependency rand","user":{"login":"Eroc33","id":599099,"avatar_url":"https://avatars.githubusercontent.com/u/599099?v=3","gravatar_id":"","url":"https://api.github.com/users/Eroc33","html_url":"https://github.com/Eroc33","followers_url":"https://api.github.com/users/Eroc33/followers","following_url":"https://api.github.com/users/Eroc33/following{/other_user}","gists_url":"https://api.github.com/users/Eroc33/gists{/gist_id}","starred_url":"https://api.github.com/users/Eroc33/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eroc33/subscriptions","organizations_url":"https://api.github.com/users/Eroc33/orgs","repos_url":"https://api.github.com/users/Eroc33/repos","events_url":"https://api.github.com/users/Eroc33/events{/privacy}","received_events_url":"https://api.github.com/users/Eroc33/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rust-lang/rust/labels/I-ICE","name":"I-ICE","color":"e10c02"},{"url":"https://api.github.com/repos/rust-lang/rust/labels/regression-from-stable-to-beta","name":"regression-from-stable-to-beta","color":"FF309F"},{"url":"https://api.github.com/repos/rust-lang/rust/labels/T-compiler","name":"T-compiler","color":"bfd4f2"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-09-21T13:10:29Z","updated_at":"2016-10-02T15:58:49Z","closed_at":null,"body":"`cargo 0.13.0-nightly (2ef3cde 2016-09-04)`\r\n`rustc 1.13.0-nightly (cbe4de78e 2016-09-05)`\r\n\r\nrepro steps:\r\n 1. Create a new cargo project with `cargo new --bin whatever`\r\n 2. add rand to the dependencies\r\n 3. compile with `RUST_LOG=debug cargo run`\r\n\r\n(Edit: `RUST_LOG=debug cargo build` also triggers the ICE)\r\n\r\n(Note that using various different crates as dependencies will also cause various different ICEs)\r\n\r\n(Also note that most of these ICEs do not occur if not setting `RUST_LOG` while compiling)\r\n\r\nfull log: [ice_log.txt](https://github.com/rust-lang/rust/files/485059/ice_log.txt)\r\n\r\nRelevant excerpt:\r\n```\r\nINFO:rustc_trans::base: trans_closure(..., <I as std::iter::IntoIterator><std::iter::Chain<std::iter::Map<std::slice::Iter<u64>, [closure@C:\\Users\\euan\\.cargo\\registry\\src\\github.com-1ecc6299db9ec823\\rand-0.3.14\\src\\isaac.rs:462:41: 462:47]>, std::iter::Repeat<u64>>>::into_iter)\r\nINFO:rustc_trans::base: trans_closure(..., <I as std::iter::IntoIterator><std::iter::Map<std::ops::Range<usize>, [closure@C:\\Users\\euan\\.cargo\\registry\\src\\github.com-1ecc6299db9ec823\\rand-0.3.14\\src\\isaac.rs:378:47: 378:56]>>::into_iter)\r\nINFO:rustc_trans::base: trans_closure(..., <I as std::iter::IntoIterator><std::iter::Zip<std::slice::IterMut<std::num::Wrapping<u64>>, std::iter::Chain<std::iter::Map<std::slice::Iter<u64>, [closure@C:\\Users\\euan\\.cargo\\registry\\src\\github.com-1ecc6299db9ec823\\rand-0.3.14\\src\\isaac.rs:462:41: 462:47]>, std::iter::Repeat<u64>>>>::into_iter)\r\nINFO:rustc_trans::base: trans_closure(..., <&'a T as std::fmt::Display><str>::fmt)\r\nINFO:rustc_trans::base: trans_closure(..., <std::rc::Rc<T> as std::ops::Drop><std::cell::RefCell<reseeding::ReseedingRng<StdRng, ThreadRngReseeder>>>::drop)\r\nINFO:rustc_trans::base: trans_closure(..., <std::rc::Rc<T> as std::ops::Deref><std::cell::RefCell<reseeding::ReseedingRng<StdRng, ThreadRngReseeder>>>::deref)\r\nINFO:rustc_trans::base: trans_closure(..., <std::rc::Rc<std::cell::RefCell<reseeding::ReseedingRng<StdRng, ThreadRngReseeder>>> as std::rc::RcBoxPtr<std::cell::RefCell<reseeding::ReseedingRng<StdRng, ThreadRngReseeder>>>>::dec_strong)\r\nINFO:rustc_trans::base: trans_closure(..., <std::rc::Rc<std::cell::RefCell<reseeding::ReseedingRng<StdRng, ThreadRngReseeder>>> as std::rc::RcBoxPtr<std::cell::RefCell<reseeding::ReseedingRng<StdRng, ThreadRngReseeder>>>>::inc_strong)\r\nINFO:rustc_trans::base: trans_closure(..., ERROR:rbml::reader: failed to find block with tag 143\r\nerror: internal compiler error: unexpected panic\r\n\r\nnote: the compiler unexpectedly panicked. this is a bug.\r\n\r\nnote: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports\r\n\r\nnote: run with `RUST_BACKTRACE=1` for a backtrace\r\n\r\nthread 'rustc' panicked at 'explicit panic', ../src/librbml/lib.rs:436\r\nstack backtrace:\r\n   0:     0x7ffa3ff56fda - <std::rand::OsRng as rand::Rng>::fill_bytes::h076068e3d5c70638\r\n   1:     0x7ffa3ff54d40 - std::panicking::Location::line::h1d71b2da86bcc037\r\n   2:     0x7ffa3ff557cd - std::panicking::rust_panic_with_hook::hb1322e5f2588b4db\r\n   3:     0x7ffa44651273 - <unknown>\r\n   4:     0x7ffa4465302c - rbml::reader::get_doc::hf109ec97c202ad64\r\n   5:     0x7ffa3d024707 - rustc_metadata::decoder::get_generics::hf99308a6734a6c62\r\n   6:     0x7ffa3d04409f - rustc_metadata::csearch::<impl rustc::middle::cstore::CrateStore<'tcx> for rustc_metadata::cstore::CStore>::item_generics::h44e6e64c15136301\r\n   7:     0x7ffa3780a432 - rustc::ty::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::lookup_generics::h5d0ec4d9f7a8a996\r\n   8:     0x7ffa378122b2 - rustc::util::ppaux::parameterized::hfe6ba681ef424d4e\r\n   9:     0x7ffa3fbc61aa - <rustc_trans::monomorphize::Instance<'tcx> as core::fmt::Display>::fmt::h4bb5172b1516f67e\r\n  10:     0x7ffa3ff85694 - core::fmt::write::h300d6e605e327781\r\n  11:     0x7ffa3ff85392 - <core::fmt::Arguments<'a> as core::fmt::Debug>::fmt::h1da25a9952bf0c75\r\n  12:     0x7ffa3ff85694 - core::fmt::write::h300d6e605e327781\r\n  13:     0x7ffa3ff337dd - <std::io::stdio::Stderr as std::io::Write>::write_fmt::h559a8ee8db54dc03\r\n  14:     0x7ffa4ae41fbc - <log::DefaultLogger as log::Logger>::log::h514ee6b9954c2db7\r\n  15:     0x7ffa4ae42d85 - log::log::h551356a60d785f61\r\n  16:     0x7ffa3fb2f1a6 - rustc_trans::base::<impl rustc_trans::common::FunctionContext<'blk, 'tcx>>::build_return_block::hc40c124e6ced672c\r\n  17:     0x7ffa3fb54cf1 - <rustc_trans::cleanup::UnwindKind as core::cmp::PartialEq>::eq::h586cba4e1cacdefe\r\n  18:     0x7ffa3fbbdec2 - <rustc_trans::mir::operand::OperandRef<'tcx> as core::fmt::Debug>::fmt::hebcdf3c5cd4db77c\r\n  19:     0x7ffa3fbaa046 - <rustc_trans::mir::analyze::CleanupKind as core::cmp::PartialEq>::ne::ha52631b54e0dcbae\r\n  20:     0x7ffa3fba725f - <rustc_trans::mir::CachedMir<'mir, 'tcx> as core::ops::Deref>::deref::h6f4e0d0cf4c71518\r\n  21:     0x7ffa3fb2f409 - rustc_trans::base::<impl rustc_trans::common::FunctionContext<'blk, 'tcx>>::build_return_block::hc40c124e6ced672c\r\n  22:     0x7ffa3fbcf025 - rustc_trans::trans_item::TransItem::define::h159a1f0a8708f3d3\r\n  23:     0x7ffa3fb33221 - rustc_trans::base::trans_crate::hf067cf9d0a8bcbf2\r\n  24:     0x7ffa4024deb4 - rustc_driver::driver::phase_4_translate_to_llvm::he9d5d0022988d46e\r\n  25:     0x7ffa4029d483 - rustc_driver::main::h5a1049f207c7c577\r\n  26:     0x7ffa40280641 - rustc_driver::main::h5a1049f207c7c577\r\n  27:     0x7ffa401be5d2 - <unknown>\r\n  28:     0x7ffa4023dadf - rustc_driver::driver::compile_input::h7dacd98cd2fd7d2b\r\n  29:     0x7ffa4026a5e9 - rustc_driver::run_compiler::h37c4294ab73436f7\r\n  30:     0x7ffa4018b051 - <unknown>\r\n  31:     0x7ffa3ff5fa31 - _rust_maybe_catch_panic\r\n  32:     0x7ffa401a84f4 - <unknown>\r\n  33:     0x7ffa3ff529ce - std::sys::thread::Thread::new::h117e066ad5633902\r\n  34:     0x7ffa65788363 - BaseThreadInitThunk\r\n\r\nINFO:cargo::ops::cargo_rustc::job_queue: end: rand v0.3.14 => Target(lib)/Profile(build) => Host\r\nDEBUG:cargo: handle_error; err=CliError { error: Some(ChainedError { error: Could not compile `rand`., cause: Process didn't exit successfully: `rustc C:\\Users\\euan\\.cargo\\registry\\src\\github.com-1ecc6299db9ec823\\rand-0.3.14\\src\\lib.rs --crate-name rand --crate-type lib -g -C metadata=49a08859d086fffe -C extra-filename=-49a08859d086fffe --out-dir D:\\dev\\rust\\testing\\target\\debug\\deps --emit=dep-info,link -L dependency=D:\\dev\\rust\\testing\\target\\debug\\deps --extern libc=D:\\dev\\rust\\testing\\target\\debug\\deps\\liblibc-1417726cb94dbc83.rlib --cap-lints allow` (exit code: 101) }), unknown: false, exit_code: 101 }\r\nerror: Could not compile `rand`.\r\n```"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/250978480","html_url":"https://github.com/rust-lang/rust/issues/36622#issuecomment-250978480","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/36622","id":250978480,"user":{"login":"eddyb","id":77424,"avatar_url":"https://avatars.githubusercontent.com/u/77424?v=3","gravatar_id":"","url":"https://api.github.com/users/eddyb","html_url":"https://github.com/eddyb","followers_url":"https://api.github.com/users/eddyb/followers","following_url":"https://api.github.com/users/eddyb/following{/other_user}","gists_url":"https://api.github.com/users/eddyb/gists{/gist_id}","starred_url":"https://api.github.com/users/eddyb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eddyb/subscriptions","organizations_url":"https://api.github.com/users/eddyb/orgs","repos_url":"https://api.github.com/users/eddyb/repos","events_url":"https://api.github.com/users/eddyb/events{/privacy}","received_events_url":"https://api.github.com/users/eddyb/received_events","type":"User","site_admin":false},"created_at":"2016-10-02T15:58:49Z","updated_at":"2016-10-02T15:58:49Z","body":"@est31 Title is misleading, rustc \"debug\" logging (literally `99.99%` of all `RUST_LOG` output from `rustc`) *doesn't* work on stable, but handful of `info!` do.\r\n\r\nIt's one of those rare cases where the information is essential to debugging ICEs and whatnot.\r\nThe closure bug is preexisting, but ended up exposed (@oli-obk and @solson hit it in  miri before).\r\n\r\nOne reasonable workaround that can be backported to beta is adding [a loop like this](https://github.com/rust-lang/rust/blob/791fb778ccfb3dc831d99544093a9d4e3cf82a49/src/librustc_trans/back/symbol_names.rs#L239-L263) before [this line](https://github.com/rust-lang/rust/blob/791fb778ccfb3dc831d99544093a9d4e3cf82a49/src/librustc/util/ppaux.rs#L79), and the [namespace `enum`](https://github.com/rust-lang/rust/blob/791fb778ccfb3dc831d99544093a9d4e3cf82a49/src/librustc/util/ppaux.rs#L59-L64) argument to `parametrized` can be replaced with `DefPathData::{Type,Value}Ns`\r\n(since the loop finishes only when one of them is reached).\r\n\r\nActually giving closures generics can be done after the refactor I'm working on lands, but right now it'd just be a messier hack, and printing code has to be rewritten anyway to handle multi-level generics."}}
{"actor":{"display_login":"eddyb"}}