Closed
Description
On linux pthread_rwlock_rdlock/wrlock return EDEADLK if you attempt to take the other type of lock when you own one. libstd ignores this when debug-assertions are not on, and then will try to unlock twice anyway. This leads to arbitrarily bad behavior (on playpen it happens to hit x86-HLE code and SIGILL):
use std::sync::RwLock;
fn main() {
let x = RwLock::new("");
let _w = x.write().unwrap();
let _r = x.read().unwrap();
}
Metadata
Metadata
Assignees
Labels
No labels