Skip to content

node --inspect connecting with url in localhost:<port>/json gives malloc error with nightlies #7418

Description

@nojvek
  • Version: v7.0.0-nightly20160621ecc48a154d (21st Jun)
  • Platform: Mac OS
  • Subsystem: 10.9.5

Starting node as
node --debug-brk --inspect=9999

Then navigating to http://localhost:9999/json
Gives

[
{
description: "node.js instance",
devtoolsFrontendUrl: "https://chrome-devtools-frontend.appspot.com/serve_file/@521e5b7e2b7cc66b4006a8a54cb9c4e57494a5ef/inspector.html?experiments=true&v8only=true&ws=localhost:9999/node",
faviconUrl: "https://nodejs.org/static/favicon.ico",
id: "8622",
title: "node",
type: "node",
webSocketDebuggerUrl: "ws://localhost:9999/node"
}
]

When connecting to devtoolsFrontendUrl: https://chrome-devtools-frontend.appspot.com/serve_file/@521e5b7e2b7cc66b4006a8a54cb9c4e57494a5ef/inspector.html

Debugger listening on port 9999.
To start debugging, open the following URL in Chrome:
    chrome-devtools://devtools/remote/serve_file/@521e5b7e2b7cc66b4006a8a54cb9c4e57494a5ef/inspector.html?experiments=true&v8only=true&ws=localhost:9999/node
node(8622,0x104801000) malloc: *** error for object 0x15: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
[1]    8622 abort      node --debug-brk --inspect=9999

/cc @ofrobots @pavelfeldman @paulirish

Activity

  1. added
    inspectorIssues and PRs related to the V8 inspector protocol.
    on Jun 25, 2016
  2. ofrobots commented on Jun 25, 2016

    @ofrobots
    Contributor
  3. ofrobots commented on Jun 25, 2016

    @ofrobots
    Contributor

    Backtrace:

    (lldb) bt
    * thread #2: tid = 0xe756, 0x00007fff9b9c6f06 libsystem_kernel.dylib`__pthread_kill + 10, stop reason = signal SIGABRT
      * frame #0: 0x00007fff9b9c6f06 libsystem_kernel.dylib`__pthread_kill + 10
        frame #1: 0x00007fff9f62c4ec libsystem_pthread.dylib`pthread_kill + 90
        frame #2: 0x00007fff9ea636e7 libsystem_c.dylib`abort + 129
        frame #3: 0x00007fff9009c041 libsystem_malloc.dylib`free + 425
        frame #4: 0x0000000100845c2a node`dispose_inspector(handle=<unavailable>) + 50 at inspector_socket.cc:75
        frame #5: 0x000000010098b390 node`uv_run [inlined] uv__finish_close(handle=<unavailable>) + 522 at core.c:272
        frame #6: 0x000000010098b313 node`uv_run [inlined] uv__run_closing_handles(loop=<unavailable>) + 56 at core.c:286
        frame #7: 0x000000010098b2db node`uv_run(loop=0x000000010283e6c0, mode=UV_RUN_DEFAULT) + 341 at core.c:356
        frame #8: 0x000000010084412a node`node::inspector::AgentImpl::WorkerRunIO(this=<unavailable>) + 254 at inspector_agent.cc:517
        frame #9: 0x0000000100995519 node`uv__thread_start(arg=<unavailable>) + 25 at thread.c:52
        frame #10: 0x00007fff9f62999d libsystem_pthread.dylib`_pthread_body + 131
        frame #11: 0x00007fff9f62991a libsystem_pthread.dylib`_pthread_start + 168
        frame #12: 0x00007fff9f627351 libsystem_pthread.dylib`thread_start + 13
    

    Steps to reproduce:

    ❯ ./node --debug-brk --inspect=9999 & (sleep 1 ; curl http://localhost:9999 )
    [1] 26117
    Debugger listening on port 9999.
    To start debugging, open the following URL in Chrome:
        chrome-devtools://devtools/remote/serve_file/@521e5b7e2b7cc66b4006a8a54cb9c4e57494a5ef/inspector.html?experiments=true&v8only=true&ws=localhost:9999/node
    node(26117,0x700000a0d000) malloc: *** error for object 0x15: pointer being freed was not allocated
    *** set a breakpoint in malloc_error_break to debug
    WebSockets request was expected
    
  4. addaleax commented on Jun 25, 2016

    @addaleax
    Member

    s/ws_mode/ws_state/ in inspector_socket.cc:73? The above steps to reproduce lead to a straight null pointer dereference, not an invalid free(), so I’m not sure it’s the same error. That change appears to make everything work, though.

  5. nojvek commented on Jun 29, 2016

    @nojvek
    Author

    Thanks will try it out in the nightlies

    On Wed, Jun 29, 2016 at 4:05 PM, Ali Ijaz Sheikh notifications@github.com
    wrote:

    Closed #7418 #7418 via 08aff14
    08aff14
    .

    —
    You are receiving this because you authored the thread.
    Reply to this email directly, view it on GitHub
    #7418 (comment), or mute the
    thread
    https://github.com/notifications/unsubscribe/AA-JVNRPkRstViBRLS2ycB7Wtm1RGIZqks5qQvoigaJpZM4I-YFt
    .

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues and PRs for confirmed bugs.inspectorIssues and PRs related to the V8 inspector protocol.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions