llnode
llnode copied to clipboard
llnode install fail in centos 6
Hi All, I installed llvm, lldb version 4.0.1 from http://www6.hanicka.net then I've installed fail llnode in centos 6. Please help me to fix it. Bellow is error output:
npm install -g llnode
> [email protected] preinstall /home/.nvm/versions/node/v5.12.0/lib/node_modules/.staging/llnode-15de8904
> node scripts/configure.js
Build dir is: /home/.nvm/versions/node/v5.12.0/lib/node_modules/.staging/llnode-15de8904
Checking for headers, version is 4.0
Installing llnode for /usr/bin/lldb, lldb version 4.0
Linking lldb to include directory /usr
Linking tools/gyp to /home/.nvm/versions/node/v5.12.0/lib/node_modules/npm/node_modules/node-gyp/gyp
/home/.nvm/versions/node/v5.12.0/bin/llnode -> /home/.nvm/versions/node/v5.12.0/lib/node_modules/llnode/scripts/llnode.sh
> [email protected] install /home/.nvm/versions/node/v5.12.0/lib/node_modules/llnode
> ./gyp_llnode && make -C out/
['/home/.nvm/versions/node/v5.12.0/lib/node_modules/llnode/llnode.gyp.json', '-I', '/home/.nvm/versions/node/v5.12.0/lib/node_modules/llnode/common.gypi', '--depth=.', '-f', 'make', '-Goutput_dir=/home/.nvm/versions/node/v5.12.0/lib/node_modules/llnode/out', '--generator-output', '/home/.nvm/versions/node/v5.12.0/lib/node_modules/llnode/out', '-Dgcc_version=47', '-Dclang=0', '-Dhost_arch=x64', '-Dtarget_arch=x64']
make: Entering directory `/home/.nvm/versions/node/v5.12.0/lib/node_modules/llnode/out'
CXX(target) /home/.nvm/versions/node/v5.12.0/lib/node_modules/llnode/out/Release/obj.target/llnode/src/llnode.o
In file included from .././src/llnode.h:8:0,
from ../src/llnode.cc:10:
.././src/llv8.h:68:3: error: ‘llnode::v8::Value::Value(llnode::v8::Value&)’ declared to take non-const reference cannot be defaulted in the class body
In file included from ../src/llnode.cc:10:0:
.././src/llnode.h:19:3: error: looser throw specifier for ‘virtual llnode::BacktraceCmd::~BacktraceCmd()’
.././src/llnode.h:12:7: error: overriding ‘virtual llnode::CommandBase::~CommandBase() noexcept (true)’
.././src/llnode.h:29:3: error: looser throw specifier for ‘virtual llnode::PrintCmd::~PrintCmd()’
.././src/llnode.h:12:7: error: overriding ‘virtual llnode::CommandBase::~CommandBase() noexcept (true)’
.././src/llnode.h:40:3: error: looser throw specifier for ‘virtual llnode::ListCmd::~ListCmd()’
.././src/llnode.h:12:7: error: overriding ‘virtual llnode::CommandBase::~CommandBase() noexcept (true)’
In file included from ../src/llnode.cc:11:0:
.././src/llscan.h:12:3: error: looser throw specifier for ‘virtual llnode::FindObjectsCmd::~FindObjectsCmd()’
In file included from ../src/llnode.cc:10:0:
.././src/llnode.h:12:7: error: overriding ‘virtual llnode::CommandBase::~CommandBase() noexcept (true)’
In file included from ../src/llnode.cc:11:0:
.././src/llscan.h:20:3: error: looser throw specifier for ‘virtual llnode::FindInstancesCmd::~FindInstancesCmd()’
In file included from ../src/llnode.cc:10:0:
.././src/llnode.h:12:7: error: overriding ‘virtual llnode::CommandBase::~CommandBase() noexcept (true)’
In file included from ../src/llnode.cc:11:0:
.././src/llscan.h:31:3: error: looser throw specifier for ‘virtual llnode::NodeInfoCmd::~NodeInfoCmd()’
In file included from ../src/llnode.cc:10:0:
.././src/llnode.h:12:7: error: overriding ‘virtual llnode::CommandBase::~CommandBase() noexcept (true)’
In file included from ../src/llnode.cc:11:0:
.././src/llscan.h:39:3: error: looser throw specifier for ‘virtual llnode::FindReferencesCmd::~FindReferencesCmd()’
In file included from ../src/llnode.cc:10:0:
.././src/llnode.h:12:7: error: overriding ‘virtual llnode::CommandBase::~CommandBase() noexcept (true)’
make: *** [/home/.nvm/versions/node/v5.12.0/lib/node_modules/llnode/out/Release/obj.target/llnode/src/llnode.o] Error 1
make: Leaving directory `/home/.nvm/versions/node/v5.12.0/lib/node_modules/llnode/out'
npm ERR! Linux 2.6.32-504.1.3.el6.x86_64
npm ERR! argv "/home/.nvm/versions/node/v5.12.0/bin/node" "/home/.nvm/versions/node/v5.12.0/bin/npm" "install" "-g" "llnode"
npm ERR! node v5.12.0
npm ERR! npm v3.8.6
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: `./gyp_llnode && make -C out/`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] install script './gyp_llnode && make -C out/'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the llnode package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ./gyp_llnode && make -C out/
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs llnode
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls llnode
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/npm-debug.log
Your compiler is probably too old. If you want to build anything for node.js >= v4.x, you need g++ 4.8 or better (>= 4.9, really.) Install devtoolset and try again.
Also, why are you using node v5.12.0? That's out of support. You should upgrade to v6.x or v8.x.
@bnoordhuis Thank for your help I try install devtoolset-2 with gcc 4.8.2 then reinstall llnode successfully but when i analysis example core dump like this
llnode ~/.nvm/versions/node/v5.12.0/bin/node -c core.29338
I got some error when used llnode command
(lldb) target create "/home/anhlv/.nvm/versions/node/v5.12.0/bin/node" --core "core.29338"
Core file '/home/anhlv/core.29338' (x86_64) was loaded.
(lldb) plugin load /home/anhlv/.nvm/versions/node/v5.12.0/bin/../lib/node_modules/llnode/llnode.so
(lldb) settings set prompt '(llnode) '
(llnode) bt
* thread #1, name = 'node', stop reason = signal SIGSTOP
* frame #0: 0x0000003f2860d930 libpthread.so.0`sem_wait + 48
frame #1: 0x00007fff195f3ea8 node`v8::base::Semaphore::Wait() + 24
frame #2: 0x00007fff19491429 node`v8::platform::TaskQueue::GetNext() + 41
frame #3: 0x00007fff1949157c node`v8::platform::WorkerThread::Run() + 44
frame #4: 0x00007fff195f4e60 node`v8::base::ThreadEntry(void*) + 80
frame #5: 0x0000003f286079d1 libpthread.so.0`start_thread + 209
frame #6: 0x0000003f282e88fd libc.so.6`clone + 109
(llnode) v8 bt
Stack dump:
0. HandleCommand(command = "v8 bt")
/home/anhlv/.nvm/versions/node/v5.12.0/bin/llnode: line 14: 16071 Segmentation fault /usr/bin/lldb --one-line "plugin load $LLNODE_PLUGIN" --one-line "settings set prompt '(llnode) '" $@
- LLDB version is 4.0.1 (problem here?)
PS: I'm using node v5.12.0 because in my production it's stable. Thank for your suggest, I try upgrade node version in my free time
- When I downgrade lldb to 3.9.0, I stuck in
llnode ~/.nvm/versions/node/v5.12.0/bin/node -c core.29338
(lldb) target create "/home/.nvm/versions/node/v5.12.0/bin/node" --core "core.29338"
Hard to say what's going on. Might be a lldb bug, might be a llnode bug. Does it happen when you inspect node v6.x or v8.x?
I've a question, If I dump core in my server running cent os 6. And I download dump file to my local machine (or other machine) like macbook. Can I analysis dump file with llnode in my macbook (same node version)?
That's unlikely to work. I could go into more detail but even if you copy over the node binary from the linux machine and lldb doesn't crash outright, it's still unlikely to produce useful results.
The MacOS builds of lldb can open Linux core dumps without any problems, provided you point it at the right Linux binary. It's how I do a lot of my testing. (I have a Linux virtual machine on my Mac and a shared file system that both machines can see.)
The same isn't true the other way - Mac support isn't compiled into the Linux lldb binaries. (I suspect it's something to do with where the headers are available.) LLDB can't run those binaries on a Mac - although you can use remote debugging against a live process on a Linux machine if you want to.
You do need to download the exact executable that was running when the dump was created, along with the core dump, and supply both to lldb (i.e. lldb ./downloaded_node_binary -c core.1234
). We documented this under Usage here: https://www.npmjs.com/package/llnode
@hhellyer It's going to lack anything from shared libraries and add-ons though.
Yes, we are going to need a 'collector' tool - as we have for Java - to identify and grab libraries
I just tried loading a node binary + core dump that were copied from a freebsd system to a linux machine and lldb 3.9 crashes before I even get to loading llnode. So yeah, YMMV when copying around binaries.
I just tried download extract node executable and stuck in
llnode ~/.nvm/versions/node/v5.12.0/bin/node -c core.29338
(lldb) target create "/home/.nvm/versions/node/v5.12.0/bin/node" --core "core.29338"
with node version v5, v6, v8 and same problem in my macbook, and production server centos 6 I just tried everything. So what should i do? maybe i need to change runtime environment os to ubuntu or freeBsd ...
@vietkute02 Can you do something like:
(lldb) log enable lldb process thread
(lldb) target create <path to you node binary> --core <path to your core>
That should print out the stacktrace of lldb. I have bumped into this before and it's elf-core::CreateRegisterContextForFrame:: Architecture(27) or OS(0) not supported
because lldb can not identify the OS by inspecting the ELF header of the coredump generated by my OS (customized RHEL6, so probably it's the same problem as yours.), according to some comments in lldb's source. In that case the fix needs to be on lldb's side.
@vietkute02 BTW these are the comments explaining why lldb can not identify the OS from the coredumps. You can use readelf -hn <path to core>
to see if your coredump has EI_OSABI
set to System V but without any information about shared libraries in the notes section (compared to one generated by Ubuntu you should see those notes necessary to identify the OS as Linux).
@joyeecheung bellow is lldb log
Process::ControlPrivateStateThread (signal = 4)
thread created
Sending control event of type: 4.
Process::RunPrivateStateThread (arg = 0x7f7f6604f400, pid = 25503) thread starting...
Process::WaitForEventsPrivate (timeout = 0, event_sp)...
Process::RunPrivateStateThread (arg = 0x7f7f6604f400, pid = 25503) got a control event: 4
Process::WaitForEventsPrivate (timeout = 0, event_sp)...
Process::SetPrivateState (stopped)
Process::SetPrivateState (stopped) stop_id = 1
0x7f7f64e08710: tid = 0x63a0: stop info = signal 0 (stop_id = 1)
0x7f7f64d3e2d0: tid = 0x63a1: stop info = signal 0 (stop_id = 1)
0x7f7f64d5fc40: tid = 0x63a2: stop info = signal 0 (stop_id = 1)
0x7f7f64d127f0: tid = 0x63a3: stop info = signal 0 (stop_id = 1)
0x7f7f64d3dae0: tid = 0x6410: stop info = signal 0 (stop_id = 1)
0x7f7f64d3dd70: tid = 0x64ce: stop info = signal 0 (stop_id = 1)
0x7f7f64d14390: tid = 0x64cf: stop info = signal 0 (stop_id = 1)
0x7f7f64d148e0: tid = 0x64d7: stop info = signal 0 (stop_id = 1)
0x7f7f64d14b70: tid = 0x64d8: stop info = signal 0 (stop_id = 1)
0x7f7f64d60300: tid = 0x639f: stop info = signal 0 (stop_id = 1)
Process::ShouldBroadcastEvent: should_resume: 1 state: stopped was_restarted: 0 stop_vote: 0.
Process::ShouldBroadcastEvent (0x7f7f64f07490) Restarting process from state: stopped
Process::PrivateResume() m_stop_id = 1, public state: unloaded private state: stopped
Process::ShouldBroadcastEvent (0x7f7f64f07490) => new state: stopped, last broadcast state: invalid - NO
Process::HandlePrivateEvent (pid = 25503) suppressing state stopped (old state unloaded): should_broadcast == false
Process::WaitForEventsPrivate (timeout = 0, event_sp)...
And ELF header
ELF Header:
Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
Class: ELF64
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: CORE (Core file)
Machine: Advanced Micro Devices X86-64
Version: 0x1
Entry point address: 0x0
Start of program headers: 64 (bytes into file)
Start of section headers: 1173771072 (bytes into file)
Flags: 0x0
Size of this header: 64 (bytes)
Size of program headers: 56 (bytes)
Number of program headers: 237
Size of section headers: 64 (bytes)
Number of section headers: 239
Section header string table index: 238
Is it problem which you describe?
@vietkute02 if you are seeing a hang when you start loading a dump into lldb it may be this problem: https://bugs.llvm.org/show_bug.cgi?id=26322 You need to move up to lldb 4.0 to get the fix for that.
Just looking at the command you are running:
llnode ~/.nvm/versions/node/v5.12.0/bin/node -c core.29338
The first parameter needs to be your downloaded node executable (so it matches the dump). That path looks like an executable in a local node installation, which is not what you need here.
@vietkute02 That looks like a different problem (not a segmentation fault but a hang). For that please try @rnchamberlain's solution, and see if it works with lldb 4.0.