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

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

Closed
nojvek opened this issue Jun 25, 2016 · 4 comments
Labels
confirmed-bug Issues with confirmed bugs. inspector Issues and PRs related to the V8 inspector protocol

Comments

@nojvek
Copy link

nojvek commented Jun 25, 2016

  • 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

@addaleax addaleax added the inspector Issues and PRs related to the V8 inspector protocol label Jun 25, 2016
@ofrobots ofrobots added the confirmed-bug Issues with confirmed bugs. label Jun 25, 2016
@ofrobots
Copy link
Contributor

/cc @eugeneo

@ofrobots
Copy link
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

@addaleax
Copy link
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.

@nojvek
Copy link
Author

nojvek commented Jun 29, 2016

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
.

Fishrock123 pushed a commit that referenced this issue Jul 5, 2016
Inspector socket implementation was notifying handshake callback before
performing the cleanups, which meant that callback could not reclaim
resources allocated by the client. New implementation will free all
resource not allocated by the client before calling the callback,
allowing the client to complete the cleanup.

Fixes: #7418
PR-URL: #7450
Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed-bug Issues with confirmed bugs. inspector Issues and PRs related to the V8 inspector protocol
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants