Distributions: v0.10.33 segfaults on Raspberry Pi with Raspbian Wheezy (2014-09-09)

Created on 6 Dec 2014  Â·  23Comments  Â·  Source: nodesource/distributions

I followed the Debian and Ubuntu based Linux distributions instructions.

When I run node or npm a segmentation fault occurs.

pi@raspberrypi ~ $ node -v
Segmentation fault
pi@raspberrypi ~ $ npm -v
Segmentation fault

GDB output:

pi@raspberrypi ~ $ gdb /usr/bin/node
GNU gdb (GDB) 7.4.1-debian
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabihf".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/node...(no debugging symbols found)...done.
(gdb) r
Starting program: /usr/bin/node 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x001e8fd2 in DES_xcbc_encrypt ()
(gdb) bt
#0  0x001e8fd2 in DES_xcbc_encrypt ()
(gdb) 

Install output:

pi@raspberrypi ~ $ sudo apt-get install nodejs
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  rlwrap
The following NEW packages will be installed:
  nodejs rlwrap
0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
Need to get 0 B/5,671 kB of archives.
After this operation, 17.6 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Selecting previously unselected package rlwrap.
(Reading database ... 78080 files and directories currently installed.)
Unpacking rlwrap (from .../rlwrap_0.37-3_armhf.deb) ...
Selecting previously unselected package nodejs.
Unpacking nodejs (from .../nodejs_0.10.33-2nodesource1~wheezy1_armhf.deb) ...
Processing triggers for man-db ...
Setting up rlwrap (0.37-3) ...
update-alternatives: using /usr/bin/rlwrap to provide /usr/bin/readline-editor (readline-editor) in auto mode
Setting up nodejs (0.10.33-2nodesource1~wheezy1) ...

Ran a sudo apt-get update && sudo apt-get upgrade before node setup/install.

Most helpful comment

The instructions supplied by @rvagg don't seem to work on a full Jessie build as opposed to the light version working as reported by @aburgd.

Also, @dmiddlecamp, I'm presumably being stupid, but how did you install from that tarball? The readme says to do ./configure, but there is no configure or makefile or anything :s

Edit: Oh, that was a stupid question :) just needs putting into /usr/local. For anyone else that this might be helpful for,

wget http://nodejs.org/dist/v4.2.4/node-v4.2.4-linux-armv6l.tar.gz
cd usr/local
sudo tar xzvf ~/node-v4.2.4-linux-armv6l.tar.gz --strip=1

This goes and gets node v4.2.4 using wget and puts it in the home folder, changes to usr/local where we want to put node so we can call it from the command line using "node", and then uncompresses the archive. The strip command is to stop it from being uncompresses into a folder called "node-v4.2.4-linux-armv6l.tar.gz".

All 23 comments

Unfortunately this is because RaspPi is ARMv6 while the 'armhf' Debian distro is for ARMv7 and above. We need to have an arch check in the setup script to make sure this is stated at install time.

What we probably need to do is have a separate Raspbian-compatible build for RPI, it's not straight-forward unfortunately but we'll look in to it.

@rvagg thanks, let me know if there's anything I can help out with.

Hey @rvagg, I'm having the same segfault problem. Thanks for working on this

Same problem here, crashing at least up to 0.11.14-1nodesource1~wheezy1

Could we get a more current build of 0.11 that contains the fix mentioned in https://github.com/nodesource/distributions/issues/44?

@andig
For now I've fixed the problem by compiling node from source. Just change the numbers to the version you want.
http://shapeshed.com/compiling-nodejs-from-source-on-ubuntu-10-04/

just to remind - the problem is still here

I don't believe we can build armv6 binaries through our standard deb builder setup but it might be practical to maintain a completely separate channel for raspbian.

To try out a test setup I've made, remove the nodesource entries from /etc/apt/sources.list and do the following:

sudo apt-get remove nodejs
sudo su -c 'echo "deb https://deb.nodesource.com/armv6l-node/ weezy main" >> /etc/apt/sources.list'
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add -
sudo apt-get update
sudo apt-get install nodejs

Don't count on this working forever, I'll need to discuss this with @chrislea and make sure we can keep things consistent.

If it stops working, come back here and chat.

thanks

@rvagg thanks! Works on my RPi!

Will the instructions be added to the nodesource/distributons read me or Installing Node.js via package manager wiki page?

@sandeepmistry it'll be bundled into the setup script for all .deb-based distributions so you'll run the standard command used by ubuntu and debian (listed on that page and in the README of this repo). I just need to make some changes and test. It'll have to do a uname -a to find armv6l to differentiate it from vanilla weezy which is the problem now (i.e. no differentiation).

Doesn't work for me. @rvagg, Any other solution now?

By the way, Adafruit has their own builds for Node.js. See: https://learn.adafruit.com/node-embedded-development/installing-node-dot-js

@enzanki-ars Node works fine on Adafruit's repo, but do you know if they have anything for npm?

When you install node from adafruit, it also installs npm.

I got the same problem due to follow the instruction
by DougieLawson » Wed Mar 04, 2015 6:50 pm
On a Raspberry Pi 2B use
curl -sL https://deb.nodesource.com/setup | sudo bash -
sudo apt-get install -y build-essential python-dev python-rpi.gpio nodejs

Just a note here, if you're looking for good binaries for armv6 platforms, io.js comes with binaries that are now built on wheezy: https://iojs.org/dist/latest/

Thanks.

On Sat, Jul 4, 2015 at 6:59 AM, Rod Vagg [email protected] wrote:

Just a note here, if you're looking for good binaries for armv6 platforms,
io.js comes with binaries that are now built on wheezy:
https://iojs.org/dist/latest/

—
Reply to this email directly or view it on GitHub
https://github.com/nodesource/distributions/issues/44#issuecomment-118504254
.

just hit this again... from instructions here trying to install 4.x - https://nodejs.org/en/download/package-manager/

Please look here at the bottom. We don't currently support ARM builds on old Debian / Ubuntu distros due to compiler toolchain issues.

I was using the latest Jessie raspbian on a Pi B+ v1.2 when I hit the segfault issue:

screen shot 2015-12-16 at 11 01 09 am

Fixed by grabbing https://nodejs.org/dist/v4.2.3/node-v4.2.3-linux-armv6l.tar.gz

Using the source that @rvagg posted worked for me on DietPi Jessie, FWIW

@dmiddlecamp thanks :+1:

The instructions supplied by @rvagg don't seem to work on a full Jessie build as opposed to the light version working as reported by @aburgd.

Also, @dmiddlecamp, I'm presumably being stupid, but how did you install from that tarball? The readme says to do ./configure, but there is no configure or makefile or anything :s

Edit: Oh, that was a stupid question :) just needs putting into /usr/local. For anyone else that this might be helpful for,

wget http://nodejs.org/dist/v4.2.4/node-v4.2.4-linux-armv6l.tar.gz
cd usr/local
sudo tar xzvf ~/node-v4.2.4-linux-armv6l.tar.gz --strip=1

This goes and gets node v4.2.4 using wget and puts it in the home folder, changes to usr/local where we want to put node so we can call it from the command line using "node", and then uncompresses the archive. The strip command is to stop it from being uncompresses into a folder called "node-v4.2.4-linux-armv6l.tar.gz".

Was this page helpful?
0 / 5 - 0 ratings