_[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?
- From a cmd.exe prompt run phantomjs.exe -v
- It will print out 1.7.0 and hang
- 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.
:star2: 14 people had starred this issue at the time of migration.
_[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.
_[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
_[email protected] commented:_
Here is a link to the dump: http://sdrv.ms/TrmJSY
It was too big to attach.
_[email protected] commented:_
I was unable to reproduce this issue on Win 8.
_[email protected] commented:_
I see the same behavior using Windows 8 RTM build. It runs my tests from the command line, then never exits.
_[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
_[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?
_[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.
_[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)
_[email protected] commented:_
Sure here it is: http://sdrv.ms/WyaNgm
_[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.
_[email protected] commented:_
Fail. I wasn't able to reproduce. PhantomJS exits normally.
_[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?
_[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.
_[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
_[email protected] commented:_
OK, here's the dump:
https://dl.dropbox.com/u/7884905/Permanent/phantomjs_121203_094536.dmpI used billyzkid's phamine example for creating it.
_[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?
_[email protected] commented:_
I can confirm. I have Intel HD and NVidia driver under device manager. When disabling NVidia driver it does not hang.
_[email protected] commented:_
I'm assuming you need to try a new NVidia driver version :)
_[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.
_[email protected] commented:_
I can also confirm the same. I have both Intel and Nvidia drivers.
_[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_
_[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
What solved the issue for me is to permanently set the high performance adapter to be responsible for running phantomjs.
To do that:
C:\Users\USERNAME\AppData\Roaming\npm\node_modules\phantomjs\lib\phantom)run with graphic processor select change default graphics processor. ImageExcuse 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.
@evil-shrike we're keeping it closed to prevent creating duplicate issues. This issue is in my TODO list.
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!
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?
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.
@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
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!
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
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:
So I dare say it's the "detection" of the "most compatible processor" which might be at fault.
@DeanMarkTaylor The "detection" part is a very useful information (not that we can fix it for now). Thank you!
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
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.
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
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
This is not finished. I'm on a desktop and getting this bug.
@Woolworths this issue fixed in 2.x version.
This issue was fixed but in v2.1.1 Phantom starts to hang again. While 1.9.1 works fine.
@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
@Vitallium this one is hanging as well. I forgot to mentioned that I'm on Win10 1607.
@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.
@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.