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

PhantomJS 1.7.0 hangs on Windows 8 #10845

Closed
mmanela opened this issue Oct 29, 2012 · 45 comments
Closed

PhantomJS 1.7.0 hangs on Windows 8 #10845

mmanela opened this issue Oct 29, 2012 · 45 comments

Comments

@mmanela
Copy link
Contributor

mmanela commented Oct 29, 2012

[email protected] commented:

When using PhantomJS 1.7.0 on Windows 8 the process never exists and will just hang.

What steps will reproduce the problem?

  1. From a cmd.exe prompt run phantomjs.exe -v
  2. It will print out 1.7.0 and hang
  3. Notice Ctrl-C doesn't do anything.

I am using the static Windows build of PhantomJS 1.7.0

Disclaimer:
This issue was migrated on 2013-03-15 from the project's former issue tracker on Google Code, Issue #845.
🌟   14 people had starred this issue at the time of migration.

@mmanela
Copy link
Contributor Author

mmanela commented Oct 29, 2012

[email protected] commented:

Looking into this further I am only able to reproduce this on two Windows 8 machines. On others it is working fine. I am still investigating what machine specific differences could cause this.

@vitallium
Copy link
Collaborator

[email protected] commented:

Can you create a crash dump when PhantomJS hangs?

You can do it by using ProcDump (http://technet.microsoft.com/en-us/sysinternals/dd996900)
Download it, run phantomjs, wait until phantomjs will hang, and then execute the following command to generate a crash dump:

procdump.exe -ma phantomjs

@mmanela
Copy link
Contributor Author

mmanela commented Oct 30, 2012

[email protected] commented:

Here is a link to the dump: http://sdrv.ms/TrmJSY
It was too big to attach.

@vitallium
Copy link
Collaborator

[email protected] commented:

I was unable to reproduce this issue on Win 8.

@billyzkid
Copy link

[email protected] commented:

I see the same behavior using Windows 8 RTM build. It runs my tests from the command line, then never exits.

@adriaanp
Copy link

[email protected] commented:

I'm having the same issue. With 1.6.1 it just crashes and with 1.7 it hangs. This on Windows 8 RTM

@vitallium
Copy link
Collaborator

[email protected] commented:

Interesting.
Unfortunately, I was unable to reproduce this on a clean installation.
Is there any special condition (or something else) that could help me to reproduce this issue?

@adriaanp
Copy link

[email protected] commented:

Trying to debug I am getting this error: "Unhandled exception at 0x74CFCE39 in phantomjs.exe: 0xC0000005: Access violation executing location 0x74CFCE39."

Not sure if this will help.

@vitallium
Copy link
Collaborator

[email protected] commented:

1.6.1 version has no error handling. It was introduced in 1.7.

Could you provide me a dump when 1.7 hangs?
You can find instructions in my comment #2 (http://code.google.com/p/phantomjs/issues/detail?id=845#c2)

@adriaanp
Copy link

[email protected] commented:

Sure here it is: http://sdrv.ms/WyaNgm

@billyzkid
Copy link

[email protected] commented:

You should be able to repro this issue using this:

https://github.com/billyzkid/phamine

Clone this small repository, cd into it, and then execute the following command:

lib\phantomjs-1.7.0-windows\phantomjs.exe src/phamine.coffee sample/SpecRunner.html

In my tests, everything works perfect on Windows 7 every time -- the tests run and PhantomJS exits correctly. On Windows 8, however, the tests runs correctly, but PhantomJS never exits, so I can't get my command prompt back.

@vitallium
Copy link
Collaborator

[email protected] commented:

Fail. I wasn't able to reproduce. PhantomJS exits normally.

@billyzkid
Copy link

[email protected] commented:

Weird. Maybe this is a sinister machine specific issue like Comment 1 suggests. It happens for me every time and I can't figure out a workaround and this is a pretty minimal example.

I will try on another Win8 machine. Can anyone else try?

@ariya
Copy link
Owner

ariya commented Dec 2, 2012

[email protected] commented:

I have the very same problem, but don't really know how to help in investigating the problem. 1.6.1 crashes every time, and 1.7.0 hangs every time.

@vitallium
Copy link
Collaborator

[email protected] commented:

You can help me by providing a crash dump when 1.7.0 hangs. See my comment #2 http://code.google.com/p/phantomjs/issues/detail?id=845#c2

@ariya
Copy link
Owner

ariya commented Dec 3, 2012

[email protected] commented:

OK, here's the dump:
https://dl.dropbox.com/u/7884905/Permanent/phantomjs_121203_094536.dmp

I used billyzkid's phamine example for creating it.

@vitallium
Copy link
Collaborator

[email protected] commented:

Thanks!
Quick analysis gave me that those hangs are caused by Nvidia drivers (specifically by nvinit.dll library). Very strange issue.

Did you have two graphical cards on machines, for example Intel and NVidia?

@adriaanp
Copy link

adriaanp commented Dec 3, 2012

[email protected] commented:

I can confirm. I have Intel HD and NVidia driver under device manager. When disabling NVidia driver it does not hang.

@vitallium
Copy link
Collaborator

[email protected] commented:

I'm assuming you need to try a new NVidia driver version :)

@billyzkid
Copy link

[email protected] commented:

I also have display adapters for both Intel HD Graphics and NVidia NVS 3100M. Here's what I've discovered.

a) Updating to the very latest NVidia driver did not fix the hang.

b) If I disable NVidia, then PhantomJS no longer hangs. If I re-enable NVidia, then it hangs again.

c) If NVidia is enabled, the hang will go away if I select "Integrated graphics" as the preferred graphics processor (NVidia Control Panel > Manage 3D Settings > Global Settings).

d) Surprisingly, if I select "High-performance NVidia processor", then the hang also goes way.

e) The only option that continues to hang is the default one ("Auto-select") which you would think would be the same as either c) or d) above.

So, it seems like this issue is caused by the auto-selection of a GPU.

@mmanela
Copy link
Contributor Author

mmanela commented Dec 8, 2012

[email protected] commented:

I can also confirm the same. I have both Intel and Nvidia drivers.

@ariya
Copy link
Owner

ariya commented Dec 17, 2012

[email protected] commented:

I don't think we can fix this. However, I'll make sure this is noted as Known Issues in the upcoming release notes.

 
Metadata Updates

  • Milestone updated: Release1.8 (was: ---)
  • Status updated: WontFix

@ariya ariya closed this as completed Dec 17, 2012
@ariya
Copy link
Owner

ariya commented Feb 9, 2013

[email protected] commented:

Same here: selecting "High-performance NVidia processor" helped resolving the issue (of PhantomJs 1.8.1 hanging).
OS: Windows 7 64 bit Ultimate.
CPU: Intel Core i7-3610QM (2.30GHz)(2.30GHz)
RAM: 8 GB

@intval
Copy link

intval commented May 16, 2013

What solved the issue for me is to permanently set the high performance adapter to be responsible for running phantomjs.

To do that:

  1. Go to phantomjs.exe folder. When installing via npm it's at
    C:\Users\USERNAME\AppData\Roaming\npm\node_modules\phantomjs\lib\phantom)
  2. Right click on the icon of phantomjs.exe and in the submenu of run with graphic processor select change default graphics processor. Image
  3. In the opened program, select again the phantomjs programm from the list (or browse to it) and set the nvidia graphics processor as the default processor to run it. Image

@evil-shrike
Copy link

Excuse me, but why the issue is closed? Changing video adapter manually is a suitable workaround indeed but definitely isn't a solution of the problem.

@jdreesen
Copy link

jdreesen commented Sep 4, 2013

It just took me several hours to find this solution for this nasty bug -.-
I have two graphic cards (intel & nvidia) and disabling auto select works.

It would be nice to add this solution to the FAQ or troubleshooting pages!

@alexquinn
Copy link

The workaround described above does not work for me as I do not have an option to set the preferred graphics adapter. I am using Win7 64-bit with an nVidia GT 630, as well as the integrated Intel video.

Screenshot: Context menu of phantomjs.exe
Screenshot: nVidia control panel global settings
Screenshot: Device manager

Is there an earlier version of PhantomJS that didn't have this problem?


FYI, I am trying PhantomJS for the first time. This bug makes all of the tutorials freeze in a bad way. Even Ctrl-C or Ctrl-Break won't unstick it. I have to kill it from Task Manager. PhantomJS is unusable for me. If this can't be fixed easily, would be possible to add a note to the tutorials, to avoid frustration in other new users of PhantomJS?

@DrTeit
Copy link

DrTeit commented Sep 10, 2013

Does anyone have a different solution to this? I can't expect all the developers on my team to do the Nvidia-fix when the maven build hangs.

@vitallium
Copy link
Collaborator

@DrTeit to resolve this issue we need more information (proc dumps). Since we can't reproduce it.
To get the proc dump of PhantomJS, follow this instructions:

You can do it by using ProcDump (http://technet.microsoft.com/en-us/sysinternals/dd996900)
Download it, run phantomjs, wait until phantomjs will hang, and then execute the following command to generate a crash dump:

procdump.exe -ma phantomjs

@alexquinn
Copy link

Here you go:
http://alexquinn.org/temp/phantomjs_130910_095118.dmp.bz2

I got that by running phantomjs -v in one window and then procdump -ma phantomjs in the other. My machine is Win7 64-bit. The problem happens 100% of the time on any use of PhantomJS.

Your help would be most appreciated!

@NKCSS
Copy link

NKCSS commented Sep 11, 2013

Same problem here; can not specify preferred adapter.

Tried setting the nVidia card as the only allowed CUDA CPU, Multi-display/mixed-GPU acceleration to Campatability performance modus, Power management to Maximum performance and Threaded optimization to Off, but it all didn't do anything for stopping this issue.

My machine has an Intel HD4000 and nVidia GT640 running Windows 8

@DeanMarkTaylor
Copy link

As per bug report #11661 I can confirm that is occurs on Windows 7 64-bit SP1.

I noted the following during testing, adjusting the following graphics settings had these results:

  • "Auto-select" - prevents exiting / process terminating
  • "High-performance NVIDIA processor" - works - allows process to exit
  • "Integrated Graphics"- works - allows process to exit

So I dare say it's the "detection" of the "most compatible processor" which might be at fault.

@ariya
Copy link
Owner

ariya commented Oct 8, 2013

@DeanMarkTaylor The "detection" part is a very useful information (not that we can fix it for now). Thank you!

@lavesh626
Copy link

I am also facing the phantomJS getting hanged issue. I am running phantomjs on 87 parallel microinstance servers which are programmed to get terminated once the phantomJS completes its action.

Now it works successfully for 59 servers while gets hanged on the 28 servers. I did checked the phantmJS comman that may be causing the issue but that was not the case. The phantomJS will not do anything and continue to be there till server terminated forcefully.

PS: I did checked for the graphics driver compatibility but the server is not having any graphics card.
Crashdump File : https://www.dropbox.com/s/zc5fjftexac4en7/phantomjs_131129_052913.dmp

@old9
Copy link

old9 commented Sep 29, 2014

I recently came up to this problem too, and it got fixed after I updated the NVIDIA driver (from 311.* to 340.52).

I didn't even touch the "High-performance" thing mentioned above, since there is no that option in the NVIDIA control panel at all (either in 311.* or in 340.52).

So if someone still gets stuck here, updating the driver might help.

@zhangjh
Copy link

zhangjh commented Aug 10, 2015

why my redhat machines also meet this problem?It doesn‘t have any Nvidia driver...
I use phantomjs under linux environment,and can not exit occasionally。
This is my server's GPU info:(lspci | grep -i vga)
00:02.0 VGA compatible controller: Cirrus Logic GD 5446

@realtebo
Copy link

Same problem on a ubuntu VPS.

Some infos:

root@cloudrino:~/dev# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 15.04
Release:        15.04
Codename:       vivid

PhantomJs has been installed via apt-get, not build from source. I cannot do it because a lot of errors during compile and I'm not able to resolve.

root@cloudrino:~/dev# phantomjs --version
1.9.0
root@cloudrino:~/dev# casperjs --version
1.1.0-beta3

@Woolworths
Copy link

This is not finished. I'm on a desktop and getting this bug.

@vitallium
Copy link
Collaborator

@Woolworths this issue fixed in 2.x version.

@evil-shrike
Copy link

This issue was fixed but in v2.1.1 Phantom starts to hang again. While 1.9.1 works fine.

@vitallium
Copy link
Collaborator

@evil-shrike could you please try 2.5 beta? You can grab it here https://dl.dropboxusercontent.com/u/30021413/phantomjs-2.5.0.beta-windows.zip

@evil-shrike
Copy link

@vitallium this one is hanging as well. I forgot to mentioned that I'm on Win10 1607.

@vitallium
Copy link
Collaborator

vitallium commented Dec 6, 2016

@evil-shrike have you tried the possible fix in this thread? If no, could you please describe your problem a bit more. May be attach the sample script. If yes, and it helped let me know.

@evil-shrike
Copy link

@vitallium I have only default video drivers so I can't make suggested tuning in drivers.
I had 1.9.1 working fine and just replaced it with the new one. It starts hanging.

I run Phantom via a Grunt's task which runs it via Node's spawn.
Something this:

var spawn = require('child_process').spawn;

var args = [
  "D:\\Work\\R-n-D\\XFW3_WebClient-tools\\grunt-croc-qunit\\phantomjs\\main.js",
  "C:\\Users\\SERGEI~1\\AppData\\Local\\Temp/1481044411499.705",
  "http://127.0.0.1:9002/tests-runner.html",
  "{}"
]
var child = spawn("phantomjs.exe", args);

I've tried on two different machines (both win10) Lenovo T520 (integrated video) and Dell desktop (two videos). It hangs in both cases.

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