Skip to content

double free on unwind #945

Description

@jruderman
// error-pattern:non-exhaustive match failure
fn test_box() { @100; }
fn test_str() {
    let res = alt false { true { "happy" } };
    assert res == "happy";
}
fn main() { test_box(); test_str(); }

About 80% of the time:

Assertion failed: (alloc->magic == MAGIC), function free, file ../src/rt/memory_region.cpp, line 41.

or

malloc: ... pointer being freed was not allocated

Activity

  1. brson commented on Sep 20, 2011

    @brson
    Contributor

    This is bizarre that the call to test_box matters here.

  2. ghost assigned on Sep 20, 2011
  3. added a commit that references this issue on Mar 7, 2023
  4. added 2 commits that reference this issue on Aug 21, 2026
    97a87bf
    d0a1050
  5. added a commit that references this issue on Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions