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

Compiler crash in ebml.rs #2089

Closed
evanmcc opened this issue Mar 31, 2012 · 10 comments
Closed

Compiler crash in ebml.rs #2089

evanmcc opened this issue Mar 31, 2012 · 10 comments
Labels
A-frontend Area: Compiler frontend (errors, parsing and HIR) I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
Milestone

Comments

@evanmcc
Copy link

evanmcc commented Mar 31, 2012

import io::{println};
import vec;

fn main(args: [str]) {
    let mut args = args;
    let binary: str = vec::shift(args);
    println(binary);
}

fails to compile with the error:

evan@bodine:~/src/rustbugs/ebml$ RUST_LOG=rustc=1,::rt::backtrace rustc ebml.rs
rust: upcall fail 'Expected label id but found node', src/libstd/ebml.rs:380
error: internal compiler error unexpected failure
note: The compiler hit an unexpected failure path. This is a bug. Try running with RUST_LOG=rustc=0,::rt::backtrace to get further details and report the results to github.com/mozilla/rust/issues
rust: upcall fail 'explicit failure', src/rustc/driver/rustc.rs:182
rust: domain main @0x102829600 root task failed

This seems to be the minimal repro case. I haven't been able to work around it, so not entirely sure what's happening.

OS X 10.6, intel core2duo, branch master at commit 0904f25

@ghost ghost assigned catamorphism Mar 31, 2012
@catamorphism
Copy link
Contributor

I can't reproduce this, either in HEAD or commit 0904f25. The test runs in either case.

Can you do a make clean, update to HEAD (currently 21be137 ) and try again? Thanks.

@evanmcc
Copy link
Author

evanmcc commented Apr 3, 2012

got 28a0e9c (current HEAD) can still repro. What does ebml.rs do? Any pointers for debugging this here?

@catamorphism
Copy link
Contributor

ebml.rs is a library that reads/writes data in a binary XML-like format called EBML (see http://ebml.sourceforge.net/ ). In rustc, it's used to serialize data needed for separate compilation (when you import another crate, rustc reads some data written in EBML format to find out how to typecheck uses of items defined in other crates). Usually a bug like this means there's an inconsistent between the decoder and the encoder (like a parser and a prettyprinter) -- see the files under rustc/metadata.

It's going to be hard to debug this without being able to reproduce it, but for starters, can you get a backtrace in gdb? (Ask on IRC if you have trouble with that.)

@catamorphism
Copy link
Contributor

(I guess there's a remote possibility that I might not be seeing the bug because I build with optimization disabled. I'll try rebuilding with optimization when I get a chance)

@evanmcc
Copy link
Author

evanmcc commented Apr 3, 2012

I tried rebuilding without optimization and still have the issue.

I'll try to get a breakpoint in there, but some change landed a couple of days ago that's making finding the right function to put a breakpoint on a total nightmare. I'll ask in IRC tomorrow if anyone has any pointers. The bug name is inaccurate, I guess, since it isn't crashing but exiting normally in a bad way, so without the breakpoint, it's hard to get the bt.

@catamorphism
Copy link
Contributor

Usually setting a breakpoint on upcall_fail works for me?

@evanmcc
Copy link
Author

evanmcc commented Apr 3, 2012

Yup, that works great, here's the bt:

#0  upcall_fail (expr=0x1028231d0 "Expected label id but found node", file=0x1002b89f0 "src/libstd/ebml.rs", line=380) at ./src/rt/rust_upcall.cpp:131
#1  0x00000001002851cb in ebml::deserializer::meth1087::_check_label::_f97d1eea9748b6c4 ()
#2  0x0000000101012e6b in ebml::deserializer::read_rec_field16949::_f8d16f9fcca79949 ()
#3  0x0000000101045ba4 in ast::deserialize_expr17762::anon ()
#4  0x0000000101045ac7 in ebml::deserializer::read_rec17763::_5510d52db8a9e984 ()
#5  0x0000000101045930 in ast::deserialize_expr17762::_50fae7424f47d2cb ()
#6  0x000000010107a8c6 in ast::deserialize_expr_17773::anon::anon::anon::anon ()
#7  0x0000000101045857 in ebml::deserializer::read_box17759::_5510d52db8a9e984 ()
#8  0x000000010107a7e0 in ast::deserialize_expr_17773::anon::anon::anon ()
#9  0x000000010100d71b in ebml::deserializer::read_enum_variant_arg16867::_f57b5617a6bef42d ()
#10 0x000000010104b1a5 in ast::deserialize_expr_17773::anon::anon ()
#11 0x00000001010477d9 in ebml::deserializer::read_enum_variant17780::anon ()
#12 0x0000000101046d89 in ebml::deserializer::push_doc17778::_98191aa6c222131e ()
#13 0x00000001010476b5 in ebml::deserializer::read_enum_variant17780::_26e5b3559965fba6 ()
#14 0x000000010104715c in ast::deserialize_expr_17773::anon ()
#15 0x0000000101046d89 in ebml::deserializer::push_doc17778::_98191aa6c222131e ()
#16 0x0000000101046c14 in ebml::deserializer::read_enum17774::_f5d7bd6ad7b247ce ()
#17 0x0000000101046772 in ast::deserialize_expr_17773::_b9409df98b7767b3 ()
#18 0x00000001010466d6 in ast::deserialize_expr17762::anon::anon ()
#19 0x0000000101046662 in ebml::deserializer::read_rec_field17767::_58c0a564a962b62b ()
#20 0x0000000101045cf1 in ast::deserialize_expr17762::anon ()
#21 0x0000000101045ac7 in ebml::deserializer::read_rec17763::_5510d52db8a9e984 ()
#22 0x0000000101045930 in ast::deserialize_expr17762::_50fae7424f47d2cb ()
#23 0x0000000101050956 in ast::deserialize_expr_17773::anon::anon::anon::anon ()
#24 0x0000000101045857 in ebml::deserializer::read_box17759::_5510d52db8a9e984 ()
#25 0x0000000101050870 in ast::deserialize_expr_17773::anon::anon::anon ()
#26 0x000000010100d71b in ebml::deserializer::read_enum_variant_arg16867::_f57b5617a6bef42d ()
#27 0x0000000101047f14 in ast::deserialize_expr_17773::anon::anon ()
#28 0x00000001010477d9 in ebml::deserializer::read_enum_variant17780::anon ()
#29 0x0000000101046d89 in ebml::deserializer::push_doc17778::_98191aa6c222131e ()
#30 0x00000001010476b5 in ebml::deserializer::read_enum_variant17780::_26e5b3559965fba6 ()
#31 0x000000010104715c in ast::deserialize_expr_17773::anon ()
#32 0x0000000101046d89 in ebml::deserializer::push_doc17778::_98191aa6c222131e ()
#33 0x0000000101046c14 in ebml::deserializer::read_enum17774::_f5d7bd6ad7b247ce ()
#34 0x0000000101046772 in ast::deserialize_expr_17773::_b9409df98b7767b3 ()
#35 0x00000001010466d6 in ast::deserialize_expr17762::anon::anon ()
#36 0x0000000101046662 in ebml::deserializer::read_rec_field17767::_58c0a564a962b62b ()
#37 0x0000000101045cf1 in ast::deserialize_expr17762::anon ()
#38 0x0000000101045ac7 in ebml::deserializer::read_rec17763::_5510d52db8a9e984 ()
#39 0x0000000101045930 in ast::deserialize_expr17762::_50fae7424f47d2cb ()
#40 0x00000001010713e6 in ast::deserialize_initializer18322::anon::anon::anon ()
#41 0x0000000101045857 in ebml::deserializer::read_box17759::_5510d52db8a9e984 ()
#42 0x0000000101071300 in ast::deserialize_initializer18322::anon::anon ()
#43 0x0000000101024dc2 in ebml::deserializer::read_rec_field17202::_ed6152aad6d42a1c ()
#44 0x0000000101070dc1 in ast::deserialize_initializer18322::anon ()
#45 0x0000000101070b97 in ebml::deserializer::read_rec18323::_be673fed8ae6bd2f ()
#46 0x0000000101070a00 in ast::deserialize_initializer18322::_e6b58df05482727e ()
#47 0x0000000101070986 in ast::deserialize_local_18192::anon::anon::anon ()
#48 0x00000001010708aa in serialization::deserialize_option18295::anon::anon::anon ()
#49 0x000000010107084b in ebml::deserializer::read_enum_variant_arg18314::_402345d4b8b3a4ef ()
#50 0x0000000101070391 in serialization::deserialize_option18295::anon::anon ()
#51 0x0000000101070219 in ebml::deserializer::read_enum_variant18304::anon ()
#52 0x000000010106f983 in ebml::deserializer::push_doc18300::_34bbffe85e76d1f6 ()
#53 0x00000001010700f5 in ebml::deserializer::read_enum_variant18304::_d6d495c9c88ed721 ()
#54 0x000000010106fba2 in serialization::deserialize_option18295::anon ()
#55 0x000000010106f983 in ebml::deserializer::push_doc18300::_34bbffe85e76d1f6 ()
#56 0x000000010106f844 in ebml::deserializer::read_enum18296::_338cbb4f7e6b4233 ()
#57 0x000000010106f38e in serialization::deserialize_option18295::_2eb9cffaf9fec8d1 ()
#58 0x000000010106f27d in ast::deserialize_local_18192::anon::anon ()
#59 0x000000010106f1e2 in ebml::deserializer::read_rec_field18289::_9eaa2477d7039205 ()
#60 0x00000001010677e2 in ast::deserialize_local_18192::anon ()
#61 0x00000001010672f7 in ebml::deserializer::read_rec18193::_7f8f115951178a7b ()
#62 0x0000000101067160 in ast::deserialize_local_18192::_21c32d997cac9f59 ()
#63 0x00000001010670e6 in ast::deserialize_local18176::anon ()
#64 0x0000000101066faa in ast::deserialize_spanned18177::anon::anon ()
#65 0x0000000101066f32 in ebml::deserializer::read_rec_field18181::_a5a8e2e970993d3e ()
#66 0x000000010106665f in ast::deserialize_spanned18177::anon ()
#67 0x0000000101066577 in ebml::deserializer::read_rec18178::_cb9886fcc6249bc0 ()
#68 0x00000001010663e3 in ast::deserialize_spanned18177::_26dcb05f6d472d33 ()
#69 0x00000001010662f1 in ast::deserialize_local18176::_b13d17dfb7af375e ()
#70 0x0000000101066276 in ast::deserialize_decl_18152::anon::anon::anon::anon::anon ()
#71 0x0000000101066217 in ebml::deserializer::read_box18173::_cb9886fcc6249bc0 ()
#72 0x0000000101065ed0 in ast::deserialize_decl_18152::anon::anon::anon::anon ()
#73 0x00000001010186aa in serialization::read_to_vec17017::anon::anon::anon ()
#74 0x00000001010185a3 in ebml::deserializer::push_doc17031::_298d5ad311a76d51 ()
#75 0x000000010101845e in ebml::deserializer::read_vec_elt17027::_f57b5617a6bef42d ()
#76 0x0000000101018003 in serialization::read_to_vec17017::anon::anon ()
#77 0x0000000101017edb in vec::from_fn17026::_6ae4a4efa7c05b3a ()
#78 0x0000000101017d37 in serialization::read_to_vec17017::anon ()
#79 0x0000000101017c4f in ebml::deserializer::read_vec17018::anon ()
#80 0x0000000101017833 in ebml::deserializer::push_doc17021::_b5baf1ac7429cb1d ()
#81 0x0000000101017680 in ebml::deserializer::read_vec17018::_63ec328989e88294 ()
#82 0x0000000101017452 in serialization::read_to_vec17017::_2e1d30b29640e4a2 ()
#83 0x0000000101065dbd in ast::deserialize_decl_18152::anon::anon::anon ()
#84 0x0000000101065d3b in ebml::deserializer::read_enum_variant_arg18166::_4a3d46a55245ba71 ()
#85 0x000000010106573f in ast::deserialize_decl_18152::anon::anon ()
#86 0x0000000101065639 in ebml::deserializer::read_enum_variant18159::anon ()
#87 0x0000000101064e73 in ebml::deserializer::push_doc18157::_835efbcb9f63b233 ()
#88 0x0000000101065515 in ebml::deserializer::read_enum_variant18159::_bf5a8edb7d4da024 ()
#89 0x0000000101064fbc in ast::deserialize_decl_18152::anon ()
#90 0x0000000101064e73 in ebml::deserializer::push_doc18157::_835efbcb9f63b233 ()
#91 0x0000000101064d34 in ebml::deserializer::read_enum18153::_f2351fc0a43c65fe ()
#92 0x0000000101064892 in ast::deserialize_decl_18152::_525ad6538b58fb90 ()
#93 0x00000001010647f6 in ast::deserialize_decl18136::anon ()
#94 0x00000001010646ba in ast::deserialize_spanned18137::anon::anon ()
#95 0x0000000101064642 in ebml::deserializer::read_rec_field18141::_a231ecd57eba5f45 ()
#96 0x0000000101063d4f in ast::deserialize_spanned18137::anon ()
#97 0x0000000101063c67 in ebml::deserializer::read_rec18138::_34d4b3c3898130a5 ()
#98 0x0000000101063ad3 in ast::deserialize_spanned18137::_8115c155e1c3fd7f ()
#99 0x00000001010639e1 in ast::deserialize_decl18136::_117d5afe42b8fdab ()
#100 0x0000000101063966 in ast::deserialize_stmt_18115::anon::anon::anon::anon ()
#101 0x0000000101063907 in ebml::deserializer::read_box18133::_34d4b3c3898130a5 ()
#102 0x00000001010634c0 in ast::deserialize_stmt_18115::anon::anon::anon ()
#103 0x000000010100d71b in ebml::deserializer::read_enum_variant_arg16867::_f57b5617a6bef42d ()
#104 0x0000000101062e75 in ast::deserialize_stmt_18115::anon::anon ()
#105 0x0000000101062d59 in ebml::deserializer::read_enum_variant18122::anon ()
#106 0x0000000101062563 in ebml::deserializer::push_doc18120::_442ad542c2fd9bd0 ()
#107 0x0000000101062c35 in ebml::deserializer::read_enum_variant18122::_3b4d7cd9a9c15358 ()
#108 0x00000001010626dc in ast::deserialize_stmt_18115::anon ()
#109 0x0000000101062563 in ebml::deserializer::push_doc18120::_442ad542c2fd9bd0 ()
#110 0x0000000101062424 in ebml::deserializer::read_enum18116::_2cdf6d8914e42db3 ()
#111 0x0000000101061f82 in ast::deserialize_stmt_18115::_7734cc76a6e785bc ()
#112 0x0000000101061ee6 in ast::deserialize_stmt18099::anon ()
#113 0x0000000101061daa in ast::deserialize_spanned18100::anon::anon ()
#114 0x0000000101061d32 in ebml::deserializer::read_rec_field18104::_353fcc644deb2720 ()
#115 0x000000010106145f in ast::deserialize_spanned18100::anon ()
#116 0x0000000101061377 in ebml::deserializer::read_rec18101::_ce5207836520e132 ()
#117 0x00000001010611e3 in ast::deserialize_spanned18100::_2998f54a45229e05 ()
#118 0x00000001010610f1 in ast::deserialize_stmt18099::_b12d97daf42aba6f ()
#119 0x0000000101061076 in ast::deserialize_blk_17926::anon::anon::anon::anon ()
#120 0x0000000101061017 in ebml::deserializer::read_box18096::_ce5207836520e132 ()
#121 0x0000000101060d90 in ast::deserialize_blk_17926::anon::anon::anon ()
#122 0x00000001010186aa in serialization::read_to_vec17017::anon::anon::anon ()
#123 0x00000001010185a3 in ebml::deserializer::push_doc17031::_298d5ad311a76d51 ()
#124 0x000000010101845e in ebml::deserializer::read_vec_elt17027::_f57b5617a6bef42d ()
#125 0x0000000101018003 in serialization::read_to_vec17017::anon::anon ()
#126 0x0000000101017edb in vec::from_fn17026::_6ae4a4efa7c05b3a ()
#127 0x0000000101017d37 in serialization::read_to_vec17017::anon ()
#128 0x0000000101017c4f in ebml::deserializer::read_vec17018::anon ()
#129 0x0000000101017833 in ebml::deserializer::push_doc17021::_b5baf1ac7429cb1d ()
#130 0x0000000101017680 in ebml::deserializer::read_vec17018::_63ec328989e88294 ()
#131 0x0000000101017452 in serialization::read_to_vec17017::_2e1d30b29640e4a2 ()
#132 0x0000000101060c7d in ast::deserialize_blk_17926::anon::anon ()
#133 0x0000000101060be2 in ebml::deserializer::read_rec_field18088::_fbd9748e9e27369d ()
#134 0x0000000101056111 in ast::deserialize_blk_17926::anon ()
#135 0x0000000101055ee7 in ebml::deserializer::read_rec17927::_dd87c5dc3577a829 ()
#136 0x0000000101055d50 in ast::deserialize_blk_17926::_f946c3674df1704c ()
#137 0x0000000101055cd6 in ast::deserialize_blk17910::anon ()
#138 0x0000000101055b9a in ast::deserialize_spanned17911::anon::anon ()
#139 0x0000000101055b22 in ebml::deserializer::read_rec_field17915::_713feb78151ac5c8 ()
#140 0x000000010105522f in ast::deserialize_spanned17911::anon ()
#141 0x00000001011348b8 in __morestack ()
Previous frame inner to this frame (gdb could not unwind past this frame)

@evanmcc
Copy link
Author

evanmcc commented Apr 3, 2012

@evanmcc
Copy link
Author

evanmcc commented Apr 5, 2012

environment issue with rustc picking the wrong library when trying to compile.

@evanmcc evanmcc closed this as completed Apr 5, 2012
@catamorphism
Copy link
Contributor

(Relates to #2135)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-frontend Area: Compiler frontend (errors, parsing and HIR) I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
Projects
None yet
Development

No branches or pull requests

2 participants