Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use node-inspector debug stop , then crash #2110

Closed
yjhjstz opened this issue Jul 6, 2015 · 8 comments
Closed

use node-inspector debug stop , then crash #2110

yjhjstz opened this issue Jul 6, 2015 · 8 comments
Labels
c++ Issues and PRs that require attention from people who are familiar with C++.

Comments

@yjhjstz
Copy link

yjhjstz commented Jul 6, 2015

I use node-inspector to debug , then I try to stop debug in my testcase, that's is to call Agent::Stop().
when I didn't closed the node-inspector, then I meat the crash . Otherwise I closed the node-inspector , it won't happen.
Here is the stack:

$2 = <optimized out>
(gdb) bt
#0 syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1 0x0000000000c8222a in uv__epoll_wait (epfd=<optimized out>, events=events@entry=0x7f4ac3bc3dc0, nevents=nevents@entry=1024, timeout=timeout@entry=-1)
at ../deps/uv/src/unix/linux-syscalls.c:313
#2 0x0000000000c803dd in uv__io_poll (loop=loop@entry=0x2771800, timeout=-1) at ../deps/uv/src/unix/linux-core.c:216
#3 0x0000000000c70d33 in uv_run (loop=0x2771800, mode=UV_RUN_DEFAULT) at ../deps/uv/src/unix/core.c:323
#4 0x0000000000c5196b in node::debugger::Agent::WorkerRun() ()
#5 0x0000000000c7c5f8 in uv__thread_start (arg=<optimized out>) at ../deps/uv/src/unix/thread.c:49
#6 0x00007f4ac479a6aa in start_thread (arg=0x7f4ac3bc7700) at pthread_create.c:333
#7 0x00007f4ac44cfeed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109


#0 0x00007f4ac479b8ed in pthread_join (threadid=139959088216528, thread_return=thread_return@entry=0x0) at pthread_join.c:90
90 pthread_join.c: No such file or directory.
(gdb) bt
#0 0x00007f4ac479b8ed in pthread_join (threadid=139959088216528, thread_return=thread_return@entry=0x0) at pthread_join.c:90
#1 0x0000000000c7c69e in uv_thread_join (tid=<optimized out>) at ../deps/uv/src/unix/thread.c:80
#2 0x0000000000c50efc in node::debugger::Agent::Stop() [clone .part.12] ()
#3 0x0000000000bf3896 in node::DispatchDebugMessagesAsyncCallback(uv_async_s*) ()
#4 0x0000000000c701ad in uv__async_event (loop=0x1302c00 <default_loop_struct>, w=<optimized out>, nevents=<optimized out>) at ../deps/uv/src/unix/async.c:89
#5 0x0000000000c70283 in uv__async_io (loop=0x1302c00 <default_loop_struct>, w=0x1302dc8 <default_loop_struct+456>, events=<optimized out>)
at ../deps/uv/src/unix/async.c:160
#6 0x0000000000c801fa in uv__io_poll (loop=loop@entry=0x1302c00 <default_loop_struct>, timeout=280) at ../deps/uv/src/unix/linux-core.c:305
#7 0x0000000000c70d33 in uv_run (loop=0x1302c00 <default_loop_struct>, mode=UV_RUN_ONCE) at ../deps/uv/src/unix/core.c:323
#8 0x0000000000bf7911 in node::Start(int, char**) ()
#9 0x00007f4ac43e9a40 in __libc_start_main (main=0x60db70 <main>, argc=2, argv=0x7ffde187f1f8, init=<optimized out>, fini=<optimized out>, 
rtld_fini=<optimized out>, stack_end=0x7ffde187f1e8) at libc-start.c:289
#10 0x000000000060dda9 in _start ()
(gdb) 

Then I try to fix it as below.

@@ -34,8 +34,13 @@ exports.start = function start() {
     process.listeners('SIGWINCH').forEach(function(fn) {
       process.removeListener('SIGWINCH', fn);
     });
-
+    // not more connection
     agent.close();
+    // close all client
+    agent.clients.forEach(function(client) {
+      client.destroy();
+    });
+
   };

The truth is that uv_run is blocked, I think the best way to slove is to close all clients in agent but not depend on client.

@Fishrock123 Fishrock123 added c++ Issues and PRs that require attention from people who are familiar with C++. libuv Issues and PRs related to the libuv dependency or the uv binding. labels Jul 6, 2015
@bnoordhuis bnoordhuis added debugger and removed libuv Issues and PRs related to the libuv dependency or the uv binding. labels Jul 6, 2015
@bnoordhuis
Copy link
Member

I replaced the 'libuv' label with 'debugger' because I don't think it's a bug in libuv.

/cc @indutny - maybe you can take a look?

@yjhjstz
Copy link
Author

yjhjstz commented Jul 6, 2015

when agent stoped, we should close all connections, right?

@indutny
Copy link
Member

indutny commented Jul 6, 2015

Sounds like a bug to me. @yjhjstz may I ask you to submit a PR to fix it?

@yjhjstz
Copy link
Author

yjhjstz commented Jul 9, 2015

#2139 @indutny

@jasnell
Copy link
Member

jasnell commented Mar 9, 2016

@bnoordhuis @indutny ... is this one still relevant?

@indutny
Copy link
Member

indutny commented Mar 9, 2016

There were some fixes to debug agent. @yjhjstz are you still able to reproduce it?

@jasnell
Copy link
Member

jasnell commented Apr 2, 2016

ping @yjhjstz ...

if there's no response I'm going to assume this is no longer an issue and close.

@MylesBorins
Copy link
Contributor

@jasnell there is a fix in at #5270 although @yjhjstz has not responded

@indutny I assigned it to you in #5270. It seems like one of the problems was the lack of a reliable tests. The test that is currently available is failing. If we don't hear from @yjhjstz we should likely close it, but I'd be interested in hearing if the fixes to the debugger helps them

@yjhjstz yjhjstz closed this as completed Jun 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++.
Projects
None yet
Development

No branches or pull requests

6 participants