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 100 forks source link

Installation failed under centos7 #290

Closed fudgelin closed 2 years ago

fudgelin commented 5 years ago
[root@vm llnode]# cat /proc/version
Linux version 3.10.0-123.20.1.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.2 20140120 (Red Hat 4.8.2-16) (GCC) ) #1 SMP Thu Jan 29 18:05:33 UTC 2015

[root@vm llnode]# node -v
v8.9.1

[root@vm llnode]# npm install -g llnode

> llnode@2.2.0 preinstall /usr/local/node-v8.9.1-linux-x64/lib/node_modules/llnode
> node scripts/configure.js

Build dir is: /usr/local/node-v8.9.1-linux-x64/lib/node_modules/llnode
Looking for lldb executable...
Found lldb executable /usr/bin/lldb

Reading lldb version...
Installing llnode for /usr/bin/lldb, lldb version 3.4

Looking for llvm-config for lldb 3.4...
No llvm-config found

Looking for headers for lldb 3.4...
Found lldb headers in /usr/include

Looking for shared libraries for lldb 3.4...
From ldd: /usr/bin/lldb loads /usr/lib64/llvm/liblldb.so
Found liblldb.so in /usr/lib64/llvm
fs.js:646
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: EACCES: permission denied, open 'config.gypi'
    at Object.fs.openSync (fs.js:646:18)
    at Object.fs.writeFileSync (fs.js:1291:33)
    at writeConfig (/usr/local/node-v8.9.1-linux-x64/lib/node_modules/llnode/scripts/configure.js:117:6)
    at main (/usr/local/node-v8.9.1-linux-x64/lib/node_modules/llnode/scripts/configure.js:14:3)
    at Object.<anonymous> (/usr/local/node-v8.9.1-linux-x64/lib/node_modules/llnode/scripts/configure.js:20:1)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! llnode@2.2.0 preinstall: `node scripts/configure.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the llnode@2.2.0 preinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-08-28T02_13_53_916Z-debug.log
bnoordhuis commented 5 years ago

Start npm with --unsafe-perm. npm by default drops privileges before executing llnode's build script.

fudgelin commented 5 years ago

@bnoordhuis thanks.but i have a new problem.

[root@vm ~]# npm install --unsafe-perm -g llnode

> llnode@2.2.0 preinstall /usr/local/node-v8.9.1-linux-x64/lib/node_modules/llnode
> node scripts/configure.js

Build dir is: /usr/local/node-v8.9.1-linux-x64/lib/node_modules/llnode
Looking for lldb executable...
Found lldb executable /usr/bin/lldb

Reading lldb version...
Installing llnode for /usr/bin/lldb, lldb version 3.4

Looking for llvm-config for lldb 3.4...
No llvm-config found

Looking for headers for lldb 3.4...
Found lldb headers in /usr/include

Looking for shared libraries for lldb 3.4...
From ldd: /usr/bin/lldb loads /usr/lib64/llvm/liblldb.so
Found liblldb.so in /usr/lib64/llvm
Writing config.gypi:
{
  "variables": {
    "lldb_lib_dir%": "/usr/lib64/llvm",
    "lldb_lib%": "lldb",
    "lldb_include_dir%": "/usr/include",
    "build_addon": "false",
    "coverage": "false"
  }
}
Writing llnode.js shortcut to /usr/local/node-v8.9.1-linux-x64/lib/node_modules/llnode/llnode.js
/usr/local/node-v8.9.1-linux-x64/bin/llnode -> /usr/local/node-v8.9.1-linux-x64/lib/node_modules/llnode/llnode.js

> llnode@2.2.0 install /usr/local/node-v8.9.1-linux-x64/lib/node_modules/llnode
> node scripts/install.js

make: Entering directory `/usr/local/node-v8.9.1-linux-x64/lib/node_modules/llnode/build'
  CXX(target) Release/obj.target/plugin/src/constants.o
../src/constants.cc: In function ‘T llnode::ReadSymbolFromTarget(lldb::SBTarget&, lldb::SBAddress&, const char*, llnode::Error&)’:
../src/constants.cc:20:10: error: ‘class lldb::SBTarget’ has no member named ‘ReadMemory’
   target.ReadMemory(start, &res, sizeof(T), sberr);
          ^
make: *** [Release/obj.target/plugin/src/constants.o] Error 1
make: Leaving directory `/usr/local/node-v8.9.1-linux-x64/lib/node_modules/llnode/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/node-v8.9.1-linux-x64/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 3.10.0-957.5.1.el7.x86_64
gyp ERR! command "/usr/local/node-v8.9.1-linux-x64/bin/node" "/usr/local/node-v8.9.1-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/node-v8.9.1-linux-x64/lib/node_modules/llnode
gyp ERR! node -v v8.9.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! llnode@2.2.0 install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the llnode@2.2.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-08-30T02_19_58_817Z-debug.log
bnoordhuis commented 5 years ago

You need lldb 3.9 or newer. Check the readme for more details.

If upgrading lldb isn't an option for you, you could try installing an old version of llnode. I don't remember off the top of my head what release supported 3.4 but I'm pretty sure none of the v2.x releases do.

stringang commented 2 years ago

@bnoordhuis you got me out of a jam, thanks.

No9 commented 2 years ago

Closing this as it's stale and has a valid response - Please open a new issue if this re-occurs.