1

I'm trying to install Phantom JS, but it is not in the official Raspbian repository. I've found two people who pre-built binaries for the Raspberry Pi here and here, but when I follow the instructions and try to run phantomjs from the terminal (phantomjs --version or phantomjs --help), it just hangs. It prints no output to the terminal, and just hangs while eating up all the extra cpu cycles. Its memory remains low at about 3 mb, and free -h shows about 200 mb free ram (Running on 512 mb of which 48 mb is dedicated to the gpu). I've left it running for about an hour and nothing's changed, and I can't debug it because neither binary has debugging symbols.

I tried running apt-get update && apt-get dist-upgrade and rebooting, but the problem still persists. Any ideas?

EDIT: After following aeberhardo's build instructions, the binary produced still hangs upon initialization. But this binary at least has debugging symbols. The output from running the binary through gdb, waiting 10 minutes, and then pausing the program and dumping a stacktrace with gdb's bt command is:

(gdb) bt
#0  0xb6f1c1f4 in ?? () from /usr/lib/arm-linux-gnueabihf/libfontconfig.so.1
#1  0xb6f0ca68 in ?? () from /usr/lib/arm-linux-gnueabihf/libfontconfig.so.1
#2  0xb6f0ca68 in ?? () from /usr/lib/arm-linux-gnueabihf/libfontconfig.so.1
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

I tried building Phantomjs with a Ruby script from here. The resulting binary had the same problem. But I copied the file to another raspberry pi running the same Raspbian OS (although possibly a more up-to-date one), and it worked fine! I noticed a small discrepancy though in the binary's library dependencies:

Dependencies on first Pi (broken):

$ ldd ./phantomjs
/usr/lib/arm-linux-gnueabihf/libcofi_rpi.so (0xb6f3f000)
libicuuc.so.48 => /usr/lib/arm-linux-gnueabihf/libicuuc.so.48 (0xb6dfd000)
libfreetype.so.6 => /usr/lib/arm-linux-gnueabihf/libfreetype.so.6 (0xb6d7b000)
libfontconfig.so.1 => /usr/lib/arm-linux-gnueabihf/libfontconfig.so.1 (0xb6d46000)
libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb6d3b000)
librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0xb6d2c000)
libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb6d0d000)
libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0xb6c40000)
libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb6bcf000)
libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb6ba7000)
libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6a76000)
/lib/ld-linux-armhf.so.3 (0xb6f4d000)
libicudata.so.48 => /usr/lib/arm-linux-gnueabihf/libicudata.so.48 (0xb58fe000)
libz.so.1 => /lib/arm-linux-gnueabihf/libz.so.1 (0xb58e0000)
libexpat.so.1 => /lib/arm-linux-gnueabihf/libexpat.so.1 (0xb58b7000)

Dependencies on second Pi (working):

$ ldd ./phantomjs
libicuuc.so.48 => /usr/lib/arm-linux-gnueabihf/libicuuc.so.48 (0xb6e59000)
libfreetype.so.6 => /usr/lib/arm-linux-gnueabihf/libfreetype.so.6 (0xb6dd7000)
libfontconfig.so.1 => /usr/lib/arm-linux-gnueabihf/libfontconfig.so.1 (0xb6da2000)
libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb6d97000)
librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0xb6d88000)
libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb6d68000)
libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0xb6c9b000)
libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb6c2a000)
libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb6c02000)
libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6ad2000)
/lib/ld-linux-armhf.so.3 (0xb6f98000)
libicudata.so.48 => /usr/lib/arm-linux-gnueabihf/libicudata.so.48 (0xb5959000)
libz.so.1 => /lib/arm-linux-gnueabihf/libz.so.1 (0xb593b000)
libexpat.so.1 => /lib/arm-linux-gnueabihf/libexpat.so.1 (0xb5912000)

Notice they are identical except that the working version is missing a dependency to /usr/lib/arm-linux-gnueabihf/libcofi_rpi.so

libcofi_rpi.so exists and is identical on both Pis. I tried manually removing it on the first Pi, and Phantomjs still loaded (albeit with warning messages about how it couldn't find that dependency), but hung in exactly the same way.

1

Seems to be something corrupted as read about at http://www.raspberrypi.org/phpBB3/viewtopic.php?f=33&t=60540.

Have you tried reinstalling Raspbian (NOOBS and Without NOOBS) and redownloading and building Phantom?

  • Hmm. Perhaps a little different, as I already have libc6-dbg installed. I will try a fresh install of Raspbian, but I'll have to do it on a different Pi. One thing I've wondered, is do I still have to use rpi-update, or is that only for if I want the bleeding-edge firmware? – Ponkadoodle Feb 19 '14 at 9:30
  • You shouldnt need rpi-update unless there is a major re-release of the firmware – Zeusking19-Code Feb 19 '14 at 18:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.