Skip to content

Stop inspect the main thread Blocked. #12559

Description

@823639792

node version: 7.5.0
platform: win7

I start node with "node --inspect c:\node.js"
And I wand to stop inspect, but the main thread Blocked.

	global_env->inspector_agent()->Stop();  // this line blocked.
        global_env->debugger_agent()->Stop();

and block in

int uv_thread_join(uv_thread_t *tid) {
  if (WaitForSingleObject(*tid, INFINITE))    //this line  block forever
    return uv_translate_sys_error(GetLastError());
  else {
    CloseHandle(*tid);
    *tid = 0;
    return 0;
  }
}

call process._debugEnd(); have same question.

Activity

  1. added
    c++Issues and PRs that require attention from people who are familiar with C++.
    inspectorIssues and PRs related to the V8 inspector protocol.
    questionIssues asking questions about Node.js.
    on Apr 21, 2017
  2. eugeneo commented on Apr 21, 2017

    @eugeneo
    Contributor

    Is it "Waiting for frontend to disconnect"?

  3. 823639792 commented on Apr 24, 2017

    @823639792
    Author

    I don't thing so,because my chrome inspector not connected.

  4. bnoordhuis commented on Apr 24, 2017

    @bnoordhuis
    Member

    @823639792 Can you post exact steps to reproduce and check whether it still happens with the latest v7.x release?

  5. 823639792 commented on Apr 25, 2017

    @823639792
    Author

    @bnoordhuis

    node version: 7.8.0
    platform: win7
    1、node --inspect c:\node.js
    2、call method process._debugEnd() in c:\node.js

    In fact, I embeded node in my win32 application, And want to reload nodejs: release and alloc new。

    And I force edit source code:

    void AgentImpl::Stop() {
    #if 0 
    //remove by hzy 
    	int err = uv_thread_join(&thread_);
    	CHECK_EQ(err, 0);
    #else
    	server_->Stop(nullptr);
    #endif
      delete inspector_;
    }

    Now node can reload when inspector not connect, but if inspector connect it still crash。
    How terrible my code。-_-|||

  6. eugeneo commented on Apr 25, 2017

    @eugeneo
    Contributor

    Thank you for reporting it. I see the issue, debugging now.

  7. self-assigned this
    on Apr 25, 2017
  8. 823639792 commented on May 8, 2017

    @823639792
    Author

    @eugeneo
    Hello, I add you code to my project, if no inspector attached, it works well.
    But if chrome inspector attached, and call _debugEnd, it still blocked.
    blocked in:

    InspectorIo::WorkerRunIO ->
    uv_run(&loop, UV_RUN_DEFAULT); ->
    (*poll)(loop, timeout); ->
    uv_poll_ex() ->
    pGetQueuedCompletionStatusEx 
    
  9. eugeneo commented on May 9, 2017

    @eugeneo
    Contributor

    Are you using Chrome DevTools? Try the same with a different frontend (e.g. VS Code). Chrome DevTools have a bug - https://bugs.chromium.org/p/chromium/issues/detail?id=718619 - I hope I will have time this week to look into it.

  10. 823639792 commented on May 11, 2017

    @823639792
    Author

    Both “chrome://inspect” and connecting through “chrome-devtools://...” blocked。
    Maybe some wrong in my code. or my version is 7.8 and you is 8.0。I will try to find root cause。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

c++Issues and PRs that require attention from people who are familiar with C++.inspectorIssues and PRs related to the V8 inspector protocol.questionIssues asking questions about Node.js.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions