llnode
llnode copied to clipboard
Segmentation fault with `v8 findrefs -s` on master with aborted process inside lldb
- Version: llnode master, node v8.11.1
- Platform: OS X (10.13.4)
- Subsystem: findrefs
Sometimes I'm getting a Segmentation Fault when I try to use v8 findrefs -s on master. Weirest thing is most of the times it just work, making this one a little tricky to track down. Creating an issue to remind myself to look into it later.
Example:
index.js
class Lero {
constructor() {
this.lala = {};
}
}
class Lira {
constructor() {
this.lele = {};
}
}
const lero = new Lero();
function foo() {
const lero2 = new Lero();
boom();
}
foo();
llnode results
$ ./llnode.sh node
(lldb) target create "node"
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/usr/local/Cellar/python@2/2.7.14_3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 52, in <module>
import weakref
File "/usr/local/Cellar/python@2/2.7.14_3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/weakref.py", line 14, in <module>
from _weakref import (
ImportError: cannot import name _remove_dead_weakref
Current executable set to 'node' (x86_64).
(lldb) plugin load /Users/mmarchini/workspace/sthima/llnode/llnode.dylib
(lldb) settings set prompt '(llnode) '
(llnode) r --abort-on-uncaught-exception index.js
Process 69150 launched: '/Users/mmarchini/.nvm/versions/node/v8.11.1/bin/node' (x86_64)
Uncaught ReferenceError: boom is not defined
FROM
foo (/Users/mmarchini/workspace/sthima/llnode/index.js:1:1)
Object.<anonymous> (/Users/mmarchini/workspace/sthima/llnode/index.js:1:1)
Module._compile (module.js:1:1)
Object.Module._extensions..js (module.js:1:1)
Module.load (module.js:1:1)
tryModuleLoad (module.js:1:1)
Function.Module._load (module.js:1:1)
Function.Module.runMain (module.js:1:1)
startup (bootstrap_node.js:1:1)
bootstrap_node.js:1:1
Process 69150 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
frame #0: 0x0000000100b07942 node`v8::base::OS::Abort() + 18
node`v8::base::OS::Abort:
-> 0x100b07942 <+18>: ud2
0x100b07944 <+20>: nopw %cs:(%rax,%rax)
node`v8::base::OS::DebugBreak:
0x100b07950 <+0>: pushq %rbp
0x100b07951 <+1>: movq %rsp, %rbp
Target 0: (node) stopped.
(llnode) v8 findrefs -s lala
./llnode.sh: line 17: 69148 Segmentation fault: 11 lldb --one-line "plugin load $LLNODE_PLUGIN" --one-line "settings set prompt '(llnode) '" $@
Not sure if it's related but I've also hit some segmentation faults when trying to inspect objects with some huge core dumps. Haven't looked into it too much.