Skip to content

Strange deadlock bug on Rust nightly #36294

Closed
@bvssvni

Description

@bvssvni

rustc 1.13.0-nightly (91f057de3 2016-09-04)

This runs forever on Rust stable (1.11) but hangs on Rust nightly.

Reduced case:

use std::sync::{Arc, Mutex};
use std::any::Any;

fn main() {
    let mut counter = 0;
    loop {
        let _ = foo();
        counter += 1;
        println!("counter {}", counter); // stops at ~ 495 - 499
    }
}

fn foo() -> Arc<Mutex<Any>> {
    Arc::new(Mutex::new(false)) as Arc<Mutex<Any>>
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-concurrencyArea: ConcurrencyT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions