Project

General

Profile

Actions

Bug #22096

closed

Freeing a mutex locked by a fiber inside fiber scheduler can crash

Bug #22096: Freeing a mutex locked by a fiber inside fiber scheduler can crash

Added by luke-gru (Luke Gruber) 7 days ago. Updated 3 days ago.

Status:
Closed
Target version:
[ruby-core:125644]

Description

While freeing a locked mutex, if there is a waiter for the mutex it could call rb_fiber_scheduler_unblock which calls into Ruby code.

The function rb_mutex_unlock_th was a footgun because it was used during normal Ruby code and also during GC. The fix is to not call this function during GC and simply remove the mutex from th->keeping_mutexes.

PR

Backport PR

Actions

Also available in: PDF Atom