PhantomJS exited unexpectedly with exit code -1073741819
gruntjs, jasmine, node.js, phantomjs, unit-testing
Solution
We are running AngularJS tests via jasmine and grunt, and had this very same problem. For us it turned out to be due to our custom $exceptionHandler function.
We were missing the `throw exception` line that is in the example handler. By not throwing the exception, the test would pass but it would randomly cause PhantomJS to crash.
This means that some of our tests were failing and we didn't know it!
Here's the sample handler from the $exceptionHandler documentation page:
angular.module('exceptionOverride', []).factory('$exceptionHandler', function () {
return function (exception, cause) {
exception.message += ' (caused by "' + cause + '")';
throw exception; // <--- This is important
};
});
So I'd look and see if you have custom exception handling too and are possibly missing the `throw exception` line. I hope it's as simple as that for you too!
Problem
I run a bunch of Jasmine specs with PhantomJS (via Grunt) on a Windows 7 PC, and I happen to get the following error: ``` Testing jasmine specs via phantom ...... Running PhantomJS...ERROR >> 0 [ '' ] Warning: PhantomJS exited unexpectedly with exit code -1073741819. Use --force to continue. Aborted due to warnings. ``` The error does not appear if I delete a bunch of tests; however I have no idea what causes the error. What I also find strange, it that it only occurs now and then. Any idea why this happens?