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

arc::exclusive doesn't play nice with failure/unwinding. #3092

Closed
bblum opened this issue Aug 2, 2012 · 0 comments
Closed

arc::exclusive doesn't play nice with failure/unwinding. #3092

bblum opened this issue Aug 2, 2012 · 0 comments
Labels
I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
Milestone

Comments

@bblum
Copy link
Contributor

bblum commented Aug 2, 2012

fn main() {
    do arc::exclusive(1).with |_c, one| {
        assert *one == 2;
    }
}

This segfaults and/or glibc-detected-double-free. Valgrind shows the badness shows up considerably beforehand.

rust: task failed at 'Assertion *one == 2 failed', arc3.rs:3
==13471== Thread 3:
==13471== Invalid read of size 8
==13471==    at 0x5595A1B: rust_atomic_decrement
==13471==    by 0x4E7A275: arc::rustrt::rust_atomic_decrement::_8b5c517b827e1d59::_03
==13471==    by 0x402B38: arc::dtor63::_d8dccf9b65e77125::_00
==13471==  Address 0x6ae2240 is 32 bytes inside a block of size 64 free'd
==13491==    at 0x4C2A82E: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==13471==    by 0x55AE09C: ??? (in librustrt.so)
==13471==    by 0x6AE30CF: ???
==13471==    by 0x55AE09C: ??? (in librustrt.so)

Incidentally, anybody know how to get better when-freed stack traces in valgrind?

@bblum bblum closed this as completed in be2e4ef Aug 9, 2012
@ghost ghost assigned bblum Aug 16, 2012
@bblum bblum removed their assignment Jun 16, 2014
bors pushed a commit to rust-lang-ci/rust that referenced this issue May 15, 2021
RalfJung pushed a commit to RalfJung/rust that referenced this issue Sep 30, 2023
RalfJung pushed a commit to RalfJung/rust that referenced this issue Oct 1, 2023
celinval added a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
In the previous PR rust-lang#3085, we did not support checks for `write_bytes`
which is added in this PR.

I am waiting for rust-lang#3092 to add expected tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

1 participant