ddopson / node-segfault-handler

Tool for debugging native Node.js modules and getting stack traces when things go wrong.
BSD 3-Clause "New" or "Revised" License
319 stars 74 forks source link

registerHandler is not a function in Ubuntu 14.04 LTS #53

Open k7k0 opened 6 years ago

k7k0 commented 6 years ago

The binary segfault-handler.node is not building correctly on my ubuntu 14.04, it's showing the zmq API instead of registerHandler/causeSegfault

cat /etc/lsb-release

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.5 LTS"

node-gyp rebuild

gyp info it worked if it ends with ok
gyp info using node-gyp@3.7.0
gyp info using node@8.4.0 | linux | x64
gyp info spawn /usr/bin/python2
gyp info spawn args [ '/lib/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/tmp/segfault-handler/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/root/.node-gyp/nsolid-8.4.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/root/.node-gyp/nsolid-8.4.0',
gyp info spawn args   '-Dnode_gyp_dir=/lib/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/root/.node-gyp/nsolid-8.4.0/<(target_arch)/nsolid.lib',
gyp info spawn args   '-Dmodule_root_dir=/tmp/segfault-handler',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory `/tmp/segfault-handler/build'
  CXX(target) Release/obj.target/segfault-handler/src/segfault-handler.o
  SOLINK_MODULE(target) Release/obj.target/segfault-handler.node
  COPY Release/segfault-handler.node
make: Leaving directory `/tmp/segfault-handler/build'
gyp info ok

node -e "require('./build/Release/segfault-handler.node').registerHandler('test')"

require('./build/Release/segfault-handler.node').registerHandler('test')
                                                 ^
TypeError: require(...).registerHandler is not a function
    at [eval]:1:50
    at ContextifyScript.Script.runInThisContext (vm.js:44:33)
    at Object.runInThisContext (vm.js:116:38)
    at Object.<anonymous> ([eval]-wrapper:6:22)
    at Module._compile (module.js:625:30)
    at evalScript (bootstrap_node.js:486:27)
    at startup (bootstrap_node.js:171:9)
    at bootstrap_node.js:632:3

node -e "console.log(require('./build/Release/segfault-handler.node'))"

{ ZMQ_CAN_DISCONNECT: 1,
  ZMQ_CAN_UNBIND: 1,
  ZMQ_CAN_MONITOR: 1,
  ZMQ_CAN_SET_CTX: 1,
  ZMQ_PUB: 1,
  ZMQ_SUB: 2,
  ZMQ_XPUB: 9,
  ZMQ_XSUB: 10,
  ZMQ_REQ: 3,
  ZMQ_XREQ: 5,
  ZMQ_REP: 4,
  ZMQ_XREP: 6,
  ZMQ_DEALER: 5,
  ZMQ_ROUTER: 6,
  ZMQ_PUSH: 8,
  ZMQ_PULL: 7,
  ZMQ_PAIR: 0,
  ZMQ_STREAM: 11,
  ZMQ_POLLIN: 1,
  ZMQ_POLLOUT: 2,
  ZMQ_POLLERR: 4,
  ZMQ_SNDMORE: 2,
  STATE_READY: 0,
  STATE_BUSY: 1,
  STATE_CLOSED: 2,
  zmqVersion: [Function: zmqVersion],
  zmqCurveKeypair: [Function: zmqCurveKeypair],
  Context: [Function],
  SocketBinding: [Function] }

The same happens building using npm install segfault-handler