Project

General

Profile

Bug #9302

[PATCH] thread: fix deadlock/freeze on SizedQueue#push

Added by normalperson (Eric Wong) over 4 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Target version:
ruby -v:
ruby 2.2.0dev (2013-12-26 trunk 44439) [x86_64-linux]
[ruby-core:59324]

Description

SizedQueue#push needs to check the thread list for threads
waiting on enqueue. Checking the wrong thread list leads
strange/surprising behavior when the the queue is full.

This needs to be backported to 2.1.0 (not 2.0.0 or earlier)

Associated revisions

Revision 64926db9
Added by charliesome (Charlie Somerville) over 4 years ago

  • ext/thread/thread.c (rb_szqueue_push): check GET_SZQUEUE_WAITERS
    instead of GET_QUEUE_WAITERS to prevent deadlock. Patch by Eric Wong.
    [Bug #9302]

  • test/thread/test_queue.rb: add test

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 44583
Added by charliesome (Charlie Somerville) over 4 years ago

  • ext/thread/thread.c (rb_szqueue_push): check GET_SZQUEUE_WAITERS
    instead of GET_QUEUE_WAITERS to prevent deadlock. Patch by Eric Wong.
    [Bug #9302]

  • test/thread/test_queue.rb: add test

Revision 44583
Added by charliesome (Charlie Somerville) over 4 years ago

  • ext/thread/thread.c (rb_szqueue_push): check GET_SZQUEUE_WAITERS
    instead of GET_QUEUE_WAITERS to prevent deadlock. Patch by Eric Wong.
    [Bug #9302]

  • test/thread/test_queue.rb: add test

Revision 44583
Added by charliesome (Charlie Somerville) over 4 years ago

  • ext/thread/thread.c (rb_szqueue_push): check GET_SZQUEUE_WAITERS
    instead of GET_QUEUE_WAITERS to prevent deadlock. Patch by Eric Wong.
    [Bug #9302]

  • test/thread/test_queue.rb: add test

Revision 44583
Added by charliesome (Charlie Somerville) over 4 years ago

  • ext/thread/thread.c (rb_szqueue_push): check GET_SZQUEUE_WAITERS
    instead of GET_QUEUE_WAITERS to prevent deadlock. Patch by Eric Wong.
    [Bug #9302]

  • test/thread/test_queue.rb: add test

Revision 44583
Added by charliesome (Charlie Somerville) over 4 years ago

  • ext/thread/thread.c (rb_szqueue_push): check GET_SZQUEUE_WAITERS
    instead of GET_QUEUE_WAITERS to prevent deadlock. Patch by Eric Wong.
    [Bug #9302]

  • test/thread/test_queue.rb: add test

Revision eef4a3cd
Added by naruse (Yui NARUSE) about 4 years ago

merge revision(s) 44583: [Backport #9302]

* ext/thread/thread.c (rb_szqueue_push): check GET_SZQUEUE_WAITERS
  instead of GET_QUEUE_WAITERS to prevent deadlock. Patch by Eric Wong.
  [Bug #9302] 

* test/thread/test_queue.rb: add test

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@44847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

History

#1 Updated by charliesome (Charlie Somerville) over 4 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

Applied in changeset r44583.


  • ext/thread/thread.c (rb_szqueue_push): check GET_SZQUEUE_WAITERS
    instead of GET_QUEUE_WAITERS to prevent deadlock. Patch by Eric Wong.
    [Bug #9302]

  • test/thread/test_queue.rb: add test

#2 Updated by charliesome (Charlie Somerville) over 4 years ago

  • Status changed from Closed to Open
  • Assignee set to naruse (Yui NARUSE)
  • % Done changed from 100 to 0
  • Backport changed from 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN to 1.9.3: DONTNEED, 2.0.0: DONTNEED, 2.1: REQUIRED

#3 [ruby-core:60539] Updated by naruse (Yui NARUSE) about 4 years ago

  • Backport changed from 1.9.3: DONTNEED, 2.0.0: DONTNEED, 2.1: REQUIRED to 1.9.3: DONTNEED, 2.0.0: DONTNEED, 2.1: DONE

#4 [ruby-core:64322] Updated by hsbt (Hiroshi SHIBATA) over 3 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF