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 while generating debug symbols for default trait method #7712

Closed
chris-morgan opened this Issue Jul 11, 2013 · 1 comment

Comments

Projects
None yet
2 participants
@chris-morgan
Member

chris-morgan commented Jul 11, 2013

Here is a minimal test case where compilation fails with rustc -Z debug-info:

#[allow(default_methods)];

pub trait TraitWithDefaultMethod {
    pub fn method(self) {
        ()
    }
}

struct MyStruct;

impl TraitWithDefaultMethod for MyStruct { }

fn main() {
    MyStruct.method();
}

(To the best of my knowledge, nothing can be removed from this example without the ICE melting, including that method cannot be empty, hence the ().)

I believe this to be what is causing #7603.

$ RUST_LOG=::rt::backtrace rustc -Z debug-info debug-info.rs
error: internal compiler error: create_function: unexpected sort of node
rust: task failed at 'explicit failure', /home/chris/vc/rust/src/libsyntax/diagnostic.rs:95
/home/chris/opt/rust/bin/../lib/librustrt.so(_ZN9rust_task13begin_failureEPKcS1_m+0x4b)[0x7f20cc97319b]
/home/chris/opt/rust/bin/../lib/librustrt.so(+0x2b899)[0x7f20cc984899]
/home/chris/opt/rust/bin/../lib/librustrt.so(upcall_fail+0x1a8)[0x7f20cc9751e8]
/home/chris/opt/rust/bin/../lib/libstd-6c65cf4b443341b1-0.8-pre.so(_ZN3sys13begin_unwind_16_89e154cd091567114_0$x2e8$x2dpreE+0x3ce)[0x7f20ce49291e]
/home/chris/opt/rust/bin/../lib/libstd-6c65cf4b443341b1-0.8-pre.so(+0x10ba22)[0x7f20ce492a22]
/home/chris/opt/rust/bin/../lib/libstd-6c65cf4b443341b1-0.8-pre.so(+0x10b471)[0x7f20ce492471]
/home/chris/opt/rust/bin/../lib/libstd-6c65cf4b443341b1-0.8-pre.so(+0x10b9dc)[0x7f20ce4929dc]
/home/chris/opt/rust/bin/../lib/libstd-6c65cf4b443341b1-0.8-pre.so(+0x10b471)[0x7f20ce492471]
/home/chris/opt/rust/bin/../lib/libstd-6c65cf4b443341b1-0.8-pre.so(+0x81c24)[0x7f20ce408c24]
/home/chris/opt/rust/bin/../lib/libsyntax-64629f7f0c6a9bc-0.8-pre.so(_ZN10diagnostic14__extensions__10meth_100605fatal17_e0de3d9f29108f6414_0$x2e8$x2dpreE+0x104)[0x7f20cd9289b4]
/home/chris/opt/rust/bin/../lib/libsyntax-64629f7f0c6a9bc-0.8-pre.so(_ZN10diagnostic14__extensions__10meth_101113bug17_e0de3d9f29108f6414_0$x2e8$x2dpreE+0xbc)[0x7f20cd92939c]
/home/chris/opt/rust/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so(_ZN6driver7session14__extensions__10meth_225843bug16_e3e78dc632d928214_0$x2e8$x2dpreE+0x7e)[0x7f20cccd85ee]
/home/chris/opt/rust/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so(_ZN6middle5trans9debuginfo15create_function17_fd8a269c7ed18de514_0$x2e8$x2dpreE+0x3d3)[0x7f20cce22443]
/home/chris/opt/rust/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so(_ZN6middle5trans9debuginfo12create_block16_32d3b40cf56155214_0$x2e8$x2dpreE+0x5b9)[0x7f20cce87949]
/home/chris/opt/rust/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so(_ZN6middle5trans9debuginfo17update_source_pos17_bf3a8dc7724bb7e414_0$x2e8$x2dpreE+0x4f7)[0x7f20ccd1a3c7]
/home/chris/opt/rust/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so(_ZN6middle5trans11controlflow11trans_block17_ee7f10de21ab6c9114_0$x2e8$x2dpreE+0x1e3)[0x7f20ccd19133]
/home/chris/opt/rust/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so(_ZN6middle5trans4base13trans_closure15_eb8c317d92aa4114_0$x2e8$x2dpreE+0x6f7)[0x7f20cce21597]
/home/chris/opt/rust/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so(_ZN6middle5trans4base8trans_fn16_e7ca69dba5ead9314_0$x2e8$x2dpreE+0x46c)[0x7f20cccde86c]
/home/chris/opt/rust/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so(_ZN6middle5trans4meth12trans_method15_4b2179042862d714_0$x2e8$x2dpreE+0x23a)[0x7f20ccd12aca]
/home/chris/opt/rust/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so(_ZN6middle5trans12monomorphize14monomorphic_fn17_6e46edc17bf7cc1d14_0$x2e8$x2dpreE+0x2853)[0x7f20ccce1633]
/home/chris/opt/rust/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so(_ZN6middle5trans6callee25trans_fn_ref_with_vtables17_966bf88471d939ae14_0$x2e8$x2dpreE+0x1c1b)[0x7f20ccd5cf5b]
/home/chris/opt/rust/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so(_ZN6middle5trans6callee12trans_fn_ref15_6201f3a45fe54c14_0$x2e8$x2dpreE+0x63e)[0x7f20ccd56dfe]
/home/chris/opt/rust/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so(_ZN6middle5trans4meth19trans_method_callee16_8c271f56084e55e14_0$x2e8$x2dpreE+0xa4f)[0x7f20ccd6569f]
/home/chris/opt/rust/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so(+0x1ba0f5)[0x7f20ccd640f5]
/home/chris/opt/rust/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so(+0x1cf877)[0x7f20ccd79877]
/home/chris/opt/rust/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so(_ZN6middle5trans4base17with_scope_result17_b34fe6984565501914_0$x2e8$x2dpreE+0x19b)[0x7f20ccd262db]
/home/chris/opt/rust/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so(_ZN6middle5trans6callee16trans_call_inner17_4e2d672a1713c67c14_0$x2e8$x2dpreE+0x100)[0x7f20ccd62bf0]
/home/chris/opt/rust/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so(_ZN6middle5trans6callee17trans_method_call16_244e1becaccf29b14_0$x2e8$x2dpreE+0x6bb)[0x7f20ccd633bb]
/home/chris/opt/rust/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so(_ZN6middle5trans4expr27trans_rvalue_dps_unadjusted17_a9cdd97d7831daaa14_0$x2e8$x2dpreE+0x6cd)[0x7f20ccd8983d]
/home/chris/opt/rust/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so(_ZN6middle5trans4expr10trans_into17_a9cdd97d7831daaa14_0$x2e8$x2dpreE+0xad0)[0x7f20ccd1be50]
/home/chris/opt/rust/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so(_ZN6middle5trans4base10trans_stmt17_a1207e2fc3dfb78f14_0$x2e8$x2dpreE+0x517)[0x7f20ccd1abd7]
/home/chris/opt/rust/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so(_ZN6middle5trans11controlflow11trans_block17_ee7f10de21ab6c9114_0$x2e8$x2dpreE+0x110)[0x7f20ccd19060]
/home/chris/opt/rust/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so(_ZN6middle5trans4base13trans_closure15_eb8c317d92aa4114_0$x2e8$x2dpreE+0x6f7)[0x7f20cce21597]
/home/chris/opt/rust/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so(_ZN6middle5trans4base8trans_fn16_e7ca69dba5ead9314_0$x2e8$x2dpreE+0x46c)[0x7f20cccde86c]
/home/chris/opt/rust/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so(_ZN6middle5trans4base10trans_item16_b0be10e6c143dbd14_0$x2e8$x2dpreE+0xc7b)[0x7f20cccd785b]
/home/chris/opt/rust/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so(_ZN6middle5trans4base9trans_mod17_9439df66548551c914_0$x2e8$x2dpreE+0x8d)[0x7f20cce26dcd]
/home/chris/opt/rust/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so(_ZN6middle5trans4base11trans_crate17_52eafc89c87e94d314_0$x2e8$x2dpreE+0x46e)[0x7f20cce3638e]
/home/chris/opt/rust/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so(+0x8187ac)[0x7f20cd3c27ac]
/home/chris/opt/rust/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so(_ZN6driver6driver12compile_rest17_c3b419a0238ad86d14_0$x2e8$x2dpreE+0x2832)[0x7f20cd3c0042]
/home/chris/opt/rust/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so(+0x84bf34)[0x7f20cd3f5f34]
/home/chris/opt/rust/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so(_ZN6driver6driver12compile_upto17_2aa9cc5bfaa1e08e14_0$x2e8$x2dpreE+0x13c)[0x7f20cd3c2adc]
/home/chris/opt/rust/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so(_ZN6driver6driver13compile_input15_7651cceb76d69d14_0$x2e8$x2dpreE+0xd5)[0x7f20cd3c2e75]
/home/chris/opt/rust/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so(_ZN12run_compiler16_5ecbadc50d5136214_0$x2e8$x2dpreE+0x192a)[0x7f20cd3e2c6a]
/home/chris/opt/rust/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so(+0x84bc5e)[0x7f20cd3f5c5e]
/home/chris/opt/rust/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so(+0x849707)[0x7f20cd3f3707]
/home/chris/opt/rust/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so(+0x8402fb)[0x7f20cd3ea2fb]
/home/chris/opt/rust/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so(+0x84bf34)[0x7f20cd3f5f34]
/home/chris/opt/rust/bin/../lib/libstd-6c65cf4b443341b1-0.8-pre.so(+0xdaa49)[0x7f20ce461a49]
/home/chris/opt/rust/bin/../lib/libstd-6c65cf4b443341b1-0.8-pre.so(+0x1599fc)[0x7f20ce4e09fc]
/home/chris/opt/rust/bin/../lib/librustrt.so(_Z18task_start_wrapperP10spawn_args+0x2b)[0x7f20cc973b2b]
rust: task failed at 'explicit failure', /home/chris/vc/rust/src/librustc/rustc.rs:355
/home/chris/opt/rust/bin/../lib/librustrt.so(_ZN9rust_task13begin_failureEPKcS1_m+0x4b)[0x7f20cc97319b]
/home/chris/opt/rust/bin/../lib/librustrt.so(+0x2b899)[0x7f20cc984899]
/home/chris/opt/rust/bin/../lib/librustrt.so(upcall_fail+0x1a8)[0x7f20cc9751e8]
/home/chris/opt/rust/bin/../lib/libstd-6c65cf4b443341b1-0.8-pre.so(_ZN3sys13begin_unwind_16_89e154cd091567114_0$x2e8$x2dpreE+0x3ce)[0x7f20ce49291e]
/home/chris/opt/rust/bin/../lib/libstd-6c65cf4b443341b1-0.8-pre.so(+0x10ba22)[0x7f20ce492a22]
/home/chris/opt/rust/bin/../lib/libstd-6c65cf4b443341b1-0.8-pre.so(+0x10b471)[0x7f20ce492471]
/home/chris/opt/rust/bin/../lib/libstd-6c65cf4b443341b1-0.8-pre.so(+0x10b9dc)[0x7f20ce4929dc]
/home/chris/opt/rust/bin/../lib/libstd-6c65cf4b443341b1-0.8-pre.so(+0x10b471)[0x7f20ce492471]
/home/chris/opt/rust/bin/../lib/libstd-6c65cf4b443341b1-0.8-pre.so(+0x81c24)[0x7f20ce408c24]
/home/chris/opt/rust/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so(_ZN7monitor16_a04770b32d08dc114_0$x2e8$x2dpreE+0x29b5)[0x7f20cd3e61a5]
/home/chris/opt/rust/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so(+0x84bf34)[0x7f20cd3f5f34]
/home/chris/opt/rust/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so(_ZN4main15_f3d16eaf7d573814_0$x2e8$x2dpreE+0x69)[0x7f20cd3f5b89]
/home/chris/opt/rust/bin/../lib/librustrt.so(_Z18task_start_wrapperP10spawn_args+0x2b)[0x7f20cc973b2b]
rust: domain main @0x181ad90 root task failed
leaked memory in rust main loop (1 objects)
rustc: /home/chris/vc/rust/src/rt/memory_region.cpp:192: memory_region::~memory_region(): Assertion `false' failed.
[1]    29254 abort (core dumped)  RUST_LOG=::rt::backtrace rustc -Z debug-info debug-info.rs
@michaelwoerister

This comment has been minimized.

Contributor

michaelwoerister commented Jul 11, 2013

I may have a fix for this issue here: michaelwoerister@21920ac

At least the above example does not crash any more. I'll take another look at it tomorrow and clean it up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment