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

Leaks when failures occur during unwinding #1482

Closed
nikomatsakis opened this issue Jan 10, 2012 · 6 comments
Closed

Leaks when failures occur during unwinding #1482

nikomatsakis opened this issue Jan 10, 2012 · 6 comments
Labels
A-codegen Area: Code generation

Comments

@nikomatsakis
Copy link
Contributor

If a failure occurs during unwinding or executing a resource, we potentially leak. This is blocking #1078 (which also includes a reference to a testcase).

@catamorphism
Copy link
Contributor

@bblum - is this still an issue after your work on failure?

@bblum
Copy link
Contributor

bblum commented Jul 27, 2012

To be honest, I'm not sure. I closed #1078 with some pretty easy code reorganisation, and the referred test case magically seems to work fine.

@catamorphism
Copy link
Contributor

Then I'm going to close this. If it becomes an issue again, it should be pretty obvious.

@bblum
Copy link
Contributor

bblum commented Jul 27, 2012

Won't complain, but I'm worried we just might not have a test case. @nikomatsakis can you input?

@catamorphism
Copy link
Contributor

Well, I'm of the philosophy that "if there's no test case, there's no bug" :-)

@nikomatsakis
Copy link
Contributor Author

I am not sure what I meant about that testcase from #1078, it doesn't seem to fail during unwinding. Well, I recall that it could fail sometimes when invoking send() from within the dtor, in which case leaks would occur. Do we have a test with a class with a dtor that just fails when executed? Something like:

class Failer { let x: @int; new(x: @int) { self.x = x; } drop { fail; } }
fn main() {
     let f = Failer(@10);
     fail;
} 

Something like that would seem to be the test for this bug. For me at least, this test passes right now.

Kobzol pushed a commit to Kobzol/rust that referenced this issue Dec 30, 2024
* Add sample CodeLLDB launch.json

There is a section with [instructions for setting up source analyzer in VSCode](https://rustc-dev-guide.rust-lang.org/building/suggested.html#configuring-rust-analyzer-for-rustc), but
nothing for setting up debugging with CodeLLDB.  This adds a sample configuration
that may not be ideal, but appears to work for me.

To source highlight the snippet, uses JavaScript instead of JSON so that comments
do not show up as errors highlighted in red (VSCode allows comments).

* Update src/compiler-debugging.md

Co-authored-by: jyn <github@jyn.dev>

* Update src/compiler-debugging.md

Co-authored-by: jyn <github@jyn.dev>

---------

Co-authored-by: Santiago Pastorino <spastorino@gmail.com>
Co-authored-by: jyn <github@jyn.dev>
bors pushed a commit to rust-lang-ci/rust that referenced this issue Jan 2, 2025
* Add sample CodeLLDB launch.json

There is a section with [instructions for setting up source analyzer in VSCode](https://rustc-dev-guide.rust-lang.org/building/suggested.html#configuring-rust-analyzer-for-rustc), but
nothing for setting up debugging with CodeLLDB.  This adds a sample configuration
that may not be ideal, but appears to work for me.

To source highlight the snippet, uses JavaScript instead of JSON so that comments
do not show up as errors highlighted in red (VSCode allows comments).

* Update src/compiler-debugging.md

Co-authored-by: jyn <github@jyn.dev>

* Update src/compiler-debugging.md

Co-authored-by: jyn <github@jyn.dev>

---------

Co-authored-by: Santiago Pastorino <spastorino@gmail.com>
Co-authored-by: jyn <github@jyn.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation
Projects
None yet
Development

No branches or pull requests

3 participants