Skip to content

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

@erickt

Description

@erickt

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

Metadata

Metadata

Assignees

Labels

I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions