Phantomjs: PhantomJS has crash

Created on 4 Jun 2016  路  8Comments  路  Source: ariya/phantomjs

  1. Which version of PhantomJS are you using? Tip: run phantomjs --version.
    2.1.1
  2. What steps will reproduce the problem?
    I'm using karma, webpack babel and react, it works for a few files but if I have too many (4 rather than 2) it dies in this way.
  3. Which operating system are you using?
    Mac OS X 10.11.5 - El Capitan
  4. Did you use binary PhantomJS or did you compile it from source?
    phantomjs-prebuilt
  5. Please provide any additional information below.

phantomjs_2016-06-03-160135_thaggie-mbp15.crash.txt

03 06 2016 16:01:35.733:ERROR [phantomjs.launcher]: PhantomJS has crashed. Please read the bug reporting guide at
<http://phantomjs.org/bug-reporting.html> and file a bug report.

03 06 2016 16:01:35.961:ERROR [launcher]: PhantomJS crashed.

03 06 2016 16:01:35.965:INFO [launcher]: Trying to start PhantomJS again (1/2).
03 06 2016 16:01:46.366:WARN [PhantomJS 2.1.1 (Mac OS X 0.0.0)]: Disconnected (1 times), PhantomJS 2.1.1 (Mac OS X 0.0.0): Executed 4 of 82 DISCONNECTED (10.676 secs / 0.01 secs)
stale

Most helpful comment

I just faced the same problem in a project based on mxstbr/react-boilerplate (it uses webpack). PhantomJS was only crashing when the server was running in dev mode. Commenting out devtool: 'cheap-module-eval-source-map' in webpack.dev.babel.js did the trick.

Seems like there is some glitch in PhantomJS, because the project opens without any problems in all browsers I'm testing it in.

All 8 comments

(Running on same OS, PJS version etc)

Can confirm that I have a similar crash when downloading WebPacked additional resources. Blacklisting the url of webpacked resource resolves the issue:

crash.js

Array.prototype.contains = function (v) {
    return this.indexOf(v) > -1;
};

var system = require('system');
var args = system.args;
var webPage = require('webpage');
var page = webPage.create();

var blackList = [
    "https://www.moneysupermarket.com/etc/designs/moneysupermarket-shop-cbd/bundle/shopbasepage.ab988182b2c59a3aa2cd6bd580dff7e8.js"
];
page.onResourceRequested = function (req, network) {
    console.log(req.id+" "+req.url);
    if(blackList.contains(req.url))
    {
        console.log("Blacklisted: "+req.url);
        network.abort();
        return false;
    }
}
page.onResourceError = function(resourceError) {
    console.log("[ERROR] "+resourceError.errorString);
}
console.log("Opening "+args[1]);
page.open(args[1], function(status) {
    console.log('Status: ' + status);
    phantom.exit();
});
phantomjs crash.js https://www.moneysupermarket.com/mortgages/results

Looks to be something specific to WebPack (http://webpack.github.io/)

I just faced the same problem in a project based on mxstbr/react-boilerplate (it uses webpack). PhantomJS was only crashing when the server was running in dev mode. Commenting out devtool: 'cheap-module-eval-source-map' in webpack.dev.babel.js did the trick.

Seems like there is some glitch in PhantomJS, because the project opens without any problems in all browsers I'm testing it in.

Can confirm that we see a lot of sporadic PhantomJS deaths when using one of the eval devtools in Webpack.

Both eval and inline-cheap-module-eval-source-map seem to be problematic. When not setting any devtool, the crashes stop.

This is after upgrading to PhantomJS 2.1.1. With 1.9, this issue was not present.

Also experiencing this issue with any of the eval sourcemap variants in Webpack config when using PhantomJS 2.1.7. A quick workaround was to set NODE_ENV before running any tests that used PhantomJS, and conditionally setting the devtool value to something that didn't cause issues. Would still be nice to not have to do this workaround.

Same here. Commenting out the devtool line in our webpack config fixed the sporadic PhantomJS crashes we were having.

The crash _might be_ originating in the QT WebSocket handling code. Try setting the Karma transports setting to _polling_ to disable the communication through WebSockets:

transports: ['polling']

Same here with devtool: 'eval-source-map' when trying to run Karma/Jasmine tests.

macOS: 10.12.5
webpack: 2.5.0
karma-phantomjs-launcher: 1.0.4
phantomjs-prebuilt: 2.1.14

Due to our very limited maintenance capacity, we need to prioritize our development focus on other tasks. Therefore, this issue will be automatically closed (see #15395 for more details). In the future, if we see the need to attend to this issue again, then it will be reopened. Thank you for your contribution!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dhilipsiva picture dhilipsiva  路  4Comments

bhuvnesh2703 picture bhuvnesh2703  路  3Comments

mz3 picture mz3  路  5Comments

maboiteaspam picture maboiteaspam  路  3Comments

julmot picture julmot  路  5Comments