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

ICE when panicking in stack's main frame #1389

Closed
RalfJung opened this issue May 3, 2020 · 0 comments · Fixed by rust-lang/rust#74984
Closed

ICE when panicking in stack's main frame #1389

RalfJung opened this issue May 3, 2020 · 0 comments · Fixed by rust-lang/rust#74984
Labels
A-concurrency Area: affects our concurrency (multi-thread) support C-bug Category: This is a bug. I-ICE Impact: makes Miri crash with some ICE

Comments

@RalfJung
Copy link
Member

RalfJung commented May 3, 2020

The following test ICEs, but should report UB instead:

// ignore-windows: Concurrency on Windows is not supported yet.

// Unwinding past the top frame of a stack is Undefined Behavior.

#![feature(rustc_private)]

extern crate libc;

use std::{mem, ptr};

extern "C" fn thread_start(_null: *mut libc::c_void) -> *mut libc::c_void {
    panic!()
}

fn main() {
    unsafe {
        let mut native: libc::pthread_t = mem::zeroed();
        let attr: libc::pthread_attr_t = mem::zeroed();
        // assert_eq!(libc::pthread_attr_init(&mut attr), 0); FIXME: this function is not yet implemented.
        assert_eq!(libc::pthread_create(&mut native, &attr, thread_start, ptr::null_mut()), 0);
        assert_eq!(libc::pthread_join(native, ptr::null_mut()), 0);
    }
}

Cc @vakaras

@RalfJung RalfJung added C-bug Category: This is a bug. A-concurrency Area: affects our concurrency (multi-thread) support I-ICE Impact: makes Miri crash with some ICE labels May 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-concurrency Area: affects our concurrency (multi-thread) support C-bug Category: This is a bug. I-ICE Impact: makes Miri crash with some ICE
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant