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 when compiling gl-rs #18763

Closed
dylanmckay opened this issue Nov 8, 2014 · 8 comments · Fixed by #18811
Closed

ICE when compiling gl-rs #18763

dylanmckay opened this issue Nov 8, 2014 · 8 comments · Fixed by #18811

Comments

@dylanmckay
Copy link
Contributor

When I use cargo to compile my project which uses gl-rs, an ICE occurs. When I manually clone gl-rs and attempt to compile, I get the exact same error:

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
task 'rustc' panicked at 'quote! with interpolated token', >/home/dylan/repos/rust/src/libsyntax/ext/quote.rs:633

Could not compile gl_generator.

Here is the backtrace:

1: 0x7fe9c1361890 - rt::backtrace::imp::write::he67642d3b829f4b6Faq
2: 0x7fe9c1364910 - failure::on_fail::h0f4e0ad35cc550f6gwq
3: 0x7fe9c57235e0 - unwind::begin_unwind_inner::h9e3fbbb255fd1c4b7Rd
4: 0x7fe9c1e11ad0 - unwind::begin_unwind::h5285120681417997190
5: 0x7fe9c20688f0 - ext::quote::mk_token::h9254d3c2dd6ffda8hfh
6: 0x7fe9c206a1e0 - ext::quote::mk_tt::h3cdc34c164244863cqh
7: 0x7fe9c206be00 - ext::quote::mk_tt::closure.56433
8: 0x7fe9c206bb20 - iter::FlatMap<'a, A, T, U>.Iterator::next::h421631495718371731
9: 0x7fe9c206a1e0 - ext::quote::mk_tt::h3cdc34c164244863cqh
10: 0x7fe9c206be00 - ext::quote::mk_tt::closure.56433
11: 0x7fe9c206bb20 - iter::FlatMap<'a, A, T, U>.Iterator::next::h421631495718371731
12: 0x7fe9c206a1e0 - ext::quote::mk_tt::h3cdc34c164244863cqh
13: 0x7fe9c2065cb0 - ext::quote::expand_tts::h6ef186b72b10760dHvh
14: 0x7fe9c2067390 - ext::quote::expand_parse_call::h16b77497ffcd3db4gAh
15: 0x7fe9c1f89790 - ext::quote::expand_quote_item::hedd4505903555a77m4g
16: 0x7fe9c1f80a60 - ext::base::MacroExpanderFn.TTMacroExpander::expand::h1cc1a7937a382587VP6
17: 0x7fe9c1fdc5a0 - ext::expand::expand_mac_invoc::h7488295372212145400
18: 0x7fe9c1fd93d0 - ext::expand::expand_expr::h066b0582934d458apvd
19: 0x7fe9c1fde410 - fold::noop_fold_expr::h6174327986866184002
20: 0x7fe9c1fd93d0 - ext::expand::expand_expr::h066b0582934d458apvd
21: 0x7fe9c1fe2540 - fold::noop_fold_expr::closure.54816
22: 0x7fe9c1eab750 - fold::Vec.MoveMap::move_map::h3743046159375298917
23: 0x7fe9c1fde410 - fold::noop_fold_expr::h6174327986866184002
24: 0x7fe9c1fd93d0 - ext::expand::expand_expr::h066b0582934d458apvd
25: 0x7fe9c1fe2540 - fold::noop_fold_expr::closure.54816
26: 0x7fe9c1eab750 - fold::Vec.MoveMap::move_map::h3743046159375298917
27: 0x7fe9c1fde410 - fold::noop_fold_expr::h6174327986866184002
28: 0x7fe9c1fd93d0 - ext::expand::expand_expr::h066b0582934d458apvd
29: 0x7fe9c1fde410 - fold::noop_fold_expr::h6174327986866184002
30: 0x7fe9c1fd93d0 - ext::expand::expand_expr::h066b0582934d458apvd
31: 0x7fe9c1ff9030 - ext::expand::expand_non_macro_stmt::closure.55042
32: 0x7fe9c1e99a30 - ptr::P::map::h9046795597082364805
33: 0x7fe9c1ff6c40 - ext::expand::expand_stmt::h7cb2f23cc9f85a93K8d
34: 0x7fe9c1ff8ae0 - ext::expand::MacroExpander<'a, 'b>.Folder::fold_stmt::he497865f4d6ef039aBe
35: 0x7fe9c2013410 - ext::expand::expand_block_elts::closure.55281
36: 0x7fe9c1ea56a0 - iter::Iterator::collect::h7156353767204049429
37: 0x7fe9c2012600 - ext::expand::expand_block_elts::closure.55274
38: 0x7fe9c1ea4940 - ptr::P::map::h2015443453350656769
39: 0x7fe9c20124c0 - ext::expand::expand_block::h492f4ffb1ef0b079Eie
40: 0x7fe9c1fde410 - fold::noop_fold_expr::h6174327986866184002
41: 0x7fe9c1fd93d0 - ext::expand::expand_expr::h066b0582934d458apvd
42: 0x7fe9c1fd93d0 - ext::expand::expand_expr::h066b0582934d458apvd
43: 0x7fe9c2012600 - ext::expand::expand_block_elts::closure.55274
44: 0x7fe9c1ea4940 - ptr::P::map::h2015443453350656769
45: 0x7fe9c20124c0 - ext::expand::expand_block::h492f4ffb1ef0b079Eie
46: 0x7fe9c1fe6840 - ext::expand::expand_and_rename_fn_decl_and_block::ha31f1cddff26b6d26xe
47: 0x7fe9c1fec110 - ext::expand::MacroExpander<'a, 'b>.Folder::fold_item_underscore::hc89308dcb23bbc06UAe
48: 0x7fe9c1febc30 - fold::noop_fold_item::closure.54914
49: 0x7fe9c1e966f0 - ptr::P::map::h15211523799483024044
50: 0x7fe9c1fe6e00 - ext::expand::expand_item::hecdff326349e32303Pd
51: 0x7fe9c1ff2310 - fold::noop_fold_mod::closure.54943
52: 0x7fe9c1f32770 - iter::Iterator::collect::h3135972329917258468
53: 0x7fe9c1ff1160 - fold::Folder::fold_mod::h11237967112024482480
54: 0x7fe9c1fec110 - ext::expand::MacroExpander<'a, 'b>.Folder::fold_item_underscore::hc89308dcb23bbc06UAe
55: 0x7fe9c1febc30 - fold::noop_fold_item::closure.54914
56: 0x7fe9c1e966f0 - ptr::P::map::h15211523799483024044
57: 0x7fe9c1fe6e00 - ext::expand::expand_item::hecdff326349e32303Pd
58: 0x7fe9c1ff2310 - fold::noop_fold_mod::closure.54943
59: 0x7fe9c1f32770 - iter::Iterator::collect::h3135972329917258468
60: 0x7fe9c1ff1160 - fold::Folder::fold_mod::h11237967112024482480
61: 0x7fe9c1fec110 - ext::expand::MacroExpander<'a, 'b>.Folder::fold_item_underscore::hc89308dcb23bbc06UAe
62: 0x7fe9c1febc30 - fold::noop_fold_item::closure.54914
63: 0x7fe9c1e966f0 - ptr::P::map::h15211523799483024044
64: 0x7fe9c1fe6e00 - ext::expand::expand_item::hecdff326349e32303Pd
65: 0x7fe9c1ff2310 - fold::noop_fold_mod::closure.54943
66: 0x7fe9c1f32770 - iter::Iterator::collect::h3135972329917258468
67: 0x7fe9c1ff1160 - fold::Folder::fold_mod::h11237967112024482480
68: 0x7fe9c202fa50 - ext::expand::expand_crate::h5575a23411e1f5980De
69: 0x7fe9c6628b10 - driver::driver::phase_2_configure_and_expand::closure.145021
70: 0x7fe9c6394640 - driver::driver::phase_2_configure_and_expand::hb48b0f850eae919bJcC
71: 0x7fe9c65e72d0 - driver::driver::compile_input::ha8de362fab86449aP5B
72: 0x7fe9c6669a00 - driver::run_compiler::he3d0031d2d402bb56VF
73: 0x7fe9c66698f0 - driver::run::closure.146431
74: 0x7fe9c5da6b10 - task::TaskBuilder::try_future::closure.104846
75: 0x7fe9c5da6900 - task::TaskBuilder::spawn_internal::closure.104817
76: 0x7fe9c5a73c60 - task::NativeSpawner.Spawner::spawn::closure.8448
77: 0x7fe9c5782350 - rust_try_inner
78: 0x7fe9c5782340 - rust_try
79: 0x7fe9c5720f60 - unwind::try::he8efb306d3daa9c5PGd
80: 0x7fe9c5720df0 - task::Task::run::hb4a5d93e5e6bd5a4FMc
81: 0x7fe9c5a739a0 - task::NativeSpawner.Spawner::spawn::closure.8386
82: 0x7fe9c5722600 - thread::thread_start::h3217220e86a70fb2U7c
83: 0x7fe9c0713250 - start_thread
84: 0x7fe9c53fd3b9 - clone
85: 0x0 -

Note that this is using the newly updated master branches of both Rust and Cargo.

@pozar87
Copy link

pozar87 commented Nov 8, 2014

Same issue.
Rust: rustc 0.13.0-nightly (08.11.2014)
Cargo: cargo 0.0.1-pre-nightly (8cc600a 2014-11-07 21:15:52 +0000

    Compiling gl_generator v0.0.1 (https://github.com/bjz/gl-rs#678346eb)
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
task 'rustc' panicked at 'quote! with interpolated token', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/libsyntax/ext/quote.rs:633

stack backtrace:
   1:     0x7f47ba80c860 - rt::backtrace::imp::write::h6962a9f035a3164aFaq
   2:     0x7f47ba80f8e0 - failure::on_fail::h88b5054949466854gwq
   3:     0x7f47bed55c70 - unwind::begin_unwind_inner::h956a67c80425b5677Rd
   4:     0x7f47bded1480 - unwind::begin_unwind::h9893951301925131742
   5:     0x7f47be128080 - ext::quote::mk_token::hc6ac50e71cba3aa4hfh
   6:     0x7f47be129970 - ext::quote::mk_tt::hb0bd798dda9f1f7ccqh
   7:     0x7f47be12b590 - ext::quote::mk_tt::closure.56433
   8:     0x7f47be12b2b0 - iter::FlatMap<'a, A, T, U>.Iterator<B>::next::h9285657917981752866
   9:     0x7f47be129970 - ext::quote::mk_tt::hb0bd798dda9f1f7ccqh
  10:     0x7f47be12b590 - ext::quote::mk_tt::closure.56433
  11:     0x7f47be12b2b0 - iter::FlatMap<'a, A, T, U>.Iterator<B>::next::h9285657917981752866
  12:     0x7f47be129970 - ext::quote::mk_tt::hb0bd798dda9f1f7ccqh
  13:     0x7f47be125440 - ext::quote::expand_tts::h26b9fb72d181c7a5Hvh
  14:     0x7f47be126b20 - ext::quote::expand_parse_call::hf87863a12802998agAh
  15:     0x7f47be0490e0 - ext::quote::expand_quote_item::h913b58f924867343m4g
  16:     0x7f47be0403c0 - ext::base::MacroExpanderFn.TTMacroExpander::expand::h2531c9a5a5c4a146VP6
  17:     0x7f47be09bf00 - ext::expand::expand_mac_invoc::h5070259855386140
  18:     0x7f47be098d20 - ext::expand::expand_expr::hd06339d50d4e3518pvd
  19:     0x7f47be09dd40 - fold::noop_fold_expr::h17508862488002781673
  20:     0x7f47be098d20 - ext::expand::expand_expr::hd06339d50d4e3518pvd
  21:     0x7f47be0a1cb0 - fold::noop_fold_expr::closure.54816
  22:     0x7f47bdf6ac80 - fold::Vec<T>.MoveMap<T>::move_map::h2103895945899500191
  23:     0x7f47be09dd40 - fold::noop_fold_expr::h17508862488002781673
  24:     0x7f47be098d20 - ext::expand::expand_expr::hd06339d50d4e3518pvd
  25:     0x7f47be0a1cb0 - fold::noop_fold_expr::closure.54816
  26:     0x7f47bdf6ac80 - fold::Vec<T>.MoveMap<T>::move_map::h2103895945899500191
  27:     0x7f47be09dd40 - fold::noop_fold_expr::h17508862488002781673
  28:     0x7f47be098d20 - ext::expand::expand_expr::hd06339d50d4e3518pvd
  29:     0x7f47be09dd40 - fold::noop_fold_expr::h17508862488002781673
  30:     0x7f47be098d20 - ext::expand::expand_expr::hd06339d50d4e3518pvd
  31:     0x7f47be0b8700 - ext::expand::expand_non_macro_stmt::closure.55042
  32:     0x7f47bdf592d0 - ptr::P<T>::map::h17045300039264601048
  33:     0x7f47be0b6310 - ext::expand::expand_stmt::h415289a49dd1653cK8d
  34:     0x7f47be0b81b0 - ext::expand::MacroExpander<'a, 'b>.Folder::fold_stmt::h5a37c5b35924fca9aBe
  35:     0x7f47be0d2c20 - ext::expand::expand_block_elts::closure.55281
  36:     0x7f47bdf64f50 - iter::Iterator::collect::h7500869249246266630
  37:     0x7f47be0d1e10 - ext::expand::expand_block_elts::closure.55274
  38:     0x7f47bdf641f0 - ptr::P<T>::map::h9226135620174701605
  39:     0x7f47be0d1cd0 - ext::expand::expand_block::hd4fa4bc2262a7bf2Eie
  40:     0x7f47be09dd40 - fold::noop_fold_expr::h17508862488002781673
  41:     0x7f47be098d20 - ext::expand::expand_expr::hd06339d50d4e3518pvd
  42:     0x7f47be098d20 - ext::expand::expand_expr::hd06339d50d4e3518pvd
  43:     0x7f47be0d1e10 - ext::expand::expand_block_elts::closure.55274
  44:     0x7f47bdf641f0 - ptr::P<T>::map::h9226135620174701605
  45:     0x7f47be0d1cd0 - ext::expand::expand_block::hd4fa4bc2262a7bf2Eie
  46:     0x7f47be0a5fb0 - ext::expand::expand_and_rename_fn_decl_and_block::h765a4b29f62668726xe
  47:     0x7f47be0ab8a0 - ext::expand::MacroExpander<'a, 'b>.Folder::fold_item_underscore::had677d0d3e6000edUAe
  48:     0x7f47be0ab3c0 - fold::noop_fold_item::closure.54914
  49:     0x7f47bdf55fa0 - ptr::P<T>::map::h379406011177471474
  50:     0x7f47be0a6570 - ext::expand::expand_item::hba76819e858c6d563Pd
  51:     0x7f47be0b19d0 - fold::noop_fold_mod::closure.54943
  52:     0x7f47bdff1ea0 - iter::Iterator::collect::h1493905177343541632
  53:     0x7f47be0b0850 - fold::Folder::fold_mod::h13213550518250326075
  54:     0x7f47be0ab8a0 - ext::expand::MacroExpander<'a, 'b>.Folder::fold_item_underscore::had677d0d3e6000edUAe
  55:     0x7f47be0ab3c0 - fold::noop_fold_item::closure.54914
  56:     0x7f47bdf55fa0 - ptr::P<T>::map::h379406011177471474
  57:     0x7f47be0a6570 - ext::expand::expand_item::hba76819e858c6d563Pd
  58:     0x7f47be0b19d0 - fold::noop_fold_mod::closure.54943
  59:     0x7f47bdff1ea0 - iter::Iterator::collect::h1493905177343541632
  60:     0x7f47be0b0850 - fold::Folder::fold_mod::h13213550518250326075
  61:     0x7f47be0ab8a0 - ext::expand::MacroExpander<'a, 'b>.Folder::fold_item_underscore::had677d0d3e6000edUAe
  62:     0x7f47be0ab3c0 - fold::noop_fold_item::closure.54914
  63:     0x7f47bdf55fa0 - ptr::P<T>::map::h379406011177471474
  64:     0x7f47be0a6570 - ext::expand::expand_item::hba76819e858c6d563Pd
  65:     0x7f47be0b19d0 - fold::noop_fold_mod::closure.54943
  66:     0x7f47bdff1ea0 - iter::Iterator::collect::h1493905177343541632
  67:     0x7f47be0b0850 - fold::Folder::fold_mod::h13213550518250326075
  68:     0x7f47be0ef220 - ext::expand::expand_crate::h848537a1a598e0e20De
  69:     0x7f47bfc527a0 - driver::driver::phase_2_configure_and_expand::closure.145021
  70:     0x7f47bf9be260 - driver::driver::phase_2_configure_and_expand::h022162699ec14c3aJcC
  71:     0x7f47bfc10f60 - driver::driver::compile_input::h9c830efbfaf34c7aP5B
  72:     0x7f47bfc93700 - driver::run_compiler::h4d729096c46ed8f76VF
  73:     0x7f47bfc935f0 - driver::run::closure.146431
  74:     0x7f47bf3cfb60 - task::TaskBuilder<S>::try_future::closure.104846
  75:     0x7f47bf3cf950 - task::TaskBuilder<S>::spawn_internal::closure.104817
  76:     0x7f47bf09c530 - task::NativeSpawner.Spawner::spawn::closure.8448
  77:     0x7f47bedaab70 - rust_try_inner
  78:     0x7f47bedaab60 - rust_try
  79:     0x7f47bed535f0 - unwind::try::h51d29a2dceb13095PGd
  80:     0x7f47bed53480 - task::Task::run::h8c90cb04437a131dFMc
  81:     0x7f47bf09c270 - task::NativeSpawner.Spawner::spawn::closure.8386
  82:     0x7f47bed54c90 - thread::thread_start::h7bbfc46247c32113U7c
  83:     0x7f47b9bbe250 - start_thread
  84:     0x7f47bea2f3b9 - clone
  85:                0x0 - <unknown>

@tomaka
Copy link
Contributor

tomaka commented Nov 8, 2014

It's probably broken due to #17830

gl_generator doesn't use or define any macro, all it does is call quote!.

cc @pczarn

@tomaka
Copy link
Contributor

tomaka commented Nov 8, 2014

After some investigations, it comes from these two functions:

If I remove the doccomments from the inside of quote_item!, there's no ICE anymore.

EDIT: This commit removes the ICE: brendanzab/gl-rs@f14da1e

EDIT2: It's because of the vec![] macro.

@tomaka
Copy link
Contributor

tomaka commented Nov 8, 2014

Minimal test case:

vec![quote_item!(ecx, /** test */ fn hello() {})]]

@pczarn
Copy link
Contributor

pczarn commented Nov 8, 2014

This error originates in TokenTree's fn get_tt

Thanks!

pczarn added a commit to pczarn/rust that referenced this issue Nov 9, 2014
* fixed get_tt for doc comments
* properly handle MatchNt in `quote`

Fixes rust-lang#18763
Fixes rust-lang#18775
@dylanmckay
Copy link
Contributor Author

@pczarn is this now resolved?

EDIT: I realised that you fix hasn't been merged yet.

@pczarn
Copy link
Contributor

pczarn commented Nov 10, 2014

@dylanmckay Not yet, until the PR gets merged

@tomaka
Copy link
Contributor

tomaka commented Nov 11, 2014

@dylanmckay Note that gl-rs has been updated to bypass these issues

bors added a commit that referenced this issue Nov 13, 2014
Fix ICEs introduced in #17830

* fixed get_tt for doc comments
* properly handle MatchNt in `quote`

Fixes #18763
Fixes #18775
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

Successfully merging a pull request may close this issue.

4 participants