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

v12: hangs on calling console.log with large object #29646

Closed
pimlie opened this issue Sep 21, 2019 · 2 comments
Closed

v12: hangs on calling console.log with large object #29646

pimlie opened this issue Sep 21, 2019 · 2 comments
Labels
util Issues and PRs related to the built-in util module.

Comments

@pimlie
Copy link
Contributor

pimlie commented Sep 21, 2019

  • Version: v12.10.0
  • Platform: Linux x64
  • Subsystem:

Unfortunately I was unable to reproduce this with a small circular object, I think at least it has something to do with circularity, no idea what else could cause this.

Reproduction is here, this tries to log a full VueComponent: https://github.com/pimlie/node-v12-util-inspect-issue

Steps:

  • clone & install
  • run: node --inspect ./node_modules/.bin/nuxt
  • attach debugger
  • browse to http://localhost:3000
  • node now hangs, webpage never loads
  • If you now try to record a CPU profile it will kill node and log the error below

Tested v10.16.3 and v8.16.1 which both work fine. Possibly related to #29592?

internal/util/inspect.js:423
function getCtxStyle(value, constructor, tag) {
                    ^

RangeError: Maximum call stack size exceeded
    at getCtxStyle (internal/util/inspect.js:423:21)
    at formatRaw (internal/util/inspect.js:764:29)
    at formatValue (internal/util/inspect.js:567:10)
    at formatProperty (internal/util/inspect.js:1371:11)
    at formatRaw (internal/util/inspect.js:761:9)
    at formatValue (internal/util/inspect.js:567:10)
    at formatProperty (internal/util/inspect.js:1371:11)
    at formatRaw (internal/util/inspect.js:761:9)
    at formatValue (internal/util/inspect.js:567:10)
    at inspect (internal/util/inspect.js:221:10)
    at getConstructorName (internal/util/inspect.js:375:49)
    at formatRaw (internal/util/inspect.js:573:23)
    at formatValue (internal/util/inspect.js:567:10)
    at formatProperty (internal/util/inspect.js:1371:11)
    at formatRaw (internal/util/inspect.js:761:9)
    at formatValue (internal/util/inspect.js:567:10)
    at formatProperty (internal/util/inspect.js:1371:11)
    at formatRaw (internal/util/inspect.js:761:9)
    at formatValue (internal/util/inspect.js:567:10)
    at formatProperty (internal/util/inspect.js:1371:11)
    at formatRaw (internal/util/inspect.js:761:9)
    at formatValue (internal/util/inspect.js:567:10)
    at inspect (internal/util/inspect.js:221:10)
    at getConstructorName (internal/util/inspect.js:375:49)
    at formatRaw (internal/util/inspect.js:573:23)
    at formatValue (internal/util/inspect.js:567:10)
    at formatProperty (internal/util/inspect.js:1371:11)
    at formatRaw (internal/util/inspect.js:761:9)
    at formatValue (internal/util/inspect.js:567:10)
    at formatProperty (internal/util/inspect.js:1371:11)
    at formatRaw (internal/util/inspect.js:761:9)
    at formatValue (internal/util/inspect.js:567:10)
    at formatProperty (internal/util/inspect.js:1371:11)
    at formatRaw (internal/util/inspect.js:761:9)
    at formatValue (internal/util/inspect.js:567:10)
    at inspect (internal/util/inspect.js:221:10)
    at getConstructorName (internal/util/inspect.js:375:49)
    at formatRaw (internal/util/inspect.js:573:23)
    at formatValue (internal/util/inspect.js:567:10)
    at formatProperty (internal/util/inspect.js:1371:11)
    at formatRaw (internal/util/inspect.js:761:9)
    at formatValue (internal/util/inspect.js:567:10)
    at formatProperty (internal/util/inspect.js:1371:11)
    at formatRaw (internal/util/inspect.js:761:9)
    at formatValue (internal/util/inspect.js:567:10)
    at formatProperty (internal/util/inspect.js:1371:11)
    at formatRaw (internal/util/inspect.js:761:9)
    at formatValue (internal/util/inspect.js:567:10)
    at inspect (internal/util/inspect.js:221:10)
    at getConstructorName (internal/util/inspect.js:375:49)
    at formatRaw (internal/util/inspect.js:573:23)
    at formatValue (internal/util/inspect.js:567:10)
    at inspect (internal/util/inspect.js:221:10)
    at getConstructorName (internal/util/inspect.js:375:49)
    at formatRaw (internal/util/inspect.js:573:23)
    at formatValue (internal/util/inspect.js:567:10)
    at formatProperty (internal/util/inspect.js:1371:11)
    at formatRaw (internal/util/inspect.js:761:9)
    at formatValue (internal/util/inspect.js:567:10)
    at formatProperty (internal/util/inspect.js:1371:11)
    at formatRaw (internal/util/inspect.js:761:9)
    at formatValue (internal/util/inspect.js:567:10)
    at formatProperty (internal/util/inspect.js:1371:11)
    at formatRaw (internal/util/inspect.js:761:9)
    at formatValue (internal/util/inspect.js:567:10)
    at inspect (internal/util/inspect.js:221:10)
    at getConstructorName (internal/util/inspect.js:375:49)
    at formatRaw (internal/util/inspect.js:573:23)
    at formatValue (internal/util/inspect.js:567:10)
    at inspect (internal/util/inspect.js:221:10)
    at getConstructorName (internal/util/inspect.js:375:49)
    at formatRaw (internal/util/inspect.js:573:23)
    at formatValue (internal/util/inspect.js:567:10)
    at formatProperty (internal/util/inspect.js:1371:11)
    at formatRaw (internal/util/inspect.js:761:9)
    at formatValue (internal/util/inspect.js:567:10)
    at formatProperty (internal/util/inspect.js:1371:11)
    at formatRaw (internal/util/inspect.js:761:9)
    at formatValue (internal/util/inspect.js:567:10)
    at formatProperty (internal/util/inspect.js:1371:11)
    at formatRaw (internal/util/inspect.js:761:9)
    at formatValue (internal/util/inspect.js:567:10)
    at inspect (internal/util/inspect.js:221:10)
    at getConstructorName (internal/util/inspect.js:375:49)
    at formatRaw (internal/util/inspect.js:573:23)
    at formatValue (internal/util/inspect.js:567:10)
    at inspect (internal/util/inspect.js:221:10)
    at getConstructorName (internal/util/inspect.js:375:49)
    at formatRaw (internal/util/inspect.js:573:23)
    at formatValue (internal/util/inspect.js:567:10)
    at formatProperty (internal/util/inspect.js:1371:11)
    at formatRaw (internal/util/inspect.js:761:9)
    at formatValue (internal/util/inspect.js:567:10)
    at formatProperty (internal/util/inspect.js:1371:11)
    at formatRaw (internal/util/inspect.js:761:9)
    at formatValue (internal/util/inspect.js:567:10)
    at formatProperty (internal/util/inspect.js:1371:11)
    at formatRaw (internal/util/inspect.js:761:9)
    at formatValue (internal/util/inspect.js:567:10)
    at inspect (internal/util/inspect.js:221:10)
    at getConstructorName (internal/util/inspect.js:375:49)
    at formatRaw (internal/util/inspect.js:573:23)
    at formatValue (internal/util/inspect.js:567:10)
    at inspect (internal/util/inspect.js:221:10)
    at getConstructorName (internal/util/inspect.js:375:49)
    at formatRaw (internal/util/inspect.js:573:23)
    at formatValue (internal/util/inspect.js:567:10)
    at formatProperty (internal/util/inspect.js:1371:11)
    at formatRaw (internal/util/inspect.js:761:9)
    at formatValue (internal/util/inspect.js:567:10)
    at formatProperty (internal/util/inspect.js:1371:11)
    at formatRaw (internal/util/inspect.js:761:9)
    at formatValue (internal/util/inspect.js:567:10)
    at formatProperty (internal/util/inspect.js:1371:11)
    at formatRaw (internal/util/inspect.js:761:9)
    at formatValue (internal/util/inspect.js:567:10)
    at inspect (internal/util/inspect.js:221:10)
    at getConstructorName (internal/util/inspect.js:375:49)
    at formatRaw (internal/util/inspect.js:573:23)
    at formatValue (internal/util/inspect.js:567:10)
    at inspect (internal/util/inspect.js:221:10)
    at getConstructorName (internal/util/inspect.js:375:49)
    at formatRaw (internal/util/inspect.js:573:23)
    at formatValue (internal/util/inspect.js:567:10)
    at formatProperty (internal/util/inspect.js:1371:11)
    at formatRaw (internal/util/inspect.js:761:9)
    at formatValue (internal/util/inspect.js:567:10)
    at formatProperty (internal/util/inspect.js:1371:11)
    at formatRaw (internal/util/inspect.js:761:9)
    at formatValue (internal/util/inspect.js:567:10)
    at formatProperty (internal/util/inspect.js:1371:11)
    at formatRaw (internal/util/inspect.js:761:9)
    at formatValue (internal/util/inspect.js:567:10)
    at inspect (internal/util/inspect.js:221:10)
    at getConstructorName (internal/util/inspect.js:375:49)
    at formatRaw (internal/util/inspect.js:573:23)
    at formatValue (internal/util/inspect.js:567:10)
    at inspect (internal/util/inspect.js:221:10)
    at getConstructorName (internal/util/inspect.js:375:49)
    at formatRaw (internal/util/inspect.js:573:23)
    at formatValue (internal/util/inspect.js:567:10)
    at formatProperty (internal/util/inspect.js:1371:11)
    at formatRaw (internal/util/inspect.js:761:9)
    at formatValue (internal/util/inspect.js:567:10)
    at formatProperty (internal/util/inspect.js:1371:11)
    at formatRaw (internal/util/inspect.js:761:9)
    at formatValue (internal/util/inspect.js:567:10)
    at formatProperty (internal/util/inspect.js:1371:11)
    at formatRaw (internal/util/inspect.js:761:9)
    at formatValue (internal/util/inspect.js:567:10)
    at inspect (internal/util/inspect.js:221:10)
    at getConstructorName (internal/util/inspect.js:375:49)
    at formatRaw (internal/util/inspect.js:573:23)
    at formatValue (internal/util/inspect.js:567:10)
    at inspect (internal/util/inspect.js:221:10)
    at getConstructorName (internal/util/inspect.js:375:49)
    at formatRaw (internal/util/inspect.js:573:23)
    at formatValue (internal/util/inspect.js:567:10)
    at formatProperty (internal/util/inspect.js:1371:11)
    at formatRaw (internal/util/inspect.js:761:9)
    at formatValue (internal/util/inspect.js:567:10)
    at formatProperty (internal/util/inspect.js:1371:11)
    at formatRaw (internal/util/inspect.js:761:9)
    at formatValue (internal/util/inspect.js:567:10)
    at formatProperty (internal/util/inspect.js:1371:11)
    at formatRaw (internal/util/inspect.js:761:9)
    at formatValue (internal/util/inspect.js:567:10)
    at inspect (internal/util/inspect.js:221:10)
    at getConstructorName (internal/util/inspect.js:375:49)
    at formatRaw (internal/util/inspect.js:573:23)
    at formatValue (internal/util/inspect.js:567:10)
    at inspect (internal/util/inspect.js:221:10)
    at getConstructorName (internal/util/inspect.js:375:49)
    at formatRaw (internal/util/inspect.js:573:23)
    at formatValue (internal/util/inspect.js:567:10)
    at formatProperty (internal/util/inspect.js:1371:11)
    at formatRaw (internal/util/inspect.js:761:9)
    at formatValue (internal/util/inspect.js:567:10)
    at formatProperty (internal/util/inspect.js:1371:11)
    at formatRaw (internal/util/inspect.js:761:9)
    at formatValue (internal/util/inspect.js:567:10)
    at formatProperty (internal/util/inspect.js:1371:11)
    at formatRaw (internal/util/inspect.js:761:9)
    at formatValue (internal/util/inspect.js:567:10)
    at inspect (internal/util/inspect.js:221:10)
    at getConstructorName (internal/util/inspect.js:375:49)
    at formatRaw (internal/util/inspect.js:573:23)
    at formatValue (internal/util/inspect.js:567:10)
    at inspect (internal/util/inspect.js:221:10)
    at getConstructorName (internal/util/inspect.js:375:49)
    at formatRaw (internal/util/inspect.js:573:23)
    at formatValue (internal/util/inspect.js:567:10)
    at formatProperty (internal/util/inspect.js:1371:11)
    at formatRaw (internal/util/inspect.js:761:9)
    at formatValue (internal/util/inspect.js:567:10)
    at formatProperty (internal/util/inspect.js:1371:11)
    at formatRaw (internal/util/inspect.js:761:9)
    at formatValue (internal/util/inspect.js:567:10)
    at formatProperty (internal/util/inspect.js:1371:11)
FATAL ERROR: 
node::inspector::Agent::ToggleAsyncHook Cannot toggle Inspector's AsyncHook, please report this.
 1: 0x9bcb80 node::Abort() [node]
 2: 0x9bdd16 node::OnFatalError(char const*, char const*) [node]
 3: 0x9bde09  [node]
 4: 0xa90108  [node]
 5: 0x116f8c4 v8_inspector::V8Debugger::setAsyncCallStackDepth(v8_inspector::V8DebuggerAgentImpl*, int) [node]
 6: 0x1178361 v8_inspector::V8DebuggerAgentImpl::disable() [node]
 7: 0x125a268 v8_inspector::protocol::Debugger::DispatcherImpl::disable(int, v8_inspector::String16 const&, v8_inspector::protocol::ProtocolMessage const&, std::unique_ptr<v8_inspector::protocol::DictionaryValue, std::default_delete<v8_inspector::protocol::DictionaryValue> >, v8_inspector::protocol::ErrorSupport*) [node]
 8: 0x1268978 v8_inspector::protocol::Debugger::DispatcherImpl::dispatch(int, v8_inspector::String16 const&, v8_inspector::protocol::ProtocolMessage const&, std::unique_ptr<v8_inspector::protocol::DictionaryValue, std::default_delete<v8_inspector::protocol::DictionaryValue> >) [node]
 9: 0x124c1e2 v8_inspector::protocol::UberDispatcher::dispatch(int, v8_inspector::String16 const&, std::unique_ptr<v8_inspector::protocol::Value, std::default_delete<v8_inspector::protocol::Value> >, v8_inspector::protocol::ProtocolMessage const&) [node]
10: 0x1190682 v8_inspector::V8InspectorSessionImpl::dispatchProtocolMessage(v8_inspector::StringView const&) [node]
11: 0xa8b74e  [node]
12: 0xaac94d  [node]
13: 0xaaaece  [node]
14: 0xaab242  [node]
15: 0xc7405b v8::internal::Isolate::InvokeApiInterruptCallbacks() [node]
16: 0xc61165 v8::internal::StackGuard::HandleInterrupts() [node]
17: 0xfc9417 v8::internal::Runtime_StackGuard(int, unsigned long*, v8::internal::Isolate*) [node]
18: 0x134e879  [node]
@addaleax addaleax added the util Issues and PRs related to the built-in util module. label Sep 21, 2019
@addaleax
Copy link
Member

/cc @BridgeAR

@BridgeAR
Copy link
Member

I am looking into it. Inspection of some options is not working as intended. Seems like the prototype inspection is missing a recursion end condition.

These seem problematic:

VueComponent.$root.$options.components
VueComponent.$root.$options.directives
VueComponent.$root.$options.filters

@Trott Trott closed this as completed in 1fa4037 Sep 24, 2019
BridgeAR added a commit that referenced this issue Sep 24, 2019
This makes sure prototypes won't be inspected infinitely for some
obscure object creations. The depth is now taken into account and
the recursion ends when the depth limit is reached.

PR-URL: #29647
Fixes: #29646
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
BridgeAR added a commit that referenced this issue Sep 25, 2019
This makes sure prototypes won't be inspected infinitely for some
obscure object creations. The depth is now taken into account and
the recursion ends when the depth limit is reached.

PR-URL: #29647
Fixes: #29646
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
util Issues and PRs related to the built-in util module.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants