From: nagachika00@... Date: 2015-05-22T19:55:39+00:00 Subject: [ruby-core:69321] [Ruby trunk - Bug #11166] thread becames broken after unsuccessful system() or Process.spawn() call Issue #11166 has been updated by Tomoyuki Chikanaga. Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: REQUIRED ---------------------------------------- Bug #11166: thread becames broken after unsuccessful system() or Process.spawn() call https://bugs.ruby-lang.org/issues/11166#change-52589 * Author: Cyril Vechera * Status: Closed * Priority: Normal * Assignee: * ruby -v: 2.2.0 * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: REQUIRED ---------------------------------------- After calling system() or Process.spawn() with non-existing command the thread works incorrectly: * doesn't response to thread kill * hangs forever in condition wait or mutexes The least leads to hanging in file write() or puts() calls due wrong mutex handling or to "No live threads left. Deadlock? (fatal)" The minimal reproducible script which shows if the thread becames unkillable: ~~~ require 'thread' 1000000.times do |i| puts "loop: #{i}" t = Thread.new { system('/nonexistent') puts "done" sleep } sleep 0.000001 t.kill t.join # hang up forever on join if thread can't respond to kill end ~~~ ---Files-------------------------------- 2.rb (223 Bytes) -- https://bugs.ruby-lang.org/