Skip to content

failure in closure causing a pointer being freed was not allocated #2156

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
erickt opened this issue Apr 8, 2012 · 2 comments
Closed

failure in closure causing a pointer being freed was not allocated #2156

erickt opened this issue Apr 8, 2012 · 2 comments
Assignees
Labels
I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.

Comments

@erickt
Copy link
Contributor

erickt commented Apr 8, 2012

Hi all,

I tracked down a malloc error with this code:

use std;
import io::{reader, reader_util};

fn main() {
    io::with_str_reader("") { |rdr|
        alt rdr.read_char() { '=' { } _ { fail } }
    }
}

Errors out with:

warning: no debug symbols in executable (-arch x86_64)
rust: upcall fail 'explicit failure', test2.rs:6
test2(64191,0x10061a000) malloc: *** error for object 0x100500040: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
[1]    64191 abort      ./test2
@rwaldron
Copy link
Contributor

rwaldron commented Apr 9, 2012

cc @rwldrn

@ghost ghost assigned brson Apr 10, 2012
@brson brson closed this as completed in 10236f8 Apr 10, 2012
@brson
Copy link
Contributor

brson commented Apr 10, 2012

Unsafe code in str::as_bytes was not coping with failure.

bors pushed a commit to rust-lang-ci/rust that referenced this issue Sep 22, 2022
bors added a commit to rust-lang-ci/rust that referenced this issue Sep 22, 2022
Avoid error patterns matching themselves

fixes rust-lang#2156
fixes rust-lang/miri#2155

this will be obsolete the moment I extract that data from json diagnostics instead of just regexing the stderr.
Kobzol pushed a commit to Kobzol/rust that referenced this issue Dec 29, 2024
Kobzol pushed a commit to Kobzol/rust that referenced this issue Dec 30, 2024
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

3 participants