{"action":"created","issue":{"url":"https://api.github.com/repos/cowboyd/therubyracer/issues/206","labels_url":"https://api.github.com/repos/cowboyd/therubyracer/issues/206/labels{/name}","comments_url":"https://api.github.com/repos/cowboyd/therubyracer/issues/206/comments","events_url":"https://api.github.com/repos/cowboyd/therubyracer/issues/206/events","html_url":"https://github.com/cowboyd/therubyracer/issues/206","id":8111365,"number":206,"title":"\"undefined method `Exit' for nil:NilClass\" when using em-synchrony on Ubuntu","user":{"login":"alexkwolfe","id":569,"avatar_url":"https://avatars.githubusercontent.com/u/569?v=3","gravatar_id":"","url":"https://api.github.com/users/alexkwolfe","html_url":"https://github.com/alexkwolfe","followers_url":"https://api.github.com/users/alexkwolfe/followers","following_url":"https://api.github.com/users/alexkwolfe/following{/other_user}","gists_url":"https://api.github.com/users/alexkwolfe/gists{/gist_id}","starred_url":"https://api.github.com/users/alexkwolfe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexkwolfe/subscriptions","organizations_url":"https://api.github.com/users/alexkwolfe/orgs","repos_url":"https://api.github.com/users/alexkwolfe/repos","events_url":"https://api.github.com/users/alexkwolfe/events{/privacy}","received_events_url":"https://api.github.com/users/alexkwolfe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":19,"created_at":"2012-11-05T17:08:31Z","updated_at":"2015-06-15T01:48:04Z","closed_at":null,"body":"This occurs for me on Ubuntu 10.04.4 LTS, but not on Mountain Lion. I'm using libv8 3.11.8.3 and the latest commit from therubyracer repo (e31dc5c) master branch.\r\n\r\nThe test case provided in the potentially related issue #190 executes fine on both operating systems.\r\n\r\nThe following test case, however, does not.  It passes on Mountain Lion, but fails on Ubuntu.\r\n\r\nAt first I thought maybe this was a problem with Fibers. I know that's a point of difficulty. But if you comment out the `test_first` method, the `test_second` method executes without error.  Also, the fact that the test passes on Mountain Lion but not Ubuntu seems like a clue.\r\n\r\nI can most likely provide access to the environment where this fails, if that helps.\r\n\r\n```ruby\r\nrequire 'test/unit'\r\nrequire 'v8'\r\nrequire 'eventmachine-le'\r\nrequire 'em-synchrony'\r\n\r\nclass RacerTest < Test::Unit::TestCase\r\n  def do_eval\r\n    fxn = V8::Context.new.eval('(function(arg) { return 1 + arg })')\r\n    assert_equal 6, fxn.call(5)\r\n  end\r\n\r\n  def test_first\r\n    do_eval\r\n  end\r\n\r\n  def test_second\r\n    EM.synchrony {\r\n      begin\r\n        do_eval\r\n      ensure\r\n        EM.stop\r\n      end\r\n    }\r\n  end\r\nend\r\n```\r\n\r\nHere's what the error on Ubuntu looks like:\r\n\r\n```\r\n$ bundle exec ruby -Itest test/unit/rr_test.rb \r\nLoaded suite test/unit/rr_test\r\nStarted\r\n.E\r\n===============================================================================\r\nError: test_second(RacerTest)\r\n  NoMethodError: undefined method `Exit' for nil:NilClass\r\n../bundler/gems/therubyracer-e31dc5c0042e/lib/v8/context.rb:237:in `ensure in block (2 levels) in lock_scope_and_enter'\r\n../bundler/gems/therubyracer-e31dc5c0042e/lib/v8/context.rb:237:in `block (2 levels) in lock_scope_and_enter'\r\n../bundler/gems/therubyracer-e31dc5c0042e/lib/v8/context.rb:232:in `call'\r\n../bundler/gems/therubyracer-e31dc5c0042e/lib/v8/context.rb:232:in `HandleScope'\r\n../bundler/gems/therubyracer-e31dc5c0042e/lib/v8/context.rb:232:in `block in lock_scope_and_enter'\r\n../bundler/gems/therubyracer-e31dc5c0042e/lib/v8/context.rb:231:in `call'\r\n../bundler/gems/therubyracer-e31dc5c0042e/lib/v8/context.rb:231:in `Locker'\r\n../bundler/gems/therubyracer-e31dc5c0042e/lib/v8/context.rb:231:in `lock_scope_and_enter'\r\n../bundler/gems/therubyracer-e31dc5c0042e/lib/v8/context.rb:191:in `enter'\r\n../bundler/gems/therubyracer-e31dc5c0042e/lib/v8/context.rb:85:in `eval'\r\ntest/unit/rr_test.rb:9:in `do_eval'\r\ntest/unit/rr_test.rb:20:in `block in test_second'\r\n../gems/em-synchrony-1.0.2/lib/em-synchrony.rb:26:in `call'\r\n../gems/em-synchrony-1.0.2/lib/em-synchrony.rb:26:in `block (2 levels) in synchrony'\r\n===============================================================================\r\n\r\n\r\nFinished in 0.00657601 seconds.\r\n\r\n2 tests, 1 assertions, 0 failures, 1 errors, 0 pendings, 0 omissions, 0 notifications\r\n50% passed\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/cowboyd/therubyracer/issues/comments/111897722","html_url":"https://github.com/cowboyd/therubyracer/issues/206#issuecomment-111897722","issue_url":"https://api.github.com/repos/cowboyd/therubyracer/issues/206","id":111897722,"user":{"login":"bdmac","id":47326,"avatar_url":"https://avatars.githubusercontent.com/u/47326?v=3","gravatar_id":"","url":"https://api.github.com/users/bdmac","html_url":"https://github.com/bdmac","followers_url":"https://api.github.com/users/bdmac/followers","following_url":"https://api.github.com/users/bdmac/following{/other_user}","gists_url":"https://api.github.com/users/bdmac/gists{/gist_id}","starred_url":"https://api.github.com/users/bdmac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdmac/subscriptions","organizations_url":"https://api.github.com/users/bdmac/orgs","repos_url":"https://api.github.com/users/bdmac/repos","events_url":"https://api.github.com/users/bdmac/events{/privacy}","received_events_url":"https://api.github.com/users/bdmac/received_events","type":"User","site_admin":false},"created_at":"2015-06-15T01:48:04Z","updated_at":"2015-06-15T01:48:04Z","body":"@samsaffron I actually tried wrapping the handlebars compilation bit in a thread like you are doing there and also in a sub process with `Process.new {}` but neither of those seemed to really work maybe because I was already in a fiber on sidekiq?"}}