HI, I found some step maybe miss.
the 'gdb --args out/Debug/node /usr/local/bin/npm list' don't run the new npm just make, but the old.
so I redo with following:
(sorry, I know nth about c & gdb)
$ cd path/to/node
$ make -j 4 BUILDTYPE=Debug # 4 == number of CPUs
$ make install # now /user/local/bin/npm -v is 1.1.49
$ gdb --args out/Debug/node /usr/local/bin/npm list
> run
# wait for the crash
> thread apply all backtrace full
> help gcore
> generate-core-file # need this to save core file?
now I'm downloading out/Debug/node (129M) & core.7355 (90M), then I will upload it to dropbox.
[root@etone46 node]# gdb --args out/Debug/node /usr/local/bin/npm list
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"...Using host libthread_db library "/lib64/libthread_db.so.1".
(gdb) run
Starting program: /opt/download/nodejs/node/out/Debug/node /usr/local/bin/npm list
[Thread debugging using libthread_db enabled]
[New process 7355]
[New Thread 1073809728 (LWP 7358)]
[New Thread 46912496273552 (LWP 7355)]
[New Thread 1074075968 (LWP 7359)]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1074075968 (LWP 7359)]
0x00000000006fac8e in uv_async_send (handle=0x11c1dc8) at ../deps/uv/src/unix/async.c:56
56 r = write(handle->loop->async_pipefd[1], "x", 1);
Current language: auto; currently c
(gdb) thread apply all backtrace full
Thread 4 (Thread 1074075968 (LWP 7359)):
#0 0x00000000006fac8e in uv_async_send (handle=0x11c1dc8) at ../deps/uv/src/unix/async.c:56
r = 0
#1 0x0000000000716984 in uv_eio_want_poll (channel=0x11c1d20) at ../deps/uv/src/unix/uv-eio.c:66
loop = (uv_loop_t *) 0x11c1d20
#2 0x00000000006fe9bf in etp_proc (thr_arg=0x1ded5760) at ../deps/uv/src/unix/eio/eio.c:2094
req = (eio_req *) 0x1df0f4e0
ts = {tv_sec = 0, tv_nsec = 843749568}
self = (etp_worker *) 0x1ded5760
#3 0x000000321180677d in start_thread () from /lib64/libpthread.so.0
No symbol table info available.
#4 0x0000003210cd33ed in clone () from /lib64/libc.so.6
No symbol table info available.
Thread 3 (Thread 46912496273552 (LWP 7355)):
#0 0x0000003210cd37d8 in epoll_wait () from /lib64/libc.so.6
No symbol table info available.
#1 0x0000000000702ef3 in epoll_poll (loop=0x11c23c0, timeout=2.399) at ../deps/uv/src/unix/ev/ev_epoll.c:150
i = 18621376
eventcnt = 0
#2 0x00000000007068ca in ev__run (loop=0x11c23c0, waittime=2.399) at ../deps/uv/src/unix/ev/ev.c:2542
No locals.
#3 0x00000000006fb824 in uv__poll (loop=0x11c1d20) at ../deps/uv/src/unix/core.c:247
No locals.
---Type <return> to continue, or q <return> to quit---
#4 0x00000000006fb86f in uv__run (loop=0x11c1d20) at ../deps/uv/src/unix/core.c:257
No locals.
#5 0x00000000006fb8c5 in uv_run (loop=0x11c1d20) at ../deps/uv/src/unix/core.c:265
No locals.
#6 0x000000000069838a in node::Start (argc=3, argv=0x1de99070) at ../src/node.cc:2968
locker = {has_lock_ = true, top_level_ = true, isolate_ = 0x1de8e070, static active_ = true}
context = {<v8::Handle<v8::Context>> = {val_ = 0x1dedbd60}, <No data fields>}
handle_scope = {isolate_ = 0x1de8e070, prev_next_ = 0x0, prev_limit_ = 0x0, is_closed_ = false}
context_scope = {context_ = {val_ = 0x1dedbd60}}
process_l = {val_ = 0x1dedbdc0}
argv_copy = (char **) 0x1de996b0
#7 0x00000000006aff13 in main (argc=3, argv=0x7fff3c67af08) at ../src/node_main.cc:65
No locals.
Thread 2 (Thread 1073809728 (LWP 7358)):
#0 0x0000003210c993b1 in nanosleep () from /lib64/libc.so.6
No symbol table info available.
#1 0x0000003210cccd34 in usleep () from /lib64/libc.so.6
No symbol table info available.
#2 0x0000000000c07a2a in v8::internal::SignalSender::Sleep (this=0x1ded2270,
full_or_half=v8::internal::SignalSender::FULL_INTERVAL) at ../deps/v8/src/platform-linux.cc:1194
interval = 900
result = 0
#3 0x0000000000c07bc3 in v8::internal::SignalSender::Run (this=0x1ded2270) at ../deps/v8/src/platform-linux.cc:1160
cpu_profiling_enabled = false
---Type <return> to continue, or q <return> to quit---
runtime_profiler_enabled = true
state = v8::internal::SamplerRegistry::HAS_SAMPLERS
#4 0x0000000000c06194 in ThreadEntry (arg=0x1ded2270) at ../deps/v8/src/platform-linux.cc:733
thread = (class v8::internal::Thread *) 0x1ded2270
#5 0x000000321180677d in start_thread () from /lib64/libpthread.so.0
No symbol table info available.
#6 0x0000003210cd33ed in clone () from /lib64/libc.so.6
No symbol table info available.
Thread 1 (LWP 7355):
#0 0x0000003210cd37d8 in epoll_wait () from /lib64/libc.so.6
No symbol table info available.
#1 0x0000000000702ef3 in epoll_poll (loop=0x11c23c0, timeout=2.399) at ../deps/uv/src/unix/ev/ev_epoll.c:150
i = 18621376
eventcnt = 0
#2 0x00000000007068ca in ev__run (loop=0x11c23c0, waittime=2.399) at ../deps/uv/src/unix/ev/ev.c:2542
No locals.
#3 0x00000000006fb824 in uv__poll (loop=0x11c1d20) at ../deps/uv/src/unix/core.c:247
No locals.
#4 0x00000000006fb86f in uv__run (loop=0x11c1d20) at ../deps/uv/src/unix/core.c:257
No locals.
#5 0x00000000006fb8c5 in uv_run (loop=0x11c1d20) at ../deps/uv/src/unix/core.c:265
No locals.
#6 0x000000000069838a in node::Start (argc=3, argv=0x1de99070) at ../src/node.cc:2968
locker = {has_lock_ = true, top_level_ = true, isolate_ = 0x1de8e070, static active_ = true}
---Type <return> to continue, or q <return> to quit---
context = {<v8::Handle<v8::Context>> = {val_ = 0x1dedbd60}, <No data fields>}
handle_scope = {isolate_ = 0x1de8e070, prev_next_ = 0x0, prev_limit_ = 0x0, is_closed_ = false}
context_scope = {context_ = {val_ = 0x1dedbd60}}
process_l = {val_ = 0x1dedbdc0}
argv_copy = (char **) 0x1de996b0
#7 0x00000000006aff13 in main (argc=3, argv=0x7fff3c67af08) at ../src/node_main.cc:65
No locals.
0x00000000006fac8e 56 r = write(handle->loop->async_pipefd[1], "x", 1);
(gdb)
(gdb)
(gdb) help gcore
Save a core file with the current state of the debugged process.
Argument is optional filename. Default filename is 'core.<process_id>'.
(gdb) generate-core-file
Saved corefile core.7355
在 2012年8月17日星期五UTC+8下午5时35分54秒,Ben Noordhuis写道: