From: "kosaki (Motohiro KOSAKI)" Date: 2013-02-23T10:40:57+09:00 Subject: [ruby-core:52725] [ruby-trunk - Bug #7917] Can't write to a Logger in a signal handler Issue #7917 has been updated by kosaki (Motohiro KOSAKI). Because your example is deadlockable when using 1.9.3 or earlier. 2.0 detect your mistake and tell you. ---------------------------------------- Bug #7917: Can't write to a Logger in a signal handler https://bugs.ruby-lang.org/issues/7917#change-36813 Author: mperham (Mike Perham) Status: Open Priority: Normal Assignee: Category: Target version: ruby -v: 2.0.0-rc2 Looks like Ruby 2.0 does not allow Mutex#lock within a signal handler. This prevents Logger from working since it uses an underlying mutex. log writing failed. can't be called from trap context log writing failed. can't be called from trap context log writing failed. can't be called from trap context log writing failed. can't be called from trap context Here's Ruby code which reproduces the problem: require 'logger' LOG = Logger.new(STDOUT) LOG.info "Now logging!" trap 'INT' do LOG.info "Hello" end sleep LOG.info "Done" Run it and hit Ctrl-C. -- http://bugs.ruby-lang.org/