Project

General

Profile

Actions

Bug #15992

closed

An exception breaks monitor state and cause deadlock

Added by naruse (Yui NARUSE) almost 5 years ago. Updated over 4 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
[ruby-core:93652]

Description

lib/monitor.rb provides Monitor.
But its state handling is weak for interrupts caused by Thread.kill for example timeout libraries.

Timeout exception may happen everywhere. If it raised when the thread is executing

  def mon_exit
    mon_check_owner
    @mon_count -=1
    if @mon_count == 0
      @mon_owner = nil
      # HERE!!!
      @mon_mutex.unlock
    end
  end

It breaks the state of the monitor and it causes deadlock.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0