Skip to content

rusti always leaks memory and crashes #6378

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

Closed
cantsin opened this issue May 10, 2013 · 1 comment
Closed

rusti always leaks memory and crashes #6378

cantsin opened this issue May 10, 2013 · 1 comment

Comments

@cantsin
Copy link
Contributor

cantsin commented May 10, 2013

rusti on latest incoming (c081ffb) and master (f547a67) seems to always crash. Even simple expressions fail:

WARNING: The Rust REPL is experimental and may be
unstable. If you encounter problems, please use the
compiler instead.
rusti> 5
rust: ~"blocked = 0 this = 15e82c0"
rust: ~"blocked = 15e82c0 this = 15e82c0 old_task = 0"
rust: ~"no data available on &mut {header: {state: Blocked, blocked_task: (0x15e82c0 as *()), buffer: (0x7fb3f4204090 as *())}, payload: None}, going to sleep."
rust: ~"\"building driver input\""
rust: ~"inputting // Copyright 2012 The Rust Project Developers. See the COPYRIGHT\n// file at the top-level directory of this distribution and at\n// http://rust-lang.org/COPYRIGHT.\n//\n// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or\n// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license\n// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your\n// option. This file may not be copied, modified, or distributed\n// except according to those terms.\n\n#[allow(ctypes)];\n#[allow(heap_memory)];\n#[allow(implicit_copies)];\n#[allow(managed_heap_memory)];\n#[allow(non_camel_case_types)];\n#[allow(non_implicitly_copyable_typarams)];\n#[allow(owned_heap_memory)];\n#[allow(path_statement)];\n#[allow(unrecognized_lint)];\n#[allow(unused_imports)];\n#[allow(vecs_implicitly_copyable)];\n#[allow(while_true)];\n\nextern mod std;\n\nfn print<T>(result: T) {\n    io::println(fmt!(\"%?\", result));\n}\n\nfn main() {\n\n\nprint({\n5\n})\n}"
rust: ~"\"building a driver session\""
rust: ~"\"building driver configuration\""
rust: ~"\"calling compile_upto\""
5
rust: ~"\"recording input into repl history\""
rust: ~"woke up, p.state = Full"
rusti> leaked memory in rust main loop (1 objects)
memory_region::~memory_region(): Assertion `false' failed.```
@cantsin
Copy link
Contributor Author

cantsin commented May 10, 2013

I tried to get at the precise problem, but I am not familiar with rust internals. My guess: it looks like the section that does "LLVM passes" in compile_rest (librustc/driver/driver.rs) is doing something wonky.

bors added a commit that referenced this issue May 11, 2013
Fixes #6378

Don't pass the binary name to the LLVMRustExecuteJIT closure, otherwise it will leak memory; the binary name doesn't seem to be needed, anyhow.
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

No branches or pull requests

2 participants