Node crashes without any errors

246 views
Skip to first unread message

Brian Gruber

unread,
Apr 23, 2012, 5:38:47 PM4/23/12
to sock...@googlegroups.com
I'm using node 4.12 because all the newer versions seem to have a
memory leak that makes it unusable as a long running server
(https://github.com/einaros/ws/issues/43).
I'm also running socket.io by using the forever module to make sure
that when things go unexpected it restarts quickly. Problem is, every
few hours "forever" detects that node died but without ANY error
message. All my logs show that memory is fine, disk is fine, network,
etc. There's just no error message it dies and forever restarts it, so
I have no idea how to debug this.

Any ideas?

- Brian

Nico Kaiser

unread,
Apr 23, 2012, 5:42:09 PM4/23/12
to sock...@googlegroups.com
Brian,

did you test your server if it leaks memory? ws #43 may be specific to my application (or large ws servers with many clients), so it would be interesting if you also see those leaks.

For the crash... can you start your server without forever? Maybe the error is displayed then and we can search further.

Nico

Brian Gruber

unread,
Apr 24, 2012, 2:58:31 PM4/24/12
to sock...@googlegroups.com
Started without forever and same thing. Just dies without ANY errors
:( In terms of watching memory, I'm monitoring free -m every few
seconds and that's where I see the leak if I use node 0.6.*, it
steadily rises to 100% used memory. On 0.4.* it doesn't rise and stays
steady, but I have this other issue of just randomly exiting without
any messaging.

- Brian

--
Regards,

Brian Gruber
www.luckyorange.com
(913) 735-9032

Real time visitor analytics, chat, heatmaps & polls.

Brian Gruber

unread,
Apr 24, 2012, 3:30:28 PM4/24/12
to sock...@googlegroups.com
Okay, getting closer, I see a SEGFAULT. How do I check the configure
options used to build node? I remember once playing with SCONS to get
some memory profiler to work and I can't remember if it's linked to
the wrong v8? Is that possible?

- Brian

Brian Gruber

unread,
Apr 24, 2012, 5:00:31 PM4/24/12
to sock...@googlegroups.com
So, it's certainly a segmentation fault, but I can't see any more info
than that in my system logs (dmesg). How would I go about debugging
segmentation faults in node?

- Brian

Guillermo Rauch

unread,
Apr 24, 2012, 5:02:51 PM4/24/12
to sock...@googlegroups.com
Try gdb (make sure node is built with debug symbols)
--
Guillermo Rauch
LearnBoost CTO
http://devthought.com

Brian Gruber

unread,
Apr 24, 2012, 5:10:21 PM4/24/12
to sock...@googlegroups.com
So, if I do

gdb --args node myscript.js

then I type "run"

I quickly get

Program received signal SIGPIPE, Broken pipe.
0x00007ffff6616f90 in __write_nocancel () from /lib64/libpthread.so.0

and if I type continue I just keep getting that, so I'm not sure how
to even let it continue to the point of hitting the segfault.

Sorry, new to gdb and segfault debugging :(

Brian Gruber

unread,
Apr 25, 2012, 6:50:25 PM4/25/12
to sock...@googlegroups.com
Okay, so I've figured out how to ignore that SIGPIPE

handle SIGPIPE nostop

However, I can't get it to break at all when running via gdb. When I
run it outside of gdb it breaks randomly and the only log on my system
is a SEGFAULT. Any idea why running through gdb would NOT generate a
SEGFAULT but running outside of it will?

- Brian
Reply all
Reply to author
Forward
0 new messages