nodejs-0.4.2 segfault on start (Fixed in v 0.4.5)

Problem

Greetings, to save your time this bug was fixed in v0.4.5 I ran into a rather weird problem while installing node.js today and sifted through the mail archives but couldn’t quite pin it!. so I posted the problem to nodejs here

just a heads up that I changed snapshot='snapshot=on' from wscript in Node to snapshot=''. I did this because prior to doing this I encountered the following error during make:

scons: *** [obj/release/snapshot.cc] Error -11

Now to the steps I followed.

*logged in as root

— -Start of configure

adil-X:/usr/local/nodejs/node-v0.4.2 # ./configure --prefix=/usr/local/nodejs    
Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for program gcc or cc : /usr/bin/gcc
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for gcc : ok
Checking for library dl : yes
Checking for openssl : yes
Checking for library util : yes
Checking for library rt : yes
--- libeio ---
Checking for library pthread : yes
Checking for function pthread_create : yes
Checking for function pthread_atfork : yes
Checking for futimes(2) : yes
Checking for readahead(2) : yes
Checking for fdatasync(2) : yes
Checking for pread(2) and pwrite(2) : yes
Checking for sendfile(2) : yes
Checking for sync_file_range(2) : yes
--- libev ---
Checking for header sys/inotify.h : yes
Checking for function inotify_init : yes
Checking for header sys/epoll.h : yes
Checking for function epoll_ctl : yes
Checking for header port.h : not found
Checking for header poll.h : yes
Checking for function poll : yes
Checking for header sys/event.h : not found
Checking for header sys/queue.h : yes
Checking for function kqueue : not found
Checking for header sys/select.h : yes
Checking for function select : yes
Checking for header sys/eventfd.h : yes
Checking for function eventfd : yes
Checking for SYS_clock_gettime : yes
Checking for library rt : yes
Checking for function clock_gettime : yes
Checking for function nanosleep : yes
Checking for function ceil : yes
Checking for fdatasync(2) with c++ : yes
'configure' finished successfully (2.239s)

— — End of configure

— — Start of make(this compiles fine!!)

[make output omitted for brevity]

Waf: Leaving directory /usr/local/nodejs/node-v0.4.2/build'

'build' finished successfully (21.853s)

— — -End of make

— — -Start of make test

/usr/bin/python "/usr/local/nodejs/node-v0.4.2/tools/scons/scons.py" -
j 2 -C "/usr/local/nodejs/node-v0.4.2/build/default/" -Y "/usr/local/
nodejs/node-v0.4.2/deps/v8" visibility=default mode=release arch=ia32
toolchain=gcc library=static

scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
scons: `library' is up to date.
scons: done building targets.
DEST_OS: linux
DEST_CPU: ia32
Parallel Jobs: 2

Product type: program
python tools/test.py --mode=release simple message
[00:00|% 0|+ 0|- 0]: release test-pipe-
head === release test-
pipe-head ===
Path: simple/test-pipe-head
Command: build/default/node /usr/local/nodejs/node-v0.4.2/test/simple/
test-pipe-head.js
--- CRASHED ---

… All of the subsequent tests fail in a similar fashion.

— — -End of make test

— — -Start of make install (I did not execute make test on the first few tries.it was only later that I used it)

adil-X:/usr/local/nodejs/node-v0.4.2 # make install

Waf: Entering directory `/usr/local/nodejs/node-v0.4.2/build'
DEST_OS: linux
DEST_CPU: ia32
Parallel Jobs: 2
Product type: program
* installing build/default/config.h as /usr/local/nodejs/include/node/
config.h
* installing build/default/tools/nodejs.pc as /usr/local/nodejs/lib/
pkgconfig/nodejs.pc
* installing build/default/node as /usr/local/nodejs/bin/node
* installing build/default/src/node_config.h as /usr/local/nodejs/
include/node/node_config.h
Waf: Leaving directory `/usr/local/nodejs/node-v0.4.2/build'
'install' finished successfully (0.122s)

— — -End of make install

I updated the PATH variable to include the nodejs bin.

Now nodejs crashes with following error on startup

adil-X:/usr/local/nodejs/node-v0.4.2 # node example.js

node.js:0
Segmentation fault

still, I can see the node.js version

adil-X:~ # node -v
v0.4.2

OS/Arch info:

adil-X:~ # cat /etc/*release
LSB_VERSION="core-2.0-noarch:core-3.2-noarch:core-4.0-noarch:core-2.0-
ia32:core-3.2-ia32:core-4.0-ia32"
openSUSE 11.3 (i586)

adil-X:~ # cat /proc/cpuinfo
vendor_id :GenuineIntel
cpu family : 6
model : 23
model name : Intel(R) Core(TM)2 Duo CPU T6500 @ 2.10GHz
stepping : 10
cpu MHz : 1200.000
cache size : 2048 KB

With no errors on the way when building from source, I am unable to figure out the problem. am I missing something obvious? thanks.

Problem courtesy of: Adil Mehmood

Solution

problem fixed in nodejs-v0.4.5.no hassle at all. Maybe there was really a bug in nodejs-v0.4.2 afterall.

Solution courtesy of: Adil Mehmood

View additional discussion.