跳到主要内容
CNode

npm@1.1.48 在linux下Segmentation fault

Aatian25发布于 14 年前最后回复 14 年前
1392430
  • linux version:
[root[@etone231](/user/etone231) download]# lsb_release -a
LSB Version:    :core-3.1-amd64:core-3.1-ia32:core-3.1-noarch:graphics-3.1-amd64:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: RedHatEnterpriseServer
Description:    Red Hat Enterprise Linux Server release 5.1 (Tikanga)
Release:        5.1
Codename:       Tikanga
  • node.js:
git clone https://github.com/joyent/node.git
cd node
./configure
make
sudo make install
  • npm fail:
[root[@etone231](/user/etone231) download]# node -e "console.log('a')"
a

[root[@etone231](/user/etone231) download]# node -v
v0.8.6

[root[@etone231](/user/etone231) download]# python -V
Python 2.7.3

[root[@etone231](/user/etone231) download]# gmake -v
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for x86_64-redhat-linux-gnu

[root[@etone231](/user/etone231) download]# npm -v
1.1.48

[root[@etone231](/user/etone231) download]# npm list
Segmentation fault
查看回复

回复 (13)

F
fxsjy#114 年前

看看core文件

A
atian25#214 年前
引用 fxsjy看看core文件

怎么看?

F
fxsjy#314 年前
引用 fxsjy看看core文件

@atian25 $ gdb -c core.xxx core.xxx是程序崩溃时生产的core文件,如果没有core文件,先运行一下ulimit -c unlimited

A
atian25#414 年前
引用 fxsjy看看core文件

@fxsjy 不好意思, 不是很熟悉linux的gdb啥的, 这个core.xxx文件要怎么找? 是npm目录下还是?

F
fxsjy#514 年前
引用 fxsjy看看core文件

@atian25 一般程序崩溃后的core文件都在当前目录下面。不过,你先检查一下ulimit -c ,默认好像不生产core文件。

A
atian25#614 年前
引用 fxsjy看看core文件

@fxsjy

[root@etone231 download]# gdb -c core.10210   
GNU gdb Red Hat Linux (6.5-25.el5rh)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
Core was generated by `npm                                      '.
Program terminated with signal 11, Segmentation fault.
#0  0x00000000005d4d3d in ?? ()
F
fxsjy#714 年前
引用 fxsjy看看core文件

@atian25 输入bt看看调用堆栈?

A
atian25#814 年前
引用 fxsjy看看core文件

@fxsjy 杯具,乱码..

Program terminated with signal 11, Segmentation fault.
#0  0x00000000005d4d3d in ?? ()
(gdb) bt
#0  0x00000000005d4d3d in ?? ()
#1  0x0000000000000002 in ?? ()
#2  0x00000000005d6baf in ?? ()
#3  0x0000000000000000 in ?? ()
(gdb) 
F
fxsjy#914 年前
引用 fxsjy看看core文件

@atian25 输入 file /usr/local/bin/npm, 然后再bt

A
atian25#1014 年前
引用 fxsjy看看core文件

@fxsjy 刚才重装后,用./configuare -prefix /opt/node 了. 然后在etc/profile加了path

[root@etone231 download]# /opt/node/bin/npm -v
1.1.48
[root@etone231 download]# which npm
/opt/node/bin/npm

(gdb) file /opt/node/bin/npm 
"/opt/node/bin/npm": not in executable format: File format not recognized
(gdb) bt
#0  0x00000000005d4d3d in ?? ()
#1  0x0000000000000002 in ?? ()
#2  0x00000000005d6baf in ?? ()
#3  0x0000000000000000 in ?? ()
(gdb) 
F
fxsjy#1114 年前
引用 fxsjy看看core文件

@atian25 莫非这个/opt/node/bin/npm是个脚本? 然后调用了另一个二进制文件?

A
atian25#1214 年前
引用 fxsjy看看core文件

@fxsjy 多谢如此耐心. 还真的是:

[root@etone231 bin]# ll -h
total 11M
-rwxr-xr-x 1 root root 11M Aug 10 14:06 node
-rwxr-xr-x 1 root root 355 Aug 10 13:55 node-waf
lrwxrwxrwx 1 root root  38 Aug 10 14:07 npm -> ../lib/node_modules/npm/bin/npm-cli.js
A
atian25#1314 年前
引用 fxsjy看看core文件

@fxsjy 然后要怎么办? 在npm github和stackoverflow问了..都没人回...

参与回复

登录后即可参与回复。登录