Skip to content

Crash Nodejs phantom-node phantomjs #11201

Identity-labs opened this Issue Apr 3, 2013 · 12 comments

4 participants


I use phantomjs with bridge for nodejs.

When I opening a web page on google :
I have a crash report, the dmp file is here:

I don't have a status or a console log err, function(err,status) {
    console.log("opened site: ", status);

Best regard


Being that there isn't any "phantom-node" NPM module, what is the actual NPM module name of the bridge you are using?

  • node-phantom
  • phantom (a.k.a. phantomjs-node)
  • phantom-proxy
  • phantomjs
  • phantomstream
  • grunt-lib-phantomjs
  • etc.

Sorry for the misunderstand, it's node-phantom, install by NPM.

After several test, I think the problem is an iframe in page, crash phantom.
I test several version, it's a same (1.7.0, 1.8.0, 1.8.2, 1.9.0)

Thanks for your time 👍

ariya commented Apr 14, 2013

Can you reduce this to a simple PhantomJS script which reproduces the issue?


I post code example here:


If I use phantomjs without nodejs, it's work correctly.
You have an idea of problem ?


I find the problem.
If css directive with this spécification.
On google search page

#gbql,#gbgsi,#gbgsa,.gbqfi,.gbmai,.gbp0i,.gbmppci,.gbqfh #gbql {
background-image: url('//');


If it still holds true that your script works fine when you use PhantomJS directly but fails when using the Node wrapper, then you should close this bug and just track the corresponding bug in node-phantom's issue tracker: alexscheelmeyer/node-phantom#59

If that is no longer true, please clarify the state of things. Thanks!


Hi! Author of node-phantom here. I have debugged this and found I can recreate it without the node wrapper also. Instead of it dumping a crash dump file though, I get this

RangeError: Maximum call stack size exceeded.


So perhaps some kind of infinite recursion?

Anyway this code below recreates this problem on my macbook.

var webpage=require('webpage');
var controlpage=webpage.create();

controlpage.content='<html><body><select>\n</select>\n<span style="background-image: url(;">crash</span>\n</body>\n</html>';

function setupPushNotifications(id, page) {
    var callbacks=['onAlert','onConfirm','onConsoleMessage','onError','onInitialized','onLoadFinished',
    function push(notification){
    callbacks.forEach(function(cb) {
            if((cb==='onResourceRequested')&&(parm.url.indexOf('data:image')===0)) return;

            push([id, cb, notification]);

@alexscheelmeyer There isn't a socket on that page, so it seems like your example code would throw errors.


I agree it would throw errors, but not the "Maximum call stack size exceeded" kind, right?

There is no socket because I tried to make the smallest amount of code that would recreate a problem.

On closer inspection it might not be the same problem I have have recreated though - seems to reach that call stack size regardless of the actual content that is set on the page now.


I have tried to debug this some more and I think if you really need to recreate it without the node-wrapper you need some other way of serving the code as it seems to be related to a combination of the given html-content and the setting up of callbacks (push notifications).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.