With :git dependencies in Gemfile, calling Bundler.setup causes script to become unresponsive to signals on Ruby 1.9.2-p180 #1200

Closed
nathansobo opened this Issue May 24, 2011 · 10 comments

Comments

Projects
None yet
4 participants

We're using the following Gemfile:

source 'http://rubygems.org'

#gem 'erector', :path => 'vendor/erector'
gem 'erector', :git => 'https://github.com/bigfix/erector.git', :tag => 'rails3'

with the following simple ruby script:

#!/usr/bin/env ruby
require 'rubygems'
require 'bundler'
Bundler.setup

while true do
  sleep 1
end

on Ubuntu 11.04

When we run the script with ruby on the command line, we are unable to ctrl-c it. When we ctrl-z and then fg the script, the signal is finally handled upon re-foregrounding and the process exits. It's as if the signal is stuck or something, and re-foregrounding the process lets it go. We have also experimented with other signal traps, and none work. This bug is manifesting itself as an inability to terminate a resque-scheduler process (rake resque:scheduler) with a QUIT signal.

If we don't run Bundler.setup, all signals are processed as normal. And if we comment out the git dependency and use the file system path instead, it also works. All combinations work in Ruby 1.8.7 and on Mac OS X – it's only Ubuntu (both 10.04 and 11.04) Ruby 1.9.2-p180, and git dependencies that produce the unresponsiveness.

We've also noticed that we can't ctrl-c bundle install processes when there is a git dependency involved, which may be related.

Thanks!

I can confirm seeing this exact behavior on Ubuntu 11.04 with ruby 1.9.2.-p180.

Owner

indirect commented May 31, 2011

I don't use Ubuntu myself, so I can't really comment as far as that goes. That said, I'm not going to be able to help you guys regardless, because Bundler is just ruby code, and doesn't do any signal handling or processing. If interrupts work everywhere except Ubuntu 11.04 with ruby 1.9.2-p180, it sounds like you have found a bug either in Ubuntu, or in Ubuntu's Ruby package.

indirect closed this May 31, 2011

I think it's actually a bug in the ruby interpretter. We're installing Ruby from source with RVM, so it's not a package issue.

Here is a link to the bug on Ruby's site. Didn't get a very friendly reception there :-)
http://redmine.ruby-lang.org/issues/4777

Owner

indirect commented May 31, 2011

Ah, yeah, I think you're right and it's somehow a bad interaction between Ruby itself and Ubuntu. Seems like it would be nice to give exact repro steps on the redmine ticket, though. :)

Yeah you right (sigh)... I'll do it later :-).

ajsharp commented Jun 30, 2011

FWIW, we're experiencing the same issue with same ruby and ubuntu versions with resque-scheduler.

Owner

indirect commented Jun 30, 2011

Unfortunately, as far as we have even able to figure out, this is a bug with that ruby on ubuntu. :( Since I don't have access to either one, is there a chance you could investigate?

On Jun 30, 2011, at 11:22 AM, ajsharp reply@reply.github.com wrote:

FWIW, we're experiencing the same issue with same ruby and ubuntu versions with resque-scheduler.

Reply to this email directly or view it on GitHub:
carlhuda#1200 (comment)

ajsharp commented Jun 30, 2011

This gist will reproduce: https://gist.github.com/1056924. Ruby 1.9.2-p180, ubuntu natty 11.04, kernel version 2.6.38-8-virtual. It seems if you shell out to the system, signal trapping ceases to work. The kernel bug is reported here: https://bugzilla.kernel.org/show_bug.cgi?id=32922.

If you look at the ruby issue: http://redmine.ruby-lang.org/issues/4777 you will see that the bug is in the kernel that ships with Ubuntu 11.04.

The suggested fix is to either upgrade the kernel to 2.6.39 (via kernel-ppa) or downgrade to the 10.10 kernel.

Owner

indirect commented Jun 30, 2011

Thanks for reporting back with the solution! :)

On Jun 30, 2011, at 2:40 PM, psanford reply@reply.github.com wrote:

If you look at the ruby issue: http://redmine.ruby-lang.org/issues/4777 you will see that the bug is in the kernel that ships with Ubuntu 11.04.

The suggested fix is to either upgrade the kernel to 2.6.39 (via kernel-ppa) or downgrade to the 10.10 kernel.

Reply to this email directly or view it on GitHub:
carlhuda#1200 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment