Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Another fatal Windows exception 0xc0000005 #14020

Closed
kevinstubbs opened this issue Feb 19, 2016 · 55 comments
Closed

Another fatal Windows exception 0xc0000005 #14020

kevinstubbs opened this issue Feb 19, 2016 · 55 comments

Comments

@kevinstubbs
Copy link

http://www.msn.com works
https://www.msn.com doesn't work

var page = require('webpage').create();
page.open('https://www.msn.com', function(status) {
  console.log("Status: " + status);
  if(status === "success") {
    page.render('example.png');
  }
  phantom.exit();
});

Also, the bug reporting link ironically 404s.
http://phantomjs.org/bug-reporting.html

Fatal Windows exception, code 0xc0000005.
PhantomJS has crashed. Please read the bug reporting guide at
http://phantomjs.org/bug-reporting.html and file a bug report.

@vitallium
Copy link
Collaborator

OS?

@kevinstubbs
Copy link
Author

Windows 10 Enterprise. Version 1511 (OS Build 10586.104)

@jaguire
Copy link

jaguire commented Feb 23, 2016

I too have this same issue. I can reproduce this with the version example script. I can also reproduce it with just the phantom.exit(); line.

Tested with PhantomJS v2.1.1 on Win7 Enterprise, SP1, x64.

@vitallium
Copy link
Collaborator

I was unable to reproduce it. Let me think what we can do to solve this.

@aadhavi
Copy link

aadhavi commented Feb 26, 2016

I'm facing this issue too. Win7 Enterprise SP1 x64

@perrydillard
Copy link

+1
Same platform: Windows 7 Enterprise, SP1 x64
npm install -g phantomjs-prebuilt
phantomjs --version

Fatal Windows exception, code 0xc0000005.
PhantomJS has crashed. Please read the bug reporting guide at
http://phantomjs.org/bug-reporting.html and file a bug report.

If there is anything I can do to assist in fixing this problem?

@jaguire
Copy link

jaguire commented Mar 3, 2016

I can reproduce it without a script like @perrydillard too. Even --Help has the error at the end. Entering phantom.exit() from within the REPL also does it.

@ghost
Copy link

ghost commented Mar 9, 2016

+1
i am facing this issue with simple version check as well
below is the copy past

operating system: window7 64 bit

phantomjs --version
2.1.1
Fatal Windows exception, code 0xc0000005.
PhantomJS has crashed. Please read the bug reporting guide at

http://phantomjs.org/bug-reporting.html and file a bug report.

@ChadMC
Copy link

ChadMC commented May 2, 2016

I am also seeing this error on Win7 Enterprise 64 SP1, even when I just run --help or --version.

@zackw
Copy link
Collaborator

zackw commented May 2, 2016

According to MSDN, error code C0000005 means that the program accessed memory in some way it's not allowed to; basically the Windows equivalent of "segmentation fault". We should probably look into printing a friendlier error message, but that's not important right now.

A crash on startup, which is unreproducible on the machine used to build the software, smells to me like some sort of library compatibility problem. Anyone experiencing the problem -- is it possible for you to rebuild PhantomJS from source on the exact computer you mean to run it on, and see if that works? Follow the instructions here. It would also be interesting to know whether installing MSVC on that computer makes the problem disappear.

@vitiaaap29
Copy link

I am seeing the issue, when I use page.onCallback for do screenshot. Win7 Enterprise 64 SP1

@michelj90
Copy link

I solved this issue by removing phantomjs in NPM, after that i downloaded phantomjs 2.0.0 from the official website and added the bin folder to the PATH in windows.

@yauhen
Copy link

yauhen commented May 4, 2016

We have the same issue on one of developers PCs. Strange that it works on my pc with nearly the same configuration (windows 7 professional 64bit SP1). Only rollback to 2.0.0 helps. 2.1.1 fails on any activity: javascript, opening url anything. The most sad thing is that no more info (windows event log etc) except:
"PhantomJS exit code -1073741819: Fatal Windows exception, code 0xc0000005.
PhantomJS has crashed. Please read the bug reporting guide at
http://phantomjs.org/bug-reporting.html and file a bug report."

Update:
Finally cloned repository, installed everything for build, build locally (on my pc on which haven't problems before). Provide result to colleauge who had problems - now everything works. Strange thing that
python build.py (which as far as I could see generate release version) on my pc produce 48Mb file.
Which is almost 3 times more than 2.1.1 distributed package, but almost in sync wirth previous 2.0 binaries (47mb)

@entrptaher
Copy link

entrptaher commented May 11, 2016

This is a really serious bug. I was using casperjs, and it was closing without any msg. Then I had to restart the script.
Finally got a traceback on my 100+th attempt that said 00x000000005 or something. Searched it, and after trying for 30+ hours to find out why it happens, I suddenly found this page and feeling very stupid.
Btw, it happened in a digital ocean droplet, while my Windows 8.1 x64 was running the same script without any problem.

Got the problem on Ubuntu 14.04 x64 droplet
Tried Phantomjs 2.0.0 , Phantomjs 2.1.0
Even though I think the problem might be related to my code, I don't think I can do anything without further information.

@eyaldev
Copy link

eyaldev commented May 25, 2016

I have the same crash.
It seems to work fine when I comment out the phantom.exit() .
In fact calling phantom.exit() any time after loading a page, causes phantom to crash.

I am running from Windows7.

@windkh
Copy link

windkh commented Jun 9, 2016

Crash on Windows 7 Professional 64Bit SP1 using PhantomJS 2.1.1 on call to phantom.exit();

@danwid
Copy link

danwid commented Jun 25, 2016

crash on both windows 8 & windows 8.1 using phantomjs 2.1.1 in the middle of running test

@killyosaur
Copy link

+1
Windows 7 Enterprise, this happens when running Phantomjs through Visual Studio (via Resharper and Chutzpah, they both throw errors at the end of a run).

@WilliamHolmes
Copy link

Windows 7 x64 crashes after every run using
npm 3.8.6
"karma": "0.13.19",
"phantomjs-prebuilt": "2.1.7",
"phantomjs-polyfill": "0.0.2",

  captureTimeout: 10000,
  browserDisconnectTimeout : 30000,
  browserDisconnectTolerance : 10,
  browserNoActivityTimeout : 30000,

@konradish
Copy link

I checked the Application section of the Windows event logs and found the details:
Faulting application name: _uninstall5320, version: 5.1.0.26, time stamp: 0x4e981d6f
Faulting module name: nvinit.dll_unloaded, version: 0.0.0.0, time stamp: 0x506b31f3
Exception code: 0xc0000005
Fault offset: 0x73aace39
Faulting process id: 0x284c.

nvinit.dll is an Nvidia D3D shim driver. I tried running PhantomJS over remote desktop, and it didn't error out! So at least in my case, it has something to do with the GPU drivers.

I went into the device manager and rolled back the NVIDIA GeForce GT 630M drivers. After a reboot PhantomJS ran without error.

If you're running in to this issue, you may want to check your event viewer logs to get more details.

@sherkhan911
Copy link

I am facing the same issue, but only in the case I am trying to access an iframe in my tests.
Platform: Windows 10 Enterprise, on Intel Xeon E3-1270v5

Tried all of the above resolutions, still facing the issue:

  1. No event logs in eventvwr related to phantomjs,
  2. phantomjs reinstallation from outside of npm didn't solve the problem,

Is there anything else that someone tried and succeeded, in working around this issue?

@kimbaz
Copy link

kimbaz commented Jul 27, 2016

The problem can be solved building phantomjs as a native X64 Windows application.

@WilliamHolmes
Copy link

Has any managed to do that? I'm assuming phantomjs does not yet offer this library, if not, do you know of any futures plans?

@panuhorsmalahti
Copy link

I also got this:

02 08 2016 16:12:03.415:ERROR [phantomjs.launcher]: Fatal Windows exception, code 0xc0000005.

I'm using 64bit Windows 7.

@kimbaz
Copy link

kimbaz commented Aug 4, 2016

The problem is usually related to the memory limit associated to 32bit processes on Windows.
When phantomjs reaches that limit throws that exception.
This is why a 64bit build for Windows would solve the issue.

@rafalradomski
Copy link

phantomjs --version
2.1.1
Fatal Windows exception, code 0xc0000005.
PhantomJS has crashed. Please read the bug reporting guide at
http://phantomjs.org/bug-reporting.html and file a bug report.
/c/Users/.../AppData/Roaming/npm/phantomjs: line 14: 9772 Segmentation fault node "$basedir/node_modules/phantomjs/bin/phantomjs" "$@"

@rafalradomski
Copy link

in my case it was lack of memory, I made more space on hard drive and it's works

@Wanderduene
Copy link

Wanderduene commented Oct 13, 2016

We also get this error in our Unit-Tests, on some developer machines:
Fatal Windows exception, code 0xc0000005.

I could figure out, that it only appears when using the "karma-coverage" Plugin. When I remove it, it dosn't happen, and the Unit Tests pass through without a problem.

My machine: Windows 7 Enterprise x64
PhantomJS: 2.1.1 from the "phantomjs-prebuilt" Package 2.1.12
Karma: 1.3.0
karma-coverage: 1.1.1

Edit 20.10.2016:

Okay, it dosn't seems to have to do something with karma-coverage.
The crash appears now even without it :(

@ArmorDarks
Copy link

ArmorDarks commented Feb 4, 2017

Same issue here on Windows 10, and it also occasionally happens on our CircleCI instance.

@entrptaher
Copy link

I moved to nightmareJS and Electron since no one in phantomjs is really trying to do much regarding this issue even after 1 year. The only thing I found out was the memory leak was hogging the RAM and there was this error.

@gnitsenko93
Copy link

Same error on Windows 7 Enterprise. The saddest thing is still no additional information why it crashes.

@williamHYJ
Copy link

how to fix the issue??

@MateuszChilinski
Copy link

I am also having this issue. Any solution?

@WilliamHolmes
Copy link

Although we locally had some success on x64 platform, we eventually moved to Headless Chrome

@MateuszChilinski
Copy link

@WilliamHolmes
I think Headless Chrome is not supported by CasperJS which we are using :( Thanks for feedback though!

@entrptaher
Copy link

@MateuszChilinski The only way to solve this issue right now is to give up and move on to other automation tool or actively develop PhantomJS itself.

@MateuszChilinski
Copy link

Such a shame :( Know anything similar in syntax to CasperJS, so the migration would be not that painful? :)

@WilliamHolmes
Copy link

The other option is to create a x64 phantom build. This would address most memory issues.

@MateuszChilinski
Copy link

Hmm, I'll try that then. Thanks for the help William! :)

@entrptaher
Copy link

@MateuszChilinski, I switched to nightmareJS when this problem persisted, but now chromeless and puppetter came, which means we can do more.

@Nzha
Copy link

Nzha commented Aug 28, 2017

I had the same error message. I spent almost a day looking for a solution and then realized that the issue was a memory problem due to setting loadimages to false. I switched to true and no more problem. Hope this will help someone in the same situation.

@MateuszChilinski
Copy link

@Nzha I am afraid that it might not be the root cause for other cases, I used your solution and the problem still exists, also I have had by default loadimages to true(as I used screenshots and it was useful).

@Nzha
Copy link

Nzha commented Aug 29, 2017

@MateuszChilinski Sorry this solution didn't work for you. Have you tried using the 2.5 beta? You can find it here: https://bitbucket.org/ariya/phantomjs/downloads/

@MateuszChilinski
Copy link

@Nzha 2.5 beta indeed eliminated problems with this error, but the code stopped working as it should be :P Some problems with clicking buttons in my case, I couldn't resolve it for now. And beta2 does not work at all :(

@Ashwin2488
Copy link

Ashwin2488 commented Sep 7, 2017

In case you are testing some UI components and have an empty src attribute in your html template, it can crash your phantomJS instance. yes it can.
<img src ="" class="foo">

My error log:

07 09 2017 03:31:03.948:WARN [web-server]: 404: /xxxHTMLLINKxxx0.015839164328435240.7940623242762179xxx
PhantomJS 2.1.1 (Windows 8 0.0.0): Executed 1 of 39 SUCCESS (0 secs / 0.265 secs)
07 09 2017 03:31:04.014:ERROR [launcher]: PhantomJS crashed.

07 09 2017 03:31:04.017:ERROR [launcher]: PhantomJS stdout:

07 09 2017 03:31:04.018:ERROR [launcher]: PhantomJS stderr:

sometimes it showed fatal Windows exception 0xc0000005 along the crash.

changing the empty img tag to span worked.

@Webbrother
Copy link

The same issue. How to fix it?

@MateuszChilinski
Copy link

Well, if you read the topic, you will know the answer - there are a few fixes for that and each of them has its cost.

@xiaol825
Copy link

Guys, maybe you could try SlimerJS, it worked fine for me.

@stale
Copy link

stale bot commented Dec 28, 2019

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

@stale stale bot closed this as completed Dec 28, 2019
@xmax5
Copy link

xmax5 commented Oct 1, 2021

Моя ошибка возникла когда я создал переменную "sID" в самом начале файла:

var sID;

попытался обратиться к ней, к "sID", из "page.onUrlChanged":

page.onUrlChanged = function(targetUrl) {
if(targetUrl == config.request.auth.page.vk.mobile.condition) {
console.log(targetUrl);
clearInterval(sID);
phantom.exit();
};
};

а заполнил её, sID, содержимым в page.open:

page.open(address, function (status) {
sID = setInterval(function () {},5000);
});

когда убрал clearInterval(sID) и phantom.exit() из page.onUrlChanged, то ошибка исчезла.

@Hiti3
Copy link

Hiti3 commented Oct 6, 2021

Any solution on this??

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests