Skip to content

ICE and memory leak with recursive impls across libraries #2258

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
erickt opened this issue Apr 20, 2012 · 2 comments
Closed

ICE and memory leak with recursive impls across libraries #2258

erickt opened this issue Apr 20, 2012 · 2 comments
Labels
A-frontend Area: Compiler frontend (errors, parsing and HIR) A-linkage Area: linking into static, shared libraries and binaries I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
Milestone

Comments

@erickt
Copy link
Contributor

erickt commented Apr 20, 2012

Here's an example of the reduced bug: https://gist.github.com/2426493. When a.rs is compiled as a library then linked into b.rs, I get the following error:

./run-rustc a.rs
warning: no debug symbols in executable (-arch x86_64)
./run-rustc b.rs
rust: upcall fail 'Assertion start <= end failed', ../src/rustc/rustc.rc:1
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:190
rust: domain main @0x102829810 root task failed
leaked memory in rust main loop (1 objects)
Assertion failed: (false), function ~memory_region, file ../src/rt/memory_region.cpp, line 172.
make: *** [all] Abort trap

I don't get this error if both of these files are merged, so I'm guessing it has something to do with the crate metadata.

@ghost ghost assigned marijnh Apr 20, 2012
@erickt
Copy link
Contributor Author

erickt commented Apr 20, 2012

tlc helped me get this stack trace:

#0  upcall_fail (expr=0x100db6ba0 "Assertion start <= end failed", file=0x100db6bc0 "../src/rustc/rustc.rc", line=1) at ../src/rt/rust_upcall.cpp:129
#1  0x0000000100ae311d in _ZN3vec9slice464917_f62b7591e0e2c89d202E ()
#2  0x0000000100aef53a in _ZN6middle5trans4impl26trans_monomorphized_callee17_80959984524c12f1202E ()
#3  0x0000000100a83756 in _ZN6middle5trans4impl19trans_method_callee17_3476b385824cc24d202E ()
#4  0x0000000100aa5e64 in _ZN6middle5trans4base12trans_callee17_3f4d9dc293cbbdc5202E ()
#5  0x0000000100ab0c63 in middle::trans::base::trans_call_inner::anon ()
#6  0x0000000100ab0ac7 in _ZN6middle5trans4base10with_scope17_cf15ce783fd372bb202E ()
#7  0x0000000100a834f1 in _ZN6middle5trans4base16trans_call_inner17_7ad821cc9cd55abb202E ()
#8  0x0000000100aad732 in _ZN6middle5trans4base10trans_call17_4a98d151c8dbbca3202E ()
#9  0x0000000100a83ca3 in _ZN6middle5trans4base10trans_expr17_a862fdc15db97d54202E ()
#10 0x0000000100a868a0 in _ZN6middle5trans4base18trans_expr_save_in17_b2e2d38c6cdcd25e202E ()
#11 0x0000000100a87169 in _ZN6middle5trans4base15trans_temp_lval17_76a38ac4f9ff42a5202E ()
#12 0x0000000100aa99f8 in _ZN6middle5trans4base14trans_arg_expr17_a99758df94e6b2c2202E ()
#13 0x0000000100d5635b in __morestack ()

@marijnh
Copy link
Contributor

marijnh commented Apr 23, 2012

This was the same bug as #2185

@marijnh marijnh closed this as completed Apr 23, 2012
bors added a commit to rust-lang-ci/rust that referenced this issue Sep 22, 2022
jieyouxu pushed a commit to jieyouxu/rust that referenced this issue Mar 11, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-frontend Area: Compiler frontend (errors, parsing and HIR) A-linkage Area: linking into static, shared libraries and binaries 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