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

PhantomJS crashes #11706

Closed
muktaa opened this issue Oct 25, 2013 · 36 comments
Closed

PhantomJS crashes #11706

muktaa opened this issue Oct 25, 2013 · 36 comments

Comments

@muktaa
Copy link

muktaa commented Oct 25, 2013

Hi,
I am trying to use phantomjs to work with images (canvas). But phantomjs sometimes give out of memory error and sometimes crashes. I want to send you a couple of dmp files, please let me know where I can email you, github does not support attachment of dmp files.
Please let me know the issue/fix soon.
Awaiting your prompt reply.
Thanks,
Mukta.

@muktaa
Copy link
Author

muktaa commented Oct 25, 2013

On Linux, I cannot find the dump file. It is not present in /tmp path.
On Windows, I have the dump file, but I see you dont have support to convert the dmp into stack trace.

ExceptionHandler::GenerateDump waitpid failed:No child processes
PhantomJS has crashed. Please read the crash reporting guide at https://github.com/ariya/phantomjs/wiki/Crash-Reporting and file a bug report at https://github.com/ariya/phantomjs/issues/new with the crash dump file attached: /tmp/555e7040-fa64-9932-77b8d9d6-4404a6f5.dmp
Segmentation fault (core dumped)

@samccone
Copy link

samccone commented Feb 5, 2014

+1

@cpjolicoeur
Copy link

+1 no point in listing a path to a dump file on linux when the file itself is empty

@al6x
Copy link

al6x commented Feb 12, 2014

Same bug Ubuntu 13.10 & PhantomJS 1.9.7

@dcherman
Copy link

Just encountered this on Raspbian / Debian Wheezy w/ PhantomJS 1.10.0 ( git )

@tigerfz
Copy link

tigerfz commented Feb 5, 2015

Program terminated with signal 11, Segmentation fault.
#0 0x000000362a47a1bc in free () from /lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install expat-2.0.1-9.1.el6.x86_64 fontconfig-2.8.0-3.el6.x86_64 freetype-2.3.11-6.el6_1.7.x86_64 glibc-2.12-1.47.el6.x86_64 keyutils-libs-1.4-3.el6.x86_64 krb5-libs-1.9-22.el6.x86_64 libcom_err-1.41.12-11.el6.x86_64 libgcc-4.4.6-3.el6.x86_64 libselinux-2.0.94-5.3.el6_4.1.x86_64 libstdc++-4.4.6-3.el6.x86_64 libthai-0.1.12-3.el6.x86_64 zlib-1.2.3-27.el6.x86_64
(gdb) bt
#0 0x000000362a47a1bc in free () from /lib64/libc.so.6
#1 0x00000000019d321a in QEventDispatcherUNIXPrivate::~QEventDispatcherUNIXPrivate() ()
#2 0x00000000019d32e9 in QEventDispatcherUNIXPrivate::~QEventDispatcherUNIXPrivate() ()
#3 0x00000000019c3daa in QObject::~QObject() ()
#4 0x00000000019d2149 in QEventDispatcherUNIX::~QEventDispatcherUNIX() ()
#5 0x00000000018c6cd8 in QThreadPrivate::finish(void_) ()
#6 0x00000000018c7879 in QThreadPrivate::start(void_) ()
#7 0x00007fa2c0f3d7f1 in start_thread () from /lib64/libpthread.so.0
#8 0x000000362a4e570d in clone () from /lib64/libc.so.6

@summanerd
Copy link

I work on a mac and it turns out fine local, on my ubuntu server phantom crashes. I am essentially creating a screenshot of a webpage

@a1Gupta
Copy link

a1Gupta commented Apr 4, 2015

Same issue on Ubuntu 14.04 & PhantomJS 1.9.7 . Is it corrected in PhantomJS 2.0 ?

@Batistleman
Copy link

I'm having the same problem, any updates on this?

@cmdrkeene
Copy link

+1 same issue

@dr-dimitru
Copy link

+1 and only on Debian 8 fetching https://uniq.site , which is fetched without crashing on Mac OSX
I've tested multiple other websites with canvas/SVG - all of them is fetched fine.

And it crashes right on page.open(), without a chance to log it status.
No crash report is created (I've checked /tmp):

PhantomJS has crashed. Please read the bug reporting guide at
<http://phantomjs.org/bug-reporting.html> and file a bug report.

Also, update from v2.0.0 to v2.1.1 - doesn't helped with this issue.

Can anyone from this thread try to page.open('https://uniq.site', function(){}), please?

@zackw
Copy link
Contributor

zackw commented Feb 18, 2016

No crash with development trunk on Debian unstable on x86-64. (Right now, development trunk is very nearly the same thing as 2.1.1.) I doubt this is an out-of-memory issue, but the computer I tested on does have 32GB of RAM.

@dr-dimitriu, please tell us whether you're on x86-64, -32, or something else, and how much RAM your computer has. Also, please try to construct a self-contained test case; uniq.site might've changed something that made the problem go away. See http://discuss.phantomjs.org/t/draft-troubleshooting-and-reporting-bugs-in-phantomjs/22 for a guide for doing that.

@dr-dimitru
Copy link

@zackw Thank you for quick response. Could you please post code you have used and phantomjs arguments, you've running on?

OS: Linux 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u3 (2016-01-17) x86_64 GNU/Linux (On top of Proxmox)
RAM: 29GB (8.3GB used)
Phantomjs process RAM usage: 0.1%

As I wrote previously - There is no issues on dev stage (Mac OSX 16GB i7), but on production it appears. Is there something I can work around with .openUrl() instead of .open()? Unfortunately docs is not expressive at all.

@dr-dimitru
Copy link

BTW: My running phantomjs flags:

phantomjs --load-images=true --ssl-protocol=tlsv1 --ignore-ssl-errors=true --disk-cache=true --debug=true --web-security=false

I've played with them all, and without them. - No luck

@zackw
Copy link
Contributor

zackw commented Feb 19, 2016

I did

$ cat test.js
var page = require('webpage').create();
page.open('https://uniq.site', function(s){console.log(s);phantom.exit(0);});
$ ./bin/phantomjs test.js ; echo $?
success
0

With your options I get a whole lot of debug spew mostly having to do with cookies, but there is no error.

@dr-dimitru
Copy link

  1. Phantomjs 2.1.1, right?
  2. Pre-build or compiled version?

I've got new errors, never seen before (any idea?):

1   0x1b67967 phantomjs() [0x1b67967]
2   0x1b91e92 phantomjs() [0x1b91e92]
3   0x1b91f58 phantomjs() [0x1b91f58]
4   0x1aa48a0 phantomjs() [0x1aa48a0]
5   0x188f2a5 phantomjs() [0x188f2a5]
6   0x188fad5 phantomjs() [0x188fad5]
7   0x1aad842 phantomjs() [0x1aad842]
8   0x1892c94 phantomjs() [0x1892c94]
9   0x22f8909 phantomjs() [0x22f8909]
10  0x4ac3bc phantomjs() [0x4ac3bc]
11  0x4b0000 phantomjs() [0x4b0000]
12  0x22d1036 phantomjs() [0x22d1036]
13  0x231633c phantomjs() [0x231633c]
14  0x23146e0 phantomjs() [0x23146e0]
15  0x1bbf4b5 phantomjs() [0x1bbf4b5]
16  0x22cf7a9 phantomjs() [0x22cf7a9]
17  0x22d4585 phantomjs() [0x22d4585]
18  0x415b9a phantomjs() [0x415b9a]
19  0x7f785f7fab45 /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7f785f7fab45]
20  0x4176a1 phantomjs() [0x4176a1]
PhantomJS has crashed. Please read the bug reporting guide at
<http://phantomjs.org/bug-reporting.html> and file a bug report.

And again no bug report, is there any way to turn it on?

@dr-dimitru
Copy link

@zackw Thank you for your help.
I've figured out what all errors comes under all users but not root. I don't know how to fix it yet.
I think I should create specific user for phantomjs only. Could you point me onto which files, folders and bins is used while phantomjs is running?

@dr-dimitru
Copy link

@zackw thank you again for your help.
After three days and nights (finally!):

  1. Stupid (as always) issue was caused by permissions and users (my user has nologin)
  2. Fixed via chown -R root:root /app/dir and chmod -R 755 /app/dir
  3. Application still running as special user, but have access and can execute everything inside /app/dir (running as nobody)

Hope this may help to someone too.
BTW: Still idk why I can't run phantomjs as nologin users, at this very special case: page.open('https://uniq.site'), hope someone can tell me why this happens.

@zackw
Copy link
Contributor

zackw commented Feb 19, 2016

My tests were done with 2.1.1, compiled myself.

Crash reporting was removed from 2.1.1 because it is almost always useless to us. You can see the problem in the stack trace (presumably from 1.9.x?) you posted - that tells us absolutely nothing meaningful.

If changing file system permissions fixes the problem, then it would be helpful to know which file it assumed it could read. You can find that out by putting the permissions back the way they were, and then running

$ strace -o /tmp/pjs-strace.log phantomjs [... arguments ...]
$ grep -e '-1 E' /tmp/pjs-strace.log | tail -10

Post the output of the grep. This will print out the last ten failing system calls that phantomjs made before it crashed, and that will probably tell us the name of the file it couldn't access. I might need to see the entire pjs-strace.log but let's start with this.

@dr-dimitru
Copy link

@zackw I'll be back with this issue in 24 hours. Sorry, afk

@dr-dimitru
Copy link

Okay (I've access to ssh), last 30 - 40 lines is same:

access("/home/phantom/.local/share/Ofi Labs/PhantomJS/ApplicationCache.db-journal", F_OK) = -1 ENOENT (No such file or directory)
access("/home/phantom/.local/share/Ofi Labs/PhantomJS/ApplicationCache.db-wal", F_OK) = -1 ENOENT (No such file or directory)

Here is last 200 lines (with omitted similar lines):

....
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
stat("/home/phantom/.config/QtProject/qtlogging.ini", 0x7ffca0c4ef90) = -1 ENOENT (No such file or directory)
stat("/etc/xdg/QtProject/qtlogging.ini", 0x7ffca0c4ef90) = -1 ENOENT (No such file or directory)
stat("/usr/bin/qt.conf", 0x7ffca0c4ed80) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/tls/x86_64/libCSUNSAPI.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/x86_64-linux-gnu/tls/x86_64", 0x7ffca0c4e8c0) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/tls/libCSUNSAPI.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/x86_64-linux-gnu/tls", 0x7ffca0c4e8c0) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/x86_64/libCSUNSAPI.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/x86_64-linux-gnu/x86_64", 0x7ffca0c4e8c0) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libCSUNSAPI.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64-linux-gnu/tls/x86_64/libCSUNSAPI.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/x86_64-linux-gnu/tls/x86_64", 0x7ffca0c4e8c0) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64-linux-gnu/tls/libCSUNSAPI.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/x86_64-linux-gnu/tls", 0x7ffca0c4e8c0) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64-linux-gnu/x86_64/libCSUNSAPI.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/x86_64-linux-gnu/x86_64", 0x7ffca0c4e8c0) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64-linux-gnu/libCSUNSAPI.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib/tls/x86_64/libCSUNSAPI.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/tls/x86_64", 0x7ffca0c4e8c0) = -1 ENOENT (No such file or directory)
open("/lib/tls/libCSUNSAPI.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/tls", 0x7ffca0c4e8c0)        = -1 ENOENT (No such file or directory)
open("/lib/x86_64/libCSUNSAPI.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/x86_64", 0x7ffca0c4e8c0)     = -1 ENOENT (No such file or directory)
open("/lib/libCSUNSAPI.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/tls/x86_64/libCSUNSAPI.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/tls/x86_64", 0x7ffca0c4e8c0) = -1 ENOENT (No such file or directory)
open("/usr/lib/tls/libCSUNSAPI.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/tls", 0x7ffca0c4e8c0)    = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64/libCSUNSAPI.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/x86_64", 0x7ffca0c4e8c0) = -1 ENOENT (No such file or directory)
open("/usr/lib/libCSUNSAPI.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libswift.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64-linux-gnu/libswift.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib/libswift.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/libswift.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libnfhwcrhk.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64-linux-gnu/libnfhwcrhk.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib/libnfhwcrhk.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/libnfhwcrhk.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libSureWareHook.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64-linux-gnu/libSureWareHook.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib/libSureWareHook.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/libSureWareHook.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/ssl", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/local/ssl", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/var/ssl/certs", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/local/ssl/certs", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/openssl/certs", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/opt/openssl/certs", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/etc/pki/tls/certs/ca-bundle.crt", 0x7ffca0c4f000) = -1 ENOENT (No such file or directory)
lstat("/etc/pki", 0x7ffca0c4ed20)       = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/pki/tls/certs", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/local/share/certs/ca-root-nss.crt", 0x7ffca0c4f000) = -1 ENOENT (No such file or directory)
lstat("/usr/local/share/certs", 0x7ffca0c4ed20) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/local/share/certs", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/home/phantom/.config/fontconfig/conf.d", 0x7ffca0c4af00) = -1 ENOENT (No such file or directory)
stat("/home/phantom/.config/fontconfig/conf.d", 0x7ffca0c4af00) = -1 ENOENT (No such file or directory)
access("/home/phantom/.config/fontconfig/conf.d", R_OK) = -1 ENOENT (No such file or directory)
access("/home/phantom/.config/fontconfig/conf.d", R_OK) = -1 ENOENT (No such file or directory)
stat("/home/phantom/.config/fontconfig/fonts.conf", 0x7ffca0c4af00) = -1 ENOENT (No such file or directory)
stat("/home/phantom/.config/fontconfig/fonts.conf", 0x7ffca0c4af00) = -1 ENOENT (No such file or directory)
access("/home/phantom/.config/fontconfig/fonts.conf", R_OK) = -1 ENOENT (No such file or directory)
access("/home/phantom/.config/fontconfig/fonts.conf", R_OK) = -1 ENOENT (No such file or directory)
access("/home/phantom/.fonts.conf.d", R_OK) = -1 ENOENT (No such file or directory)
access("/home/phantom/.fonts.conf.d", R_OK) = -1 ENOENT (No such file or directory)
access("/home/phantom/.fonts.conf", R_OK) = -1 ENOENT (No such file or directory)
access("/home/phantom/.fonts.conf", R_OK) = -1 ENOENT (No such file or directory)
access("/etc/fonts/local.conf", R_OK)   = -1 ENOENT (No such file or directory)
access("/etc/fonts/local.conf", R_OK)   = -1 ENOENT (No such file or directory)
stat("/usr/X11R6/lib/X11/fonts", 0x7ffca0c4ebf0) = -1 ENOENT (No such file or directory)
stat("/usr/X11R6/lib/X11/fonts", 0x7ffca0c4ec60) = -1 ENOENT (No such file or directory)
stat("/home/phantom/.local/share/fonts", 0x7ffca0c4ebf0) = -1 ENOENT (No such file or directory)
stat("/home/phantom/.local/share/fonts", 0x7ffca0c4ec60) = -1 ENOENT (No such file or directory)
stat("/home/phantom/.fonts", 0x7ffca0c4ebf0) = -1 ENOENT (No such file or directory)
stat("/home/phantom/.fonts", 0x7ffca0c4ec60) = -1 ENOENT (No such file or directory)
stat("/home/phantom/.local/share/mime/mime.cache", 0x7ffca0c4d5f0) = -1 ENOENT (No such file or directory)
stat("/usr/local/share/mime/mime.cache", 0x7ffca0c4d5f0) = -1 ENOENT (No such file or directory)
stat("/home/phantom/.local/share/mime/types", 0x7ffca0c4d5f0) = -1 ENOENT (No such file or directory)
stat("/usr/local/share/mime/types", 0x7ffca0c4d5f0) = -1 ENOENT (No such file or directory)
futex(0x7fdcd86e3d44, FUTEX_WAIT_PRIVATE, 1, NULL) = -1 EAGAIN (Resource temporarily unavailable)
mkdir("/home", 0777)                    = -1 EEXIST (File exists)
mkdir("/home/phantom", 0777)            = -1 EEXIST (File exists)
mkdir("/home/phantom/.cache", 0777)     = -1 EEXIST (File exists)
mkdir("/home/phantom/.cache/Ofi Labs", 0777) = -1 EEXIST (File exists)
mkdir("/home/phantom/.cache/Ofi Labs/PhantomJS", 0777) = -1 EEXIST (File exists)
mkdir("/home/phantom/.cache/Ofi Labs/PhantomJS/prepared", 0777) = -1 EEXIST (File exists)
mkdir("/home", 0777)                    = -1 EEXIST (File exists)
mkdir("/home/phantom", 0777)            = -1 EEXIST (File exists)
mkdir("/home/phantom/.cache", 0777)     = -1 EEXIST (File exists)
mkdir("/home/phantom/.cache/Ofi Labs", 0777) = -1 EEXIST (File exists)
mkdir("/home/phantom/.cache/Ofi Labs/PhantomJS", 0777) = -1 EEXIST (File exists)
mkdir("/home/phantom/.cache/Ofi Labs/PhantomJS/data8", 0777) = -1 EEXIST (File exists)
mkdir("/home/phantom/.cache/Ofi Labs/PhantomJS/data8/0", 0777) = -1 EEXIST (File exists)
....
mkdir("/home/phantom/.cache/Ofi Labs/PhantomJS/data8/f", 0777) = -1 EEXIST (File exists)
mkdir("/home", 0777)                    = -1 EEXIST (File exists)
mkdir("/home/phantom", 0777)            = -1 EEXIST (File exists)
mkdir("/home/phantom/.cache", 0777)     = -1 EEXIST (File exists)
mkdir("/home/phantom/.cache/Ofi Labs", 0777) = -1 EEXIST (File exists)
mkdir("/home/phantom/.cache/Ofi Labs/PhantomJS", 0777) = -1 EEXIST (File exists)
mkdir("/home/phantom/.cache/Ofi Labs/PhantomJS/prepared", 0777) = -1 EEXIST (File exists)
mkdir("/home", 0777)                    = -1 EEXIST (File exists)
mkdir("/home/phantom", 0777)            = -1 EEXIST (File exists)
mkdir("/home/phantom/.cache", 0777)     = -1 EEXIST (File exists)
mkdir("/home/phantom/.cache/Ofi Labs", 0777) = -1 EEXIST (File exists)
mkdir("/home/phantom/.cache/Ofi Labs/PhantomJS", 0777) = -1 EEXIST (File exists)
mkdir("/home/phantom/.cache/Ofi Labs/PhantomJS/data8", 0777) = -1 EEXIST (File exists)
mkdir("/home/phantom/.cache/Ofi Labs/PhantomJS/data8/0", 0777) = -1 EEXIST (File exists)
....
mkdir("/home/phantom/.cache/Ofi Labs/PhantomJS/data8/f", 0777) = -1 EEXIST (File exists)
mkdir("/home", 0777)                    = -1 EEXIST (File exists)
mkdir("/home/phantom", 0777)            = -1 EEXIST (File exists)
mkdir("/home/phantom/.local", 0777)     = -1 EEXIST (File exists)
mkdir("/home/phantom/.local/share", 0777) = -1 EEXIST (File exists)
mkdir("/home/phantom/.local/share/Ofi Labs", 0777) = -1 EEXIST (File exists)
mkdir("/home/phantom/.local/share/Ofi Labs/PhantomJS", 0777) = -1 EEXIST (File exists)
access("/home/phantom/.local/share/Ofi Labs/PhantomJS/ApplicationCache.db-journal", F_OK) = -1 ENOENT (No such file or directory)
access("/home/phantom/.local/share/Ofi Labs/PhantomJS/ApplicationCache.db-wal", F_OK) = -1 ENOENT (No such file or directory)
...all same lines to the bottom...

@zackw
Copy link
Contributor

zackw commented Feb 19, 2016

Drat, I think I need to see the entire file. It's probably huge, so please gzip and then attach it. Also, did it crash? The log won't tell me anything useful if it didn't crash.

@dr-dimitru
Copy link

Yes, it is crashed with same behaviour, as described above:

And it crashes right on page.open(), without a chance to log it status.

pjs-trace.tar.gz

@zackw
Copy link
Contributor

zackw commented Feb 19, 2016

Huh, there isn't a single permissions error anywhere in there. It looks more like "ApplicationCache" is corrupted. (It's possible that the corruption happened because of earlier permissions problems.)

Please tar up and attach the contents of /home/phantom/.local/share/Ofi Labs/. Then rename that directory out of the way, re-run your test script, and see if it crashes again.

@dr-dimitru
Copy link

To make it clear - I'm using precompiled version
But same error was on 2.0.0 compiled from sources.

there isn't a single permissions error anywhere in there

But somehow it depends.
ofi-labs.tar.gz

@zackw
Copy link
Contributor

zackw commented Feb 19, 2016

Unfortunately I have to get back to the day job now and may not have time to look at this any more for several days. But I have some leads to investigate, and thanks for your help so far.

@dr-dimitru
Copy link

Okay (and I'm going to take a nap). Let me know if you will have any idea so far. BTW maybe I should just compile it (not a big deal for me)?

We've solved the uniq.site issue, but I'm still getting bunch of those:

1   0x1b67967 phantomjs() [0x1b67967]
2   0x1b91e92 phantomjs() [0x1b91e92]
3   0x1b91f58 phantomjs() [0x1b91f58]
4   0x1833cb0 phantomjs() [0x1833cb0]
5   0x183ce9e phantomjs() [0x183ce9e]
6   0x18334f6 phantomjs() [0x18334f6]
7   0x183ce9e phantomjs() [0x183ce9e]
8   0x1aa4866 phantomjs() [0x1aa4866]
9   0x188f2a5 phantomjs() [0x188f2a5]
10  0x188fad5 phantomjs() [0x188fad5]
11  0x1aad842 phantomjs() [0x1aad842]
12  0x1892c94 phantomjs() [0x1892c94]
13  0x22f8909 phantomjs() [0x22f8909]
14  0x4ac3bc phantomjs() [0x4ac3bc]
15  0x4b0000 phantomjs() [0x4b0000]
16  0x22d1036 phantomjs() [0x22d1036]
17  0x231633c phantomjs() [0x231633c]
18  0x23146e0 phantomjs() [0x23146e0]
19  0x1bbf4b5 phantomjs() [0x1bbf4b5]
20  0x22cf7a9 phantomjs() [0x22cf7a9]
21  0x22d4585 phantomjs() [0x22d4585]
22  0x415b9a phantomjs() [0x415b9a]
23  0x7f3a7bb10b45 /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7f3a7bb10b45]
24  0x4176a1 phantomjs() [0x4176a1]
PhantomJS has crashed. Please read the bug reporting guide at
<http://phantomjs.org/bug-reporting.html> and file a bug report.

Note: currently I'm running 4 processes of phantomjs, and they are renders around 4,500 pages / hour.

@dr-dimitru
Copy link

After some monitoring, only next error appears to be related to pjs crashes:

/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5)
# and:
/lib/x86_64-linux-gnu/libpthread.so.0(+0x80a4)
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)

@dr-dimitru
Copy link

Hi there, any news on your end?
After googling (and some research) it appears what local compiling should fix those issues

@dr-dimitru
Copy link

Hi @zackw , just want to let you know:
I've compiled phantomjs 2.1.1 locally. No changes. Still getting same crashes.

@zackw
Copy link
Contributor

zackw commented Feb 21, 2016

I maybe should have been clearer about "I have to get back to the day job now and may not have time to look at this any more for several days". I meant "I won't be doing any PhantomJS work at all until March." Sorry.

@dr-dimitru
Copy link

@zackw okay ))
I hope you don't mind, if I just will keep updating this thread with my progress around this issue.

@dr-dimitru
Copy link

I've found a solution.
Errors described above is caused by memory leaks in V8.

Due to some technical limitations, the web page object might not be completely garbage collected. This is often encountered when the same object is used over and over again

  1. Run process as nobody
  2. Add undocumented --disk-cache-path=;
  3. Add access to specified disk-cache-path for nobody user
  4. My solution is running as web server module, and even calling close() after rendering page is not freeing all allocated memory. So after every 100 requests I'm simply exiting (phantom.exit(-1)) phantom process. And starting it again in parent process (which initiated via spawn) on exit event.

@aril-spetalen
Copy link

Okay, @dr-dimitru,
I'm happy you found a work around. But it looks somewhat hacky, and I'd like to have a more permanent solution to my test framework. Right now, I get very frequent phantomJS crashes, which are blocking my CI from producing new product releases..
So, at end of September, there is still no one who has found a solution to this issue?
Cheers,
Aril

@dr-dimitru
Copy link

@aril-spetalen

I've built a PhantomJS factory where is dozen of PhantomJS servers is ready for incoming request, and if it fails - request will be handled by other instance, while failed instance is restarting.

This issue was discussed with main maintainer - there is no fix to it, as it bug of V8 not PhantomJS.

@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
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