Skip to content

Logging glue dumps core on classes w/ destructors and boxes #3207

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
msullivan opened this issue Aug 16, 2012 · 1 comment
Closed

Logging glue dumps core on classes w/ destructors and boxes #3207

msullivan opened this issue Aug 16, 2012 · 1 comment
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.

Comments

@msullivan
Copy link
Contributor

struct thing {
    x: {a: @int};
    new (x: {a: @int}) { self.x = x; }
    drop { }
}

fn main() {
    let x = thing({a: @10});
    log(error, x);
}

will dump core.

@catamorphism
Copy link
Contributor

Dup of #2834

RalfJung pushed a commit to RalfJung/rust that referenced this issue Dec 5, 2023
jaisnan pushed a commit to jaisnan/rust-dev that referenced this issue Jul 29, 2024
This change now separates the front facing "result" name and the
internal facing "result_kani_internal" ident where the user can specify
with the keyword "result" but then the system replaces this with the
internal representation.

If the user chooses to use a different variable name than result, this
now supports the syntax of
`#[kani::ensures(|result_var| expr)]`
where result_var can be any arbitrary name.

For example, the following test now works:
```
#[kani::ensures(|banana : &u32| *banana == a.wrapping_add(b))]
fn simple_addition(a: u32, b: u32) -> u32 {
    return a.wrapping_add(b);
}
```

In addition, the string "result_kani_internal" is now a global constant
and can be updated in a single place if needed.

Resolves rust-lang#2597 since the user can specify the variable name they want
within the ensures binding

An important change is that the result is now a pass by reference
instead, so as in the example an `&u32` instead of `u32`

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 and MIT licenses.

---------

Co-authored-by: Matias Scharager <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows 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

2 participants