nodejs / llnode

An lldb plugin for Node.js and V8, which enables inspection of JavaScript states for insights into Node.js processes and their core dumps.
Other
1.15k stars 99 forks source link

crash when run v8 i -l #346

Closed Jamy325 closed 4 years ago

Jamy325 commented 4 years ago
(llnode) v8 i 0x11af8ff2f819                                        
0x11af8ff2f819:<Array: length=100 {
    [0]=0x124351ab1901:<Object: Object>,
    [1]=0x124351ab1949:<Object: Object>,
    [2]=0x124351ab1991:<Object: Object>,
    [3]=0x124351aafec9:<Object: Object>,
    [4]=0x124351aaff11:<Object: Object>,
    [5]=0x124351aaff59:<Object: Object>,
    [6]=0x124351aaffa1:<Object: Object>,
    [7]=0x124351aaffe9:<Object: Object>,
    [8]=0x124351ab0031:<Object: Object>,
    [9]=0x124351aaed01:<Object: Object>,
    [10]=0x124351aaed49:<Object: Object>,
    [11]=0x124351aaed91:<Object: Object>,
    [12]=0x124351aaedd9:<Object: Object>,
    [13]=0x124351aaee21:<Object: Object>,
    [14]=0x124351aaeb41:<Object: Object>,
    [15]=0x124351aaeb89:<Object: Object>}>

(llnode) v8 i -l 20 0x11af8ff2f819
Stack dump:
0.  Program arguments: /usr/local/bin/lldb --one-line plugin load '/opt/node_modules/llnode/llnode.so' --one-line settings set prompt '(llnode) ' ./node -c n.core.46706 
 #0 0x000000000041daca llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/usr/local/bin/lldb+0x41daca)
 #1 0x000000000041be7a llvm::sys::RunSignalHandlers() (/usr/local/bin/lldb+0x41be7a)
 #2 0x000000000041c25c SignalHandler(int) (/usr/local/bin/lldb+0x41c25c)
 #3 0x00007fc1ef3067e0 __restore_rt (/lib64/libpthread.so.0+0xf7e0)
 #4 0x00007fc1e78dbe72 ____strtoll_l_internal (/lib64/libc.so.6+0x36e72)
 #5 0x00007fc1e41545f6 llnode::ParsePrinterOptions(char**, llnode::Printer::PrinterOptions*) /opt/zm5/game-admin-web/node_modules/llnode/build/../src/llscan.cc:76:0
 #6 0x00007fc1e4139c29 llnode::PrintCmd::DoExecute(lldb::SBDebugger, char**, lldb::SBCommandReturnObject&) /opt/zm5/game-admin-web/node_modules/llnode/build/../src/llnode.cc:187:0
 #7 0x00007fc1e95c66ef CommandPluginInterfaceImplementation::DoExecute(lldb_private::Args&, lldb_private::CommandReturnObject&) (/usr/local/bin/../lib/liblldb.so.11git+0x9aa6ef)
 #8 0x00007fc1e9909ac1 lldb_private::CommandObjectParsed::Execute(char const*, lldb_private::CommandReturnObject&) (/usr/local/bin/../lib/liblldb.so.11git+0xcedac1)
 #9 0x00007fc1e9905b87 lldb_private::CommandInterpreter::HandleCommand(char const*, lldb_private::LazyBool, lldb_private::CommandReturnObject&, lldb_private::ExecutionContext*, bool, bool) (/usr/local/bin/../lib/liblldb.so.11git+0xce9b87)
#10 0x00007fc1e9906f00 lldb_private::CommandInterpreter::IOHandlerInputComplete(lldb_private::IOHandler&, std::string&) (/usr/local/bin/../lib/liblldb.so.11git+0xceaf00)
#11 0x00007fc1e984ea91 lldb_private::IOHandlerEditline::Run() (/usr/local/bin/../lib/liblldb.so.11git+0xc32a91)
#12 0x00007fc1e982ddc4 lldb_private::Debugger::RunIOHandlers() (/usr/local/bin/../lib/liblldb.so.11git+0xc11dc4)
#13 0x00007fc1e98f9807 lldb_private::CommandInterpreter::RunCommandInterpreter(bool, bool, lldb_private::CommandInterpreterRunOptions&) (/usr/local/bin/../lib/liblldb.so.11git+0xcdd807)
#14 0x00007fc1e95fc716 lldb::SBDebugger::RunCommandInterpreter(bool, bool) (/usr/local/bin/../lib/liblldb.so.11git+0x9e0716)
#15 0x000000000040884f Driver::MainLoop() (/usr/local/bin/lldb+0x40884f)
#16 0x0000000000405d32 main (/usr/local/bin/lldb+0x405d32)
#17 0x00007fc1e78c3d1d __libc_start_main (/lib64/libc.so.6+0x1ed1d)
#18 0x0000000000406d71 _start (/usr/local/bin/lldb+0x406d71)
bnoordhuis commented 4 years ago

Thanks for the report. Does this patch fix it for you?

diff --git a/src/llscan.cc b/src/llscan.cc
index 59b792c..a8dd29f 100644
--- a/src/llscan.cc
+++ b/src/llscan.cc
@@ -62,7 +62,7 @@ char** ParsePrinterOptions(char** cmd, Printer::PrinterOptions* options) {
   optind = 0;
   opterr = 1;
   do {
-    int arg = getopt_long(argc, args, "Fmsdvln:", opts, nullptr);
+    int arg = getopt_long(argc, args, "Fmsdvl:n:", opts, nullptr);
     if (arg == -1) break;

     switch (arg) {
mmarchini commented 4 years ago

@Jamy325 should be fixed in the latest version (3.1.0).

Jamy325 commented 4 years ago

Yes, it's works now. Thank you