Crashes with TTF fonts on OS X #44

Closed
javierav opened this Issue Apr 17, 2012 · 74 comments

Comments

Projects
None yet
@javierav

https://gist.github.com/2405155

I have a simple feature (see Gist) and when I run the test I get the error randomly (some times in one Scenario and other in another) . In the Gist example, if I run the failing test again, the tes pass correctly.

uname -a => Linux jarandapc 3.0.6-gentoo #2 SMP PREEMPT Wed Nov 9 21:42:08 CET 2011 x86_64 Intel(R) Pentium(R) CPU G860 @ 3.00GHz GenuineIntel GNU/Linux

Any idea?

@jonleighton

This comment has been minimized.

Show comment
Hide comment
@jonleighton

jonleighton Apr 18, 2012

Contributor

Hmm, it sounds like phantomjs is segfaulting. Did you compile phantomjs yourself or install the binary? If you installed the binary, try compiling it yourself?

Ultimately probably there are going to be issues like this from time to time, so I should add some easy way to run phantomjs under gdb so that people can obtain stack traces and we can find/fix the issues.

Contributor

jonleighton commented Apr 18, 2012

Hmm, it sounds like phantomjs is segfaulting. Did you compile phantomjs yourself or install the binary? If you installed the binary, try compiling it yourself?

Ultimately probably there are going to be issues like this from time to time, so I should add some easy way to run phantomjs under gdb so that people can obtain stack traces and we can find/fix the issues.

@sarmiena

This comment has been minimized.

Show comment
Hide comment
@sarmiena

sarmiena Apr 21, 2012

I'm getting this error on a regular basis:

     Capybara::Poltergeist::DeadClient:
       The PhantomJS client died while processing {"name":"visit","args":["http://test.host:1337/plans"]}

capybara 1.1.2
poltergeist 0.6.0
phantomjs 1.5.0 (binary -- downloaded from site and all files inserted into rails application /spec/support/)
OSX Lion

# spec_helper.rb
  Capybara.register_driver :poltergeist do |app|
    if RUBY_PLATFORM.downcase.include?("darwin")
      Capybara::Poltergeist::Driver.new(app, phantomjs: "#{Rails::root}/spec/support/darwin/phantomjs/bin/phantomjs")
    elsif RUBY_PLATFORM.downcase.include?("linux")
      Capybara::Poltergeist::Driver.new(app, phantomjs: "#{Rails::root}/spec/support/linux/phantomjs/bin/phantomjs")
    end
  end

Console errors:
4/20/12 11:32:42.672 PM ReportCrash: Failed to create CSSymbolicatorRef for phantomjs[18040]
4/20/12 11:32:42.780 PM ReportCrash: Failed to create dSYM-less CSSymbolicatorRef for phantomjs[18040]

I'm getting this error on a regular basis:

     Capybara::Poltergeist::DeadClient:
       The PhantomJS client died while processing {"name":"visit","args":["http://test.host:1337/plans"]}

capybara 1.1.2
poltergeist 0.6.0
phantomjs 1.5.0 (binary -- downloaded from site and all files inserted into rails application /spec/support/)
OSX Lion

# spec_helper.rb
  Capybara.register_driver :poltergeist do |app|
    if RUBY_PLATFORM.downcase.include?("darwin")
      Capybara::Poltergeist::Driver.new(app, phantomjs: "#{Rails::root}/spec/support/darwin/phantomjs/bin/phantomjs")
    elsif RUBY_PLATFORM.downcase.include?("linux")
      Capybara::Poltergeist::Driver.new(app, phantomjs: "#{Rails::root}/spec/support/linux/phantomjs/bin/phantomjs")
    end
  end

Console errors:
4/20/12 11:32:42.672 PM ReportCrash: Failed to create CSSymbolicatorRef for phantomjs[18040]
4/20/12 11:32:42.780 PM ReportCrash: Failed to create dSYM-less CSSymbolicatorRef for phantomjs[18040]

@jonleighton

This comment has been minimized.

Show comment
Hide comment
@jonleighton

jonleighton Apr 22, 2012

Contributor

@sarmiena does your crash happen every time on the same tests, or does it sometimes happen and sometimes not? does it happen on all tests or just some of them?

Contributor

jonleighton commented Apr 22, 2012

@sarmiena does your crash happen every time on the same tests, or does it sometimes happen and sometimes not? does it happen on all tests or just some of them?

@sarmiena

This comment has been minimized.

Show comment
Hide comment
@sarmiena

sarmiena Apr 22, 2012

It happens on every other test (first one passes).

It happens on every other test (first one passes).

@DouweM

This comment has been minimized.

Show comment
Hide comment
@DouweM

DouweM Apr 22, 2012

I'm having the exact same problem:

Failure/Error: click_button "Log in"
Capybara::Poltergeist::DeadClient:
  The PhantomJS client died while processing {"name":"click","args":[4,2]}

with this extremely exciting code:

visit new_user_session_path
fill_in "Email",    with: current_user.email
fill_in "Password", with: current_user.password
click_button "Log in"

As with @sarmiena, it happens with every other test, so I'm seeing ".F.F", after which it halts until I ^C.

DouweM commented Apr 22, 2012

I'm having the exact same problem:

Failure/Error: click_button "Log in"
Capybara::Poltergeist::DeadClient:
  The PhantomJS client died while processing {"name":"click","args":[4,2]}

with this extremely exciting code:

visit new_user_session_path
fill_in "Email",    with: current_user.email
fill_in "Password", with: current_user.password
click_button "Log in"

As with @sarmiena, it happens with every other test, so I'm seeing ".F.F", after which it halts until I ^C.

@sarmiena

This comment has been minimized.

Show comment
Hide comment
@sarmiena

sarmiena Apr 24, 2012

Any epiphanies?

Any epiphanies?

@DouweM

This comment has been minimized.

Show comment
Hide comment
@DouweM

DouweM Apr 24, 2012

None on my part, I've started using capybara-webkit again.

DouweM commented Apr 24, 2012

None on my part, I've started using capybara-webkit again.

@sarmiena

This comment has been minimized.

Show comment
Hide comment
@sarmiena

sarmiena Apr 24, 2012

same here

same here

@jonleighton

This comment has been minimized.

Show comment
Hide comment
@jonleighton

jonleighton Apr 24, 2012

Contributor

Hi guys,

Sorry you've had trouble. I've posted a message on the PhantomJS list here: http://groups.google.com/group/phantomjs/browse_thread/thread/2365cfca349018f8

Let's see if anyone has ideas on there - I don't know much about OS X issues but others on that list do.

Jon

Contributor

jonleighton commented Apr 24, 2012

Hi guys,

Sorry you've had trouble. I've posted a message on the PhantomJS list here: http://groups.google.com/group/phantomjs/browse_thread/thread/2365cfca349018f8

Let's see if anyone has ideas on there - I don't know much about OS X issues but others on that list do.

Jon

@sarmiena

This comment has been minimized.

Show comment
Hide comment
@sarmiena

sarmiena Apr 25, 2012

cool. thanks

cool. thanks

@jonleighton

This comment has been minimized.

Show comment
Hide comment
@jonleighton

jonleighton Jun 4, 2012

Contributor

Hi guys,

Can those of you who are experiencing crashes try running ulimit -c unlimited before running your tests? This will allow your OS to generate a core file when it crashes. Which you can then send to me. On OS X the core file will be in /cores. On Linux it'll be in the current working directory.

Thanks

Update: please don't do this on OS X. I won't be able to analyse it. The next version of PhantomJS will include crash reporting capability which will help.

Contributor

jonleighton commented Jun 4, 2012

Hi guys,

Can those of you who are experiencing crashes try running ulimit -c unlimited before running your tests? This will allow your OS to generate a core file when it crashes. Which you can then send to me. On OS X the core file will be in /cores. On Linux it'll be in the current working directory.

Thanks

Update: please don't do this on OS X. I won't be able to analyse it. The next version of PhantomJS will include crash reporting capability which will help.

@senny

This comment has been minimized.

Show comment
Hide comment
@senny

senny Jun 12, 2012

I switchted to poltergeist some time ago and everything runs fine. This morning I did some gem upgrades and I noticed features tagged running with poltergeist started failing. I don't have much time to debug the issue but I would like to share the information I've got. I tracked the DeadClinet error down to the following commit:

diff --git a/Gemfile b/Gemfile
index 42b5a60..6895444 100644
--- a/Gemfile
+++ b/Gemfile
@@ -69,7 +69,7 @@ end
 # Gems used only for assets and not required
 # in production environments by default.
 group :assets do
-  gem 'twitter-bootstrap-rails', :git => 'https://github.com/seyhunak/twitter-bootstrap-rails.git' # bootst
+  gem 'twitter-bootstrap-rails', '~> 2.1.0'
   gem 'therubyracer'
   gem 'uglifier', '>= 1.0.3'
 end
diff --git a/Gemfile.lock b/Gemfile.lock
index e609e85..9a0ee2c 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -12,16 +12,6 @@ GIT
       capybara

 GIT
-  remote: https://github.com/seyhunak/twitter-bootstrap-rails.git
-  revision: c646c2d31174f4d3b3bd01c715ea4a3e5587c85d
-  specs:
-    twitter-bootstrap-rails (2.0.8.1)
-      actionpack (>= 3.1)
-      less-rails (~> 2.2.2)
-      railties (>= 3.1)
-      therubyracer (~> 0.10.1)
-
-GIT
   remote: ssh://code@git.garaio.com:29418/ror/garaio/garaio_view_helpers
   revision: 75327969674d6a6d7ae556b6b4b61a3eacea1fdb
   branch: master
@@ -307,6 +297,11 @@ GEM
       polyglot
       polyglot (>= 0.3.1)
     ttfunk (1.0.3)
+    twitter-bootstrap-rails (2.1.0)
+      actionpack (>= 3.1)
+      less-rails (~> 2.2.2)
+      railties (>= 3.1)
+      therubyracer (~> 0.10.1)
     tzinfo (0.3.33)
     uglifier (1.2.3)
       execjs (>= 0.3.0)
@@ -352,7 +347,7 @@ DEPENDENCIES
   therubyracer
   thin
   timecop
-  twitter-bootstrap-rails!
+  twitter-bootstrap-rails (~> 2.1.0)
   uglifier (>= 1.0.3)
   virtus
   will_paginate

red works and green breaks features running with poltergeist randomly. I receive errors like:

The PhantomJS client died while processing {"name":"current_url","args":[]} (Capybara::Poltergeist::DeadClient)

I hope this helps somewhat. Feel free to ask if you need additional informations.

senny commented Jun 12, 2012

I switchted to poltergeist some time ago and everything runs fine. This morning I did some gem upgrades and I noticed features tagged running with poltergeist started failing. I don't have much time to debug the issue but I would like to share the information I've got. I tracked the DeadClinet error down to the following commit:

diff --git a/Gemfile b/Gemfile
index 42b5a60..6895444 100644
--- a/Gemfile
+++ b/Gemfile
@@ -69,7 +69,7 @@ end
 # Gems used only for assets and not required
 # in production environments by default.
 group :assets do
-  gem 'twitter-bootstrap-rails', :git => 'https://github.com/seyhunak/twitter-bootstrap-rails.git' # bootst
+  gem 'twitter-bootstrap-rails', '~> 2.1.0'
   gem 'therubyracer'
   gem 'uglifier', '>= 1.0.3'
 end
diff --git a/Gemfile.lock b/Gemfile.lock
index e609e85..9a0ee2c 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -12,16 +12,6 @@ GIT
       capybara

 GIT
-  remote: https://github.com/seyhunak/twitter-bootstrap-rails.git
-  revision: c646c2d31174f4d3b3bd01c715ea4a3e5587c85d
-  specs:
-    twitter-bootstrap-rails (2.0.8.1)
-      actionpack (>= 3.1)
-      less-rails (~> 2.2.2)
-      railties (>= 3.1)
-      therubyracer (~> 0.10.1)
-
-GIT
   remote: ssh://code@git.garaio.com:29418/ror/garaio/garaio_view_helpers
   revision: 75327969674d6a6d7ae556b6b4b61a3eacea1fdb
   branch: master
@@ -307,6 +297,11 @@ GEM
       polyglot
       polyglot (>= 0.3.1)
     ttfunk (1.0.3)
+    twitter-bootstrap-rails (2.1.0)
+      actionpack (>= 3.1)
+      less-rails (~> 2.2.2)
+      railties (>= 3.1)
+      therubyracer (~> 0.10.1)
     tzinfo (0.3.33)
     uglifier (1.2.3)
       execjs (>= 0.3.0)
@@ -352,7 +347,7 @@ DEPENDENCIES
   therubyracer
   thin
   timecop
-  twitter-bootstrap-rails!
+  twitter-bootstrap-rails (~> 2.1.0)
   uglifier (>= 1.0.3)
   virtus
   will_paginate

red works and green breaks features running with poltergeist randomly. I receive errors like:

The PhantomJS client died while processing {"name":"current_url","args":[]} (Capybara::Poltergeist::DeadClient)

I hope this helps somewhat. Feel free to ask if you need additional informations.

@walski

This comment has been minimized.

Show comment
Hide comment
@walski

walski Jun 12, 2012

Running into the same problem over here but the only thing I share with the above mentioned gems is actionpack :/

walski commented Jun 12, 2012

Running into the same problem over here but the only thing I share with the above mentioned gems is actionpack :/

@jonleighton

This comment has been minimized.

Show comment
Hide comment
@jonleighton

jonleighton Jun 13, 2012

Contributor

Just to let everyone in this ticket know, I have been working to add a crash reporter (google breakpad) to PhantomJS. This means that when the next release comes up we will have a good way of getting stack traces from crashes which should help a lot.

Contributor

jonleighton commented Jun 13, 2012

Just to let everyone in this ticket know, I have been working to add a crash reporter (google breakpad) to PhantomJS. This means that when the next release comes up we will have a good way of getting stack traces from crashes which should help a lot.

@senny

This comment has been minimized.

Show comment
Hide comment
@senny

senny Jun 13, 2012

@jonleighton thanks for the update and your efforts. I hope we get more insight to resolve these random crashes.

senny commented Jun 13, 2012

@jonleighton thanks for the update and your efforts. I hope we get more insight to resolve these random crashes.

@walski

This comment has been minimized.

Show comment
Hide comment
@walski

walski Jun 13, 2012

👍

I've managed to narrow the high level cause down a little bit in my case: I'm accessing a website with an iframe and the error happens when finally the iframe posts a message to the top window that leads to a change of the location of the top window. Interesting enough that does NOT happen when I try to "redirect" the top window to a not existing page but does happen when the page is delivered. It's a really simple page with just one h1 or whatever. Aaaalso I do see the crash when I return a 404 from my application server and the 404 is not delivered by the webserver itself. I've to investigate on the last finding a bit more, maybe there is some middleware doing strange things or whatever. Meh meh meh.

walski commented Jun 13, 2012

👍

I've managed to narrow the high level cause down a little bit in my case: I'm accessing a website with an iframe and the error happens when finally the iframe posts a message to the top window that leads to a change of the location of the top window. Interesting enough that does NOT happen when I try to "redirect" the top window to a not existing page but does happen when the page is delivered. It's a really simple page with just one h1 or whatever. Aaaalso I do see the crash when I return a 404 from my application server and the 404 is not delivered by the webserver itself. I've to investigate on the last finding a bit more, maybe there is some middleware doing strange things or whatever. Meh meh meh.

@Skulli

This comment has been minimized.

Show comment
Hide comment
@Skulli

Skulli Jun 16, 2012

Just noticed the same issue on my project. It happens after i upgrade the above mentioned gem twitter-bootstrap-rails from 2.0.8 to 2.1.0 and 2.0.9. A Downgrade helped.
Though the problem only occurred on my mac with phantomjs installed via homebrew. My linux machine doesnt have that problem (binary install).

Skulli commented Jun 16, 2012

Just noticed the same issue on my project. It happens after i upgrade the above mentioned gem twitter-bootstrap-rails from 2.0.8 to 2.1.0 and 2.0.9. A Downgrade helped.
Though the problem only occurred on my mac with phantomjs installed via homebrew. My linux machine doesnt have that problem (binary install).

@DouweM

This comment has been minimized.

Show comment
Hide comment
@DouweM

DouweM Jun 16, 2012

Upgrading from 2.0.8 tot 2.0.9 causes the problem you say? In that case the culprit in somewhere in this string of commits. Could you try pointing your Gemfile to each of those commits, to see at what point exactly the problem appears?

You can specify a commit to point to like this:

gem 'twitter-bootstrap-rails', :github => "seyhunak/twitter-bootstrap-rails", :ref => "a1b2c3"

DouweM commented Jun 16, 2012

Upgrading from 2.0.8 tot 2.0.9 causes the problem you say? In that case the culprit in somewhere in this string of commits. Could you try pointing your Gemfile to each of those commits, to see at what point exactly the problem appears?

You can specify a commit to point to like this:

gem 'twitter-bootstrap-rails', :github => "seyhunak/twitter-bootstrap-rails", :ref => "a1b2c3"
@Skulli

This comment has been minimized.

Show comment
Hide comment
@Skulli

Skulli Jun 17, 2012

Okay, tried it out and it starts happening with commit "fc40fde"
seyhunak/twitter-bootstrap-rails@fc40fde

Skulli commented Jun 17, 2012

Okay, tried it out and it starts happening with commit "fc40fde"
seyhunak/twitter-bootstrap-rails@fc40fde

@DouweM

This comment has been minimized.

Show comment
Hide comment
@DouweM

DouweM Jun 17, 2012

This is so weird, because there's literally nothing in there that I could imagine having any effect on the way Poltergeist behaves; it's just a bunch of edited CSS files. Granted, I don't know anything about the internals of Poltergeist, so @jonleighton should really take a look at this, but I'm stumped.

DouweM commented Jun 17, 2012

This is so weird, because there's literally nothing in there that I could imagine having any effect on the way Poltergeist behaves; it's just a bunch of edited CSS files. Granted, I don't know anything about the internals of Poltergeist, so @jonleighton should really take a look at this, but I'm stumped.

@jonleighton

This comment has been minimized.

Show comment
Hide comment
@jonleighton

jonleighton Jun 17, 2012

Contributor

It's not really a poltergeist bug so much as a phantomjs/qt/webkit bug. Presumably that font is causing phantomjs to crash for some reason. The next version of phantomjs will be released this week - if somebody can produce a minimal test case for this crash that would be helpful and I will try to see if there is a fix possible in phantomjs.

Contributor

jonleighton commented Jun 17, 2012

It's not really a poltergeist bug so much as a phantomjs/qt/webkit bug. Presumably that font is causing phantomjs to crash for some reason. The next version of phantomjs will be released this week - if somebody can produce a minimal test case for this crash that would be helpful and I will try to see if there is a fix possible in phantomjs.

@jonleighton

This comment has been minimized.

Show comment
Hide comment
@jonleighton

jonleighton Jun 17, 2012

Contributor

Actually, please ignore the above, as I see that you said it only happens on a Mac. I don't have easy access to a Mac so I won't be able to debug the crash in this short time frame.

However, my main priority at the moment is adding proper crash reporting to PhantomJS to help with these situations. Linux support is already done and I hope/intend to work on OS X support tomorrow in time for the 1.6.0 release. So it should get easier after that.

Contributor

jonleighton commented Jun 17, 2012

Actually, please ignore the above, as I see that you said it only happens on a Mac. I don't have easy access to a Mac so I won't be able to debug the crash in this short time frame.

However, my main priority at the moment is adding proper crash reporting to PhantomJS to help with these situations. Linux support is already done and I hope/intend to work on OS X support tomorrow in time for the 1.6.0 release. So it should get easier after that.

@mattgillooly

This comment has been minimized.

Show comment
Hide comment
@mattgillooly

mattgillooly Jul 10, 2012

I encountered this error as well, and I was also able to resolve it by locking twitter-bootstrap-rails to version 2.0.8. Thanks @senny and @Skulli

I encountered this error as well, and I was also able to resolve it by locking twitter-bootstrap-rails to version 2.0.8. Thanks @senny and @Skulli

@jonleighton

This comment has been minimized.

Show comment
Hide comment
@jonleighton

jonleighton Jul 10, 2012

Contributor

Can someone try out the master branching with PhantomJS 1.6 and let me know if you still have the problem with twitter bootstrap? Thanks

Contributor

jonleighton commented Jul 10, 2012

Can someone try out the master branching with PhantomJS 1.6 and let me know if you still have the problem with twitter bootstrap? Thanks

@Skulli

This comment has been minimized.

Show comment
Hide comment
@Skulli

Skulli Jul 10, 2012

still crashing with the static 1.6 on mac os installed via brew.
Will upload the dmp file later.

Skulli commented Jul 10, 2012

still crashing with the static 1.6 on mac os installed via brew.
Will upload the dmp file later.

@bcardarella

This comment has been minimized.

Show comment
Hide comment
@bcardarella

bcardarella Jul 10, 2012

I had this issue the other day and was able to resolve it that one time by allowing ActiveRecord to work in multiple threads:

class ActiveRecord::Base
  mattr_accessor :shared_connection
  @@shared_connection = nil

  def self.connection
    @@shared_connection || retrieve_connection
  end
end

RSpec.configure do |config|
  config.before(:suite) do
    ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection
  end
end

But now I am running into this issue again and am not able to diagnose it properly. I do not believe this is poltergeist specific as capybara-webkit just hangs with no timeout at all.

I had this issue the other day and was able to resolve it that one time by allowing ActiveRecord to work in multiple threads:

class ActiveRecord::Base
  mattr_accessor :shared_connection
  @@shared_connection = nil

  def self.connection
    @@shared_connection || retrieve_connection
  end
end

RSpec.configure do |config|
  config.before(:suite) do
    ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection
  end
end

But now I am running into this issue again and am not able to diagnose it properly. I do not believe this is poltergeist specific as capybara-webkit just hangs with no timeout at all.

@bcardarella

This comment has been minimized.

Show comment
Hide comment
@bcardarella

bcardarella Jul 10, 2012

It seems that TTF fonts are causing an issue here. The file cubano-regular-webfont.ttf, if we use other font formats we are OK.

It seems that TTF fonts are causing an issue here. The file cubano-regular-webfont.ttf, if we use other font formats we are OK.

@dynjo

This comment has been minimized.

Show comment
Hide comment
@dynjo

dynjo Jul 11, 2012

We are getting this error too, using Font Awesome via https://github.com/wbzyl/less-rails-fontawesome

dynjo commented Jul 11, 2012

We are getting this error too, using Font Awesome via https://github.com/wbzyl/less-rails-fontawesome

@Skulli

This comment has been minimized.

Show comment
Hide comment
@Skulli

Skulli Jul 11, 2012

@harrikauhanen

This comment has been minimized.

Show comment
Hide comment
@harrikauhanen

harrikauhanen Jul 11, 2012

Our tests also started passing (on Mac) when we disabled Font Awesome (https://github.com/littlebtc/font-awesome-sass-rails). Looks like a Mac+Font issue as it does not occur on Linux even with these font icons enabled.

Our tests also started passing (on Mac) when we disabled Font Awesome (https://github.com/littlebtc/font-awesome-sass-rails). Looks like a Mac+Font issue as it does not occur on Linux even with these font icons enabled.

@almog

This comment has been minimized.

Show comment
Hide comment
@almog

almog Jul 29, 2012

Just like @bcardarella I just had this issue with ttf font files (svg and otf didn't cause any problem).

almog commented Jul 29, 2012

Just like @bcardarella I just had this issue with ttf font files (svg and otf didn't cause any problem).

@bcardarella

This comment has been minimized.

Show comment
Hide comment
@bcardarella

bcardarella Jul 29, 2012

It is strange because as long as the file is in the asset pipeline it errors out, even if the CSS does not reference the TTF file in anyway

It is strange because as long as the file is in the asset pipeline it errors out, even if the CSS does not reference the TTF file in anyway

@jonleighton

This comment has been minimized.

Show comment
Hide comment
@jonleighton

jonleighton Aug 4, 2012

Contributor

Here is a (not very useful) stack trace generated from that dump: https://gist.github.com/3257935

Contributor

jonleighton commented Aug 4, 2012

Here is a (not very useful) stack trace generated from that dump: https://gist.github.com/3257935

@jonleighton

This comment has been minimized.

Show comment
Hide comment
@jonleighton

jonleighton Aug 4, 2012

Contributor

@mhenrixon mhenrixon referenced this issue in littlebtc/font-awesome-sass-rails Aug 21, 2012

Closed

Problem with ttf and Mac OS X #11

@ShogunPanda

This comment has been minimized.

Show comment
Hide comment
@ShogunPanda

ShogunPanda Aug 27, 2012

In my case it happens only after the first example, then phantom get reinitialized and the next example goes through.
To be more understandable, the odds test go through, the evens fail.

In my case it happens only after the first example, then phantom get reinitialized and the next example goes through.
To be more understandable, the odds test go through, the evens fail.

@tombu tombu referenced this issue in seyhunak/twitter-bootstrap-rails Sep 18, 2012

Closed

FontAwesome icons are not displayed in IE8 #361

@namxam

This comment has been minimized.

Show comment
Hide comment
@namxam

namxam Sep 24, 2012

@ShogunPanda The reason why every second test works is due to the fact that poltergeist starts a new phantomjs browser after one dies.

namxam commented Sep 24, 2012

@ShogunPanda The reason why every second test works is due to the fact that poltergeist starts a new phantomjs browser after one dies.

@mjtko

This comment has been minimized.

Show comment
Hide comment
@mjtko

mjtko Oct 24, 2012

Contributor

I have created a monkey patch to prevent PhantomJS from crashing by denying access to TTF files in the assets pipeline when doing Rails integration tests.

It's unpleasant. It works until we get a fix to PhantomJS/Webkit. YMMV.

I needed this, as I both need the font-awesome-sass-rails gem in test and I use @font-face declarations within the application itself.

"Enjoy".

https://gist.github.com/3946516

Contributor

mjtko commented Oct 24, 2012

I have created a monkey patch to prevent PhantomJS from crashing by denying access to TTF files in the assets pipeline when doing Rails integration tests.

It's unpleasant. It works until we get a fix to PhantomJS/Webkit. YMMV.

I needed this, as I both need the font-awesome-sass-rails gem in test and I use @font-face declarations within the application itself.

"Enjoy".

https://gist.github.com/3946516

mjtko added a commit to mjtko/poltergeist that referenced this issue Nov 3, 2012

@mjtko

This comment has been minimized.

Show comment
Hide comment
@mjtko

mjtko Nov 3, 2012

Contributor

Let me know if you think they need to be clearer and I'll modify and squash.

Contributor

mjtko commented Nov 3, 2012

Let me know if you think they need to be clearer and I'll modify and squash.

jonleighton added a commit that referenced this issue Nov 3, 2012

Merge pull request #191 from mjtko/fix/troubleshooting-osx-fontface
Notes for troubleshooting section relating to PhantomJS crashes (#44)
@tsgautier

This comment has been minimized.

Show comment
Hide comment
@tsgautier

tsgautier Nov 20, 2012

I seem to be having a very similar issue occurring on my centos 6 machine that is acting as my build server (running jenkins). Running visit just once from cucumber works, but running twice always fails with the exact same error listed here.

If anyone would like my puppet recipe that gets my centos machine in shape maybe they could load it up on a Vagrant box and try it out?

My app is using bootstrap, but I looked through the css and didn't see any reference to a TT font.

Strangely enough, it works fine on OS X for me.

I'm installing PhantomJS 1.7.0 in both cases.

I seem to be having a very similar issue occurring on my centos 6 machine that is acting as my build server (running jenkins). Running visit just once from cucumber works, but running twice always fails with the exact same error listed here.

If anyone would like my puppet recipe that gets my centos machine in shape maybe they could load it up on a Vagrant box and try it out?

My app is using bootstrap, but I looked through the css and didn't see any reference to a TT font.

Strangely enough, it works fine on OS X for me.

I'm installing PhantomJS 1.7.0 in both cases.

@tsgautier

This comment has been minimized.

Show comment
Hide comment
@tsgautier

tsgautier Nov 20, 2012

Some more detail - as someone previously said, this really feels like a poltergeist issue not a PhantomJS issue.

This does not work:

Scenario: Viewing products

Given I am on the products page
Then I should see products
And one product is set as default

Scenario: Click on a product

Given I am on the products page
When I click on a product
Then I should see a list of rate plans

However, this does work:

Scenario: Viewing products

Given I am on the products page
Then I should see products
And one product is set as default

Given I am on the products page
When I click on a product
Then I should see a list of rate plans

Note that it is the "Given I am on the products page" step which fails when two scenarios are defined, this step is pretty basic, it's implemented as:

Given /^I am on the products page$/ do
    visit('/products')
end

Some more detail - as someone previously said, this really feels like a poltergeist issue not a PhantomJS issue.

This does not work:

Scenario: Viewing products

Given I am on the products page
Then I should see products
And one product is set as default

Scenario: Click on a product

Given I am on the products page
When I click on a product
Then I should see a list of rate plans

However, this does work:

Scenario: Viewing products

Given I am on the products page
Then I should see products
And one product is set as default

Given I am on the products page
When I click on a product
Then I should see a list of rate plans

Note that it is the "Given I am on the products page" step which fails when two scenarios are defined, this step is pretty basic, it's implemented as:

Given /^I am on the products page$/ do
    visit('/products')
end
@jonleighton

This comment has been minimized.

Show comment
Hide comment
@jonleighton

jonleighton Nov 20, 2012

Contributor

@tsgautier sounds like a different issue if there is no TTF font. do you have a crash dump? if so please open a separate issue and provide the dump.

Contributor

jonleighton commented Nov 20, 2012

@tsgautier sounds like a different issue if there is no TTF font. do you have a crash dump? if so please open a separate issue and provide the dump.

@tgaff

This comment has been minimized.

Show comment
Hide comment
@tgaff

tgaff Nov 21, 2012

@tsgautier I think I have the same CentOS issue. The font disabling solution in goosetav's gift does not resolve it.
I filed it separately as #200. jonleighton#200

tgaff commented Nov 21, 2012

@tsgautier I think I have the same CentOS issue. The font disabling solution in goosetav's gift does not resolve it.
I filed it separately as #200. jonleighton#200

@willnathan

This comment has been minimized.

Show comment
Hide comment
@willnathan

willnathan Nov 21, 2012

+1 Also saw Capybara crashing on OSX after adding @font-face file referencing .ttf. Commented out the .ttf and worked again.

+1 Also saw Capybara crashing on OSX after adding @font-face file referencing .ttf. Commented out the .ttf and worked again.

@jonleighton

This comment has been minimized.

Show comment
Hide comment
@jonleighton

jonleighton Dec 12, 2012

Contributor

I've upgraded the version of Qt bundled with PhantomJS in ariya/phantomjs#367.

Could somebody on OS X who is affected by this bug please try building it to see if this fixes the problem? I have no idea if it will, but it's possible that the bug has been fixed in the newer Qt/WebKit version.

For build instructions see http://phantomjs.org/build.html. You need to checkout my branch, obviously.

Contributor

jonleighton commented Dec 12, 2012

I've upgraded the version of Qt bundled with PhantomJS in ariya/phantomjs#367.

Could somebody on OS X who is affected by this bug please try building it to see if this fixes the problem? I have no idea if it will, but it's possible that the bug has been fixed in the newer Qt/WebKit version.

For build instructions see http://phantomjs.org/build.html. You need to checkout my branch, obviously.

@mjtko

This comment has been minimized.

Show comment
Hide comment
@mjtko

mjtko Dec 12, 2012

Contributor

Ok, I've kicked off the build. Will get back to you in, well, a short while once it's built. 😄

Contributor

mjtko commented Dec 12, 2012

Ok, I've kicked off the build. Will get back to you in, well, a short while once it's built. 😄

@goosetav

This comment has been minimized.

Show comment
Hide comment
@goosetav

goosetav Dec 12, 2012

I'm giving it a try as well

On Dec 12, 2012, at 2:19 PM, Jon Leighton notifications@github.com wrote:

I've upgraded the version of Qt bundled with PhantomJS in ariya/phantomjs#367.

Could somebody on OS X who is affected by this bug please try building it to see if this fixes the problem? I have no idea if it will, but it's possible that the bug has been fixed in the newer Qt/WebKit version.

For build instructions see http://phantomjs.org/build.html. You need to checkout my branch, obviously.


Reply to this email directly or view it on GitHub.

I'm giving it a try as well

On Dec 12, 2012, at 2:19 PM, Jon Leighton notifications@github.com wrote:

I've upgraded the version of Qt bundled with PhantomJS in ariya/phantomjs#367.

Could somebody on OS X who is affected by this bug please try building it to see if this fixes the problem? I have no idea if it will, but it's possible that the bug has been fixed in the newer Qt/WebKit version.

For build instructions see http://phantomjs.org/build.html. You need to checkout my branch, obviously.


Reply to this email directly or view it on GitHub.

@mjtko

This comment has been minimized.

Show comment
Hide comment
@mjtko

mjtko Dec 12, 2012

Contributor

No joy I'm afraid, looks like it's still dying on TTFs. 😢

Contributor

mjtko commented Dec 12, 2012

No joy I'm afraid, looks like it's still dying on TTFs. 😢

@jonleighton

This comment has been minimized.

Show comment
Hide comment
@jonleighton

jonleighton Dec 12, 2012

Contributor

Ok, thanks for testing. It sounds like there is a plan to update to a newer version of WebKit in the next release. It's not happening this release because it will be tricky to do. But that may solve the problem if/when it happens.

Contributor

jonleighton commented Dec 12, 2012

Ok, thanks for testing. It sounds like there is a plan to update to a newer version of WebKit in the next release. It's not happening this release because it will be tricky to do. But that may solve the problem if/when it happens.

@mjtko

This comment has been minimized.

Show comment
Hide comment
@mjtko

mjtko Dec 12, 2012

Contributor

No problem, thanks for keeping us posted and for the Qt upgrade regardless!

Contributor

mjtko commented Dec 12, 2012

No problem, thanks for keeping us posted and for the Qt upgrade regardless!

@goosetav

This comment has been minimized.

Show comment
Hide comment
@goosetav

goosetav Dec 12, 2012

yep, same results. output from a failing spec can be found here: https://gist.github.com/4004813

crash dump is in this repo: https://github.com/goosetav/true_type_bug/tree/master/crash-dump

yep, same results. output from a failing spec can be found here: https://gist.github.com/4004813

crash dump is in this repo: https://github.com/goosetav/true_type_bug/tree/master/crash-dump

@marcelloma

This comment has been minimized.

Show comment
Hide comment
@marcelloma

marcelloma Dec 13, 2012

Im experiencing the same problems, both with capybara-webkit and poltergeist.

Using capybara-webkit with qt 4.8.3 also did not seem to fix the issue, so that update does not fix that I think.

Im experiencing the same problems, both with capybara-webkit and poltergeist.

Using capybara-webkit with qt 4.8.3 also did not seem to fix the issue, so that update does not fix that I think.

@marcelloma

This comment has been minimized.

Show comment
Hide comment
@marcelloma

marcelloma Dec 13, 2012

Tested capybara-webkit using qt 4.8.4 built from source now and had the same issues.
So I think 4.8.4 may not be a fix for phantom js too.

=(

Tested capybara-webkit using qt 4.8.4 built from source now and had the same issues.
So I think 4.8.4 may not be a fix for phantom js too.

=(

@ariya

This comment has been minimized.

Show comment
Hide comment
@ariya

ariya Dec 17, 2012

Is there any simplistic PhantomJS example which reproduce the issue? Perhaps just by loading a particular web page someone has crafted to crash it?

ariya commented Dec 17, 2012

Is there any simplistic PhantomJS example which reproduce the issue? Perhaps just by loading a particular web page someone has crafted to crash it?

@jonleighton

This comment has been minimized.

Show comment
Hide comment
@jonleighton

jonleighton Dec 26, 2012

Contributor

Can someone help ariya repro the issue? https://code.google.com/p/phantomjs/issues/detail?id=690#c9

Contributor

jonleighton commented Dec 26, 2012

Can someone help ariya repro the issue? https://code.google.com/p/phantomjs/issues/detail?id=690#c9

@samgranieri

This comment has been minimized.

Show comment
Hide comment
@samgranieri

samgranieri Dec 26, 2012

Repro?

On Dec 25, 2012, at 7:16 PM, Jon Leighton notifications@github.com wrote:

Can someone help ariya repro the issue? https://code.google.com/p/phantomjs/issues/detail?id=690#c9


Reply to this email directly or view it on GitHub.

Repro?

On Dec 25, 2012, at 7:16 PM, Jon Leighton notifications@github.com wrote:

Can someone help ariya repro the issue? https://code.google.com/p/phantomjs/issues/detail?id=690#c9


Reply to this email directly or view it on GitHub.

@goosetav

This comment has been minimized.

Show comment
Hide comment
@goosetav

goosetav Dec 26, 2012

Looks like he's already reproduced based on his last couple comments

I'm looking into dumping the poltergeist sequence into a .js file that can be run directly against phantomjs

On Dec 25, 2012, at 6:25 PM, Sam Granieri notifications@github.com wrote:

Repro?

On Dec 25, 2012, at 7:16 PM, Jon Leighton notifications@github.com wrote:

Can someone help ariya repro the issue? https://code.google.com/p/phantomjs/issues/detail?id=690#c9


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub.

Looks like he's already reproduced based on his last couple comments

I'm looking into dumping the poltergeist sequence into a .js file that can be run directly against phantomjs

On Dec 25, 2012, at 6:25 PM, Sam Granieri notifications@github.com wrote:

Repro?

On Dec 25, 2012, at 7:16 PM, Jon Leighton notifications@github.com wrote:

Can someone help ariya repro the issue? https://code.google.com/p/phantomjs/issues/detail?id=690#c9


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub.

@ariya

This comment has been minimized.

Show comment
Hide comment
@ariya

ariya Dec 26, 2012

@goosetav If that's available, it will significantly help my direct PhantomJS debugging!

ariya commented Dec 26, 2012

@goosetav If that's available, it will significantly help my direct PhantomJS debugging!

@goosetav

This comment has been minimized.

Show comment
Hide comment
@goosetav

goosetav Dec 27, 2012

i just committed a couple scripts that will reproduce the crash directly from PhantomJS to https://github.com/goosetav/true_type_bug

running phantomjs crash-phantom.js reproduces the bug

I also added a version of poltergeist's javascripts that disables the websocket and sends the commands directly. This may be generally useful for debugging poltergeist/phantomjs directly from the phantomjs cli -- I used this to track down the call sequence inside of poltergeist necessary to reproduce the crash

(cross posting to https://code.google.com/p/phantomjs/issues/detail?id=690 as well)

i just committed a couple scripts that will reproduce the crash directly from PhantomJS to https://github.com/goosetav/true_type_bug

running phantomjs crash-phantom.js reproduces the bug

I also added a version of poltergeist's javascripts that disables the websocket and sends the commands directly. This may be generally useful for debugging poltergeist/phantomjs directly from the phantomjs cli -- I used this to track down the call sequence inside of poltergeist necessary to reproduce the crash

(cross posting to https://code.google.com/p/phantomjs/issues/detail?id=690 as well)

@panozzaj panozzaj referenced this issue in thoughtbot/capybara-webkit Dec 27, 2012

Closed

I still get WebkitNoResponseError #181

@goosetav

This comment has been minimized.

Show comment
Hide comment
@goosetav

goosetav Dec 30, 2012

FYI - see last comments in http://code.google.com/p/phantomjs/issues/detail?id=690

Probable fix coming for this bug in PhantomJS 1.8.1

FYI - see last comments in http://code.google.com/p/phantomjs/issues/detail?id=690

Probable fix coming for this bug in PhantomJS 1.8.1

@ariya

This comment has been minimized.

Show comment
Hide comment
@ariya

ariya Jan 7, 2013

PhantomJS 1.8.1 is out: https://groups.google.com/d/topic/phantomjs/VhPYwDoEcc4/discussion.

Please have a look and verify that this does not cause the crash anymore. Thank you!

ariya commented Jan 7, 2013

PhantomJS 1.8.1 is out: https://groups.google.com/d/topic/phantomjs/VhPYwDoEcc4/discussion.

Please have a look and verify that this does not cause the crash anymore. Thank you!

@brendanstennett

This comment has been minimized.

Show comment
Hide comment
@brendanstennett

brendanstennett Jan 8, 2013

Verified. This does indeed fixed the problem.

Verified. This does indeed fixed the problem.

@walski

This comment has been minimized.

Show comment
Hide comment
@walski

walski Jan 8, 2013

weeeeeeeeeeeeeeeeee 💥 👏 👯 🎉 Awesome!

walski commented Jan 8, 2013

weeeeeeeeeeeeeeeeee 💥 👏 👯 🎉 Awesome!

@pfleidi

This comment has been minimized.

Show comment
Hide comment
@pfleidi

pfleidi Jan 10, 2013

Unfortunately, upgrading to phantomJS 1.8.1 didn't fix my problem.

I still get DeadClient errors every time I run this code:

  within(:css, "form#node-type-form") do
    fill_in("name", :with => content_type)
    fill_in("description", :with => description)
    click_button("edit-submit")
  end

The shell output using Ruby 1.8, Cucumber, Capybara (1.1.3), Poltergeist (1.0.2) and PhantomJS 1.8.1 looks like this:

      The PhantomJS client died while processing {"args":[2,3],"name":"click"} (Capybara::Poltergeist::DeadClient)
      (eval):2:in `send'
      (eval):2:in `click_button'
      ./features/step_definitions/content_creation_steps.rb:17
      ./features/step_definitions/content_creation_steps.rb:14:in `/^I create a content type named ["']([^"']+)["'] with description ["']([^"']+)["']$/'
      features/fivestar.feature:24:in `And I create a content type named "fivestar-01" with description "fivestar type"'

Here's a crashdump of phantomJS I obtained after it failed.

Update:

After setting the debug setting to true, I found out that a JS error is thrown:

  options = {
    :js_errors => false,
    :window_size => [1280, 768],
    :debug => true
  }
{"args"=>["http:/my.site/path"], "name"=>"visit"}
{"error"=>{"args"=>[[{"stack"=>"TypeError: 'undefined' is not an object (evaluating 'jQuery.timeago.settings')\n    at http://my.site/sites/all/modules/timeago/timeago.js?mgexlw:13", "message"=>"TypeError: 'undefined' is not an object (evaluating 'jQuery.timeago.settings')"}]], "name"=>"Poltergeist.JavascriptError"}}
Capybara::Poltergeist::JavascriptError
{"args"=>[".//body[contains(concat(' ', @class, ' '), ' logged-in ')]"], "name"=>"find"}
{"response"=>{"ids"=>[0], "page_id"=>1}}

It looks like the problem is gone after fixing it.

pfleidi commented Jan 10, 2013

Unfortunately, upgrading to phantomJS 1.8.1 didn't fix my problem.

I still get DeadClient errors every time I run this code:

  within(:css, "form#node-type-form") do
    fill_in("name", :with => content_type)
    fill_in("description", :with => description)
    click_button("edit-submit")
  end

The shell output using Ruby 1.8, Cucumber, Capybara (1.1.3), Poltergeist (1.0.2) and PhantomJS 1.8.1 looks like this:

      The PhantomJS client died while processing {"args":[2,3],"name":"click"} (Capybara::Poltergeist::DeadClient)
      (eval):2:in `send'
      (eval):2:in `click_button'
      ./features/step_definitions/content_creation_steps.rb:17
      ./features/step_definitions/content_creation_steps.rb:14:in `/^I create a content type named ["']([^"']+)["'] with description ["']([^"']+)["']$/'
      features/fivestar.feature:24:in `And I create a content type named "fivestar-01" with description "fivestar type"'

Here's a crashdump of phantomJS I obtained after it failed.

Update:

After setting the debug setting to true, I found out that a JS error is thrown:

  options = {
    :js_errors => false,
    :window_size => [1280, 768],
    :debug => true
  }
{"args"=>["http:/my.site/path"], "name"=>"visit"}
{"error"=>{"args"=>[[{"stack"=>"TypeError: 'undefined' is not an object (evaluating 'jQuery.timeago.settings')\n    at http://my.site/sites/all/modules/timeago/timeago.js?mgexlw:13", "message"=>"TypeError: 'undefined' is not an object (evaluating 'jQuery.timeago.settings')"}]], "name"=>"Poltergeist.JavascriptError"}}
Capybara::Poltergeist::JavascriptError
{"args"=>[".//body[contains(concat(' ', @class, ' '), ' logged-in ')]"], "name"=>"find"}
{"response"=>{"ids"=>[0], "page_id"=>1}}

It looks like the problem is gone after fixing it.

@ariya

This comment has been minimized.

Show comment
Hide comment
@ariya

ariya Jan 10, 2013

@pfleidi Your stack trace has not indicated the same TrueType font problem. However, if that still happens (again), feel free to open a new issue.

ariya commented Jan 10, 2013

@pfleidi Your stack trace has not indicated the same TrueType font problem. However, if that still happens (again), feel free to open a new issue.

@pfleidi

This comment has been minimized.

Show comment
Hide comment
@pfleidi

pfleidi Jan 10, 2013

@ariya Thanks. Here's the new issue: jonleighton#232

pfleidi commented Jan 10, 2013

@ariya Thanks. Here's the new issue: jonleighton#232

@jonleighton

This comment has been minimized.

Show comment
Hide comment
@jonleighton

jonleighton Jan 26, 2013

Contributor

This is fixed by PhantomJS 1.8.1. Closing.

Contributor

jonleighton commented Jan 26, 2013

This is fixed by PhantomJS 1.8.1. Closing.

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