nodejs / node-v0.x-archive

Moved to https://github.com/nodejs/node
34.42k stars 7.31k forks source link

Segmentation fault under FreeBSD 8.0 #21

Closed UnderCooled closed 14 years ago

UnderCooled commented 14 years ago

The helloworld.js works fine. But other project like node_chat or benchmarks/static_http_server.js get this error: Segmentation fault: 11 (core dumped)

$>uname -a
FreeBSD 8.0-RELEASE #0: Sat Nov 21 15:48:17 UTC 2009     root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386

$>node -v
0.1.20

$>gdb -c node.core

This GDB was configured as "i386-marcel-freebsd".
Core was generated by `node'.
Program terminated with signal 11, Segmentation fault.
#0  0x080c18cf in ?? ()
UnderCooled commented 14 years ago

gdb trace on node_debug/example.js

http://gist.github.com/249585

UnderCooled commented 14 years ago

When running helloworld.js i tried to reload the page then get Segmentation fault too.

I think the problem may relate to this issue on evcom:

http://github.com/ry/evcom/issues#issue/1

ry commented 14 years ago

Can you try to debug it a bit? Build the node_g executable with symbols

./configure --debug
make

Then send me a stacktrace

simoncpu commented 14 years ago

I've encountered the same problem too:

root@soulfury:~# uname -a
FreeBSD chaosbuilder.simoncpu.com 7.1-RELEASE-p8 FreeBSD 7.1-RELEASE-p8 #0: Thu Oct  8 19:24:29 PHT 2009     admin@soulfury:/usr/obj/usr/src/sys/INARA  i386
root@soulfury:~# node_g -v
0.1.21 (debug)

root@soulfury:~# gdb node_g node_g.core
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 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 "i386-marcel-freebsd"...
Core was generated by `node_g'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/local/lib/libexecinfo.so.1...done.
Loaded symbols for /usr/local/lib/libexecinfo.so.1
Reading symbols from /usr/lib/libstdc++.so.6...done.
Loaded symbols for /usr/lib/libstdc++.so.6
Reading symbols from /lib/libm.so.5...done.
Loaded symbols for /lib/libm.so.5
Reading symbols from /lib/libgcc_s.so.1...done.
Loaded symbols for /lib/libgcc_s.so.1
Reading symbols from /lib/libthr.so.3...done.
Loaded symbols for /lib/libthr.so.3
Reading symbols from /lib/libc.so.7...done.
Loaded symbols for /lib/libc.so.7
Reading symbols from /libexec/ld-elf.so.1...done.
Loaded symbols for /libexec/ld-elf.so.1
#0  0x081627bc in v8::internal::HeapObject::map_word (this=0xa286a41) at objects-inl.h:1022
1022      return MapWord(reinterpret_cast(READ_FIELD(this, kMapOffset)));
[New Thread 0x2878d200 (LWP 100080)]
[New Thread 0x28701100 (LWP 100092)]
(gdb) quit
UnderCooled commented 14 years ago

the problem still exists in v1.22.

#0  0x081634fc in v8::internal::HeapObject::map_word (this=0xa2aa001)
at objects-inl.h:1022
1022      return MapWord(reinterpret_cast<uintptr_t>(READ_FIELD(this, kMapOffset)));
[New Thread 28992ec0 (LWP 100128)]
[New Thread 28993140 (LWP 100083)]
[New Thread 28901140 (LWP 100101)]
(gdb) quit
brainpicture commented 14 years ago

the problem still exists in v1.25 (freeBSD v6.3) on the second program request it falls (Segmentation fault) code: var sys = require('sys'), http = require('http'); http.createServer(function (req, res) { res.sendHeader(200, {'Content-Type': 'text/plain'}); res.sendBody('Hello World'); res.finish(); }).listen(8020); sys.puts('Server running at http://127.0.0.1:8010/');

xxx commented 14 years ago

I have this same problem on FreeBSD 8-STABLE.

$ node -v
v0.1.26-17-g704f394

stacktrace at http://gist.github.com/290748

This happens just trying to hit the index of node_chat in a browser. As stated above, simpler examples do work.

EDIT: http://gist.github.com/290788 is the output from make test.

xxx commented 14 years ago

As of v0.1.33-179-gb0d1d6c there are no more segfaults for me and only the tcp-reconnect test is failing.

UnderCooled commented 14 years ago

@xxx The libv8 can only compiled with a newer version of gcc, I use the gcc45 from ports. How about you?

Yes, only one test failed.

xxx commented 14 years ago

gcc 4.2.1 works fine for me. I did have to tweak /usr/local/include/jstypes.h (installed by the spidermonkey port) to explicitly define XP_UNIX because the v8 build was choking. v8 refused to build at all without spidermonkey already installed.

ry commented 14 years ago

closing - for new fbsd build problems open a new issue