Pre Exam Test Practice (SSC | Banking | IAS | GATE | State Level | CLAT | Railways | Insurance | Teaching Exams | NDA | Defence | IES |State Exam )

Organizational Research By

Surprising Reserch Topic

node js source code build giving segmentation fault on arm

node js source code build giving segmentation fault on arm  using -'node.js,segmentation-fault,arm,v8,ubuntu-12.10'

tl;dr: I tried to install node.js on my ARMv7-based Cubox running Ubuntu 12.10 (quantal). When compiling node.js from source (see "Second attempt" below), node produces a segmentation fault. What can I do here?

First attempt

First of all, I tried to install node.js via the package manager, following the instructions for Ubuntu that are given here: Installing Node.js via package manager: Ubuntu, Mint

Adding the repository mentioned there using sudo add-apt-repository ppa:chris-lea/node.js seems to work fine:

You are about to add the following PPA to your system:
 Evented I/O for V8 javascript. Node's goal is to provide an easy way to build scalable network programs
 More info:
Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keyring `/tmp/tmpp0owib/secring.gpg' created
gpg: keyring `/tmp/tmpp0owib/pubring.gpg' created
gpg: requesting key C7917B12 from hkp server
gpg: /tmp/tmpp0owib/trustdb.gpg: trustdb created
gpg: key C7917B12: public key "Launchpad chrislea" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)

However, sudo apt-get install nodejs gives me the error:

E: Unable to locate package nodejs

I assume this is because I have an ARM-based system. As far as I can tell from the package details, the repo only contains builds for i386 and amd64. Is my assumption right?

Second attempt

So my next attempt was to install node.js from source. I used the instructions given in the following gist: Node.js and NPM in 30 seconds. Everything seems to work, including make install. But the execution of the script in the last line of the gist fails since node produces a segmentation fault. Now I wonder what I can do to properly install node.js on my machine?

In order to illustrate my problem, here is some output: output

This is the ouput of after running make install, as described in the gist installation instructions mentioned above.

cyroxx@cubox:~/node-latest-install$ curl | sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  7882  100  7882    0     0  11251      0 --:--:-- --:--:-- --:--:-- 14984
tar (GNU tar) 1.26
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.
install npm@latest
Segmentation fault
Segmentation fault
You need node  to run this program.
node --version reports: v0.10.7
Please upgrade node before continuing.
It failed

node output

cyroxx@cubox:~/node-latest-install$ node
Segmentation fault

make Debug build

Running make with BUILDTYPE=Debug produces this output:

cyroxx@cubox:~/node-latest-install$ make -C out BUILDTYPE=Debug
make: Entering directory `/home/cyroxx/node-latest-install/out'
  CXX(target) /home/cyroxx/node-latest-install/out/Debug/
../deps/v8/src/arm/ In function 'void v8::internal::ProbeTable(v8::internal::Isolate*, v8::internal::MacroAssembler*, v8::internal::Code::Flags, v8::internal::StubCache::Table, v8::internal::Register, v8::internal::Register, v8::internal::Register, v8::internal::Register, v8::internal::Register, v8::internal::Register)':
../deps/v8/src/arm/ error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
cc1plus: all warnings being treated as errors
make: *** [/home/cyroxx/node-latest-install/out/Debug/] Error 1
make: Leaving directory `/home/cyroxx/node-latest-install/out'

What's wrong here? Is this a bug in the ARM implementation of V8? Maybe any compiler flags that are not (properly) set? Anything else? I am totally stuck.

asked Sep 18, 2015 by mca.agarwal
0 votes

Related Hot Questions

Government Jobs Opening