Node.js的源$ C ​​$ C建立在ARM给段故障 [英] Node.js source code build giving segmentation fault on ARM

查看:335
本文介绍了Node.js的源$ C ​​$ C建立在ARM给段故障的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

TL;博士:我试图安装node.js的我基于ARMv7的- Cubox 运行Ubuntu 12.10(量子)。当从源代码编译的Node.js(见第二次尝试的),节点产生分段错误。我能做些什么吗?

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?

首先,我试图通过包管理器安装的node.js,紧接着在这里给出的Ubuntu的说明:<一href=\"https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager#ubuntu-mint\">Installing通过包管理器Node.js的:Ubuntu的,薄荷

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

添加提到有使用 sudo的附加的apt-库PPA库:克里斯 - LEA / node.js的似乎很好地工作:

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: https://launchpad.net/~chris-lea/+archive/node.js
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 keyserver.ubuntu.com
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)
OK

然而,命令和apt-get安装的NodeJS 给我的错误:

E: Unable to locate package nodejs

我想这是因为我有一个基于ARM的系统。至于我可以告诉从包详细信息,只包含回购为构建i386和AMD64。是我的假设吧?

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?

所以,我的下一个尝试是从源代码安装的node.js。我用下面的要点给出的说明:的Node.js和NPM在30秒。一切似乎工作,包括使安装。但是,由于中的要点的最后一行 install.sh 脚本执行失败节点产生分段错误。现在我不知道我能做些什么,以我的机器上正确安装的node.js?

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 install.sh 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:

install.sh输出

这是 install.sh 运行后的输出中制作安装,如要点安装说明中提到以上。

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

cyroxx@cubox:~/node-latest-install$ curl https://npmjs.org/install.sh | 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=/bin/tar
version:
tar (GNU tar) 1.26
Copyright (C) 2011 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.

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

节点输出

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

使调试版本

运行制作 BUILDTYPE =调试产生这样的输出:

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/obj.target/v8_base/deps/v8/src/arm/stub-cache-arm.o
../deps/v8/src/arm/stub-cache-arm.cc: 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/stub-cache-arm.cc:106:15: 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/obj.target/v8_base/deps/v8/src/arm/stub-cache-arm.o] Error 1
make: Leaving directory `/home/cyroxx/node-latest-install/out'

这里有什么不对吗?这是V8的ARM实现中的错误?也许所有的编译器标志不在(正确)设置?还要别的吗?我完全卡住了​​。

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.

推荐答案

我有这个问题太上几个不同的ARM计算机。没有快照功能编译为我工作。快照是V8的功能,允许节点,启动速度更快,而且似乎是ARM的错误。

I had this problem too on a few different ARM computers. Compiling without the snapshot feature worked for me. Snapshot is a V8 feature that allows node to start faster, and there seems to be a bug for ARM.

./configure --without-snapshot
make
sudo make install

<一个href=\"http://www.armhf.com/index.php/node-js-for-the-beaglebone-black/\">http://www.armhf.com/index.php/node-js-for-the-beaglebone-black/

这篇关于Node.js的源$ C ​​$ C建立在ARM给段故障的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆