node-segfault-handler icon indicating copy to clipboard operation
node-segfault-handler copied to clipboard

Gyp Error

Open svkaushik17 opened this issue 8 years ago • 6 comments

Below is the error I'm getting in segfault-handler. My node version is v0.10.25.

npm http 304 https://registry.npmjs.org/nan

[email protected] install /home/kaushik/gitRepo/scxml/node_modules/segfault-handler node-gyp rebuild

gyp http GET https://nodejs.org/dist/v0.10.25/node-v0.10.25.tar.gz gyp http 200 https://nodejs.org/dist/v0.10.25/node-v0.10.25.tar.gz gyp http GET https://nodejs.org/dist/v0.10.25/SHASUMS256.txt gyp http 200 https://nodejs.org/dist/v0.10.25/SHASUMS256.txt make: Entering directory /home/kaushik/gitRepo/scxml/node_modules/segfault-handler/build' CXX(target) Release/obj.target/segfault-handler/src/segfault-handler.o ../src/segfault-handler.cpp:61:30: error: ‘CopyablePersistentTraits’ is not a member of ‘v8’ v8::Persistent<Function, v8::CopyablePersistentTraits<Function> >* callback; ^ ../src/segfault-handler.cpp:61:30: note: suggested alternatives: In file included from ../node_modules/nan/nan.h:313:0, from ../src/segfault-handler.cpp:2: ../node_modules/nan/nan_persistent_pre_12_inl.h:129:8: note: ‘Nan::CopyablePersistentTraits’ struct CopyablePersistentTraits { ^ ../node_modules/nan/nan_persistent_pre_12_inl.h:129:8: note: ‘Nan::CopyablePersistentTraits’ ../src/segfault-handler.cpp:61:30: error: ‘CopyablePersistentTraits’ is not a member of ‘v8’ v8::Persistent<Function, v8::CopyablePersistentTraits<Function> >* callback; ^ ../src/segfault-handler.cpp:61:30: note: suggested alternatives: In file included from ../node_modules/nan/nan.h:313:0, from ../src/segfault-handler.cpp:2: ../node_modules/nan/nan_persistent_pre_12_inl.h:129:8: note: ‘Nan::CopyablePersistentTraits’ struct CopyablePersistentTraits { ^ ../node_modules/nan/nan_persistent_pre_12_inl.h:129:8: note: ‘Nan::CopyablePersistentTraits’ ../src/segfault-handler.cpp:61:67: error: wrong number of template arguments (2, should be 1) v8::Persistent<Function, v8::CopyablePersistentTraits<Function> >* callback; ^ In file included from /home/kaushik/.node-gyp/0.10.25/src/node.h:62:0, from ../node_modules/nan/nan.h:47, from ../src/segfault-handler.cpp:2: /home/kaushik/.node-gyp/0.10.25/deps/v8/include/v8.h:107:26: error: provided for ‘template<class T> class v8::Persistent’ template <class T> class Persistent; ^ ../src/segfault-handler.cpp:61:69: error: expected unqualified-id before ‘>’ token v8::Persistent<Function, v8::CopyablePersistentTraits<Function> >* callback; ^ ../src/segfault-handler.cpp:69:44: error: ‘CopyablePersistentTraits’ is not a member of ‘v8’ callback_args(v8::Persistent<Function, v8::CopyablePersistentTraits<Function> >* callback, void * const* stack, size_t stack_size, int signo, long addr) : ^ ../src/segfault-handler.cpp:69:44: note: suggested alternatives: In file included from ../node_modules/nan/nan.h:313:0, from ../src/segfault-handler.cpp:2: ../node_modules/nan/nan_persistent_pre_12_inl.h:129:8: note: ‘Nan::CopyablePersistentTraits’ struct CopyablePersistentTraits { ^ ../node_modules/nan/nan_persistent_pre_12_inl.h:129:8: note: ‘Nan::CopyablePersistentTraits’ ../src/segfault-handler.cpp:69:44: error: ‘CopyablePersistentTraits’ is not a member of ‘v8’ callback_args(v8::Persistent<Function, v8::CopyablePersistentTraits<Function> >* callback, void * const* stack, size_t stack_size, int signo, long addr) : ^ ../src/segfault-handler.cpp:69:44: note: suggested alternatives: In file included from ../node_modules/nan/nan.h:313:0, from ../src/segfault-handler.cpp:2: ../node_modules/nan/nan_persistent_pre_12_inl.h:129:8: note: ‘Nan::CopyablePersistentTraits’ struct CopyablePersistentTraits { ^ ../node_modules/nan/nan_persistent_pre_12_inl.h:129:8: note: ‘Nan::CopyablePersistentTraits’ ../src/segfault-handler.cpp:69:81: error: wrong number of template arguments (2, should be 1) callback_args(v8::Persistent<Function, v8::CopyablePersistentTraits<Function> >* callback, void * const* stack, size_t stack_size, int signo, long addr) : ^ In file included from /home/kaushik/.node-gyp/0.10.25/src/node.h:62:0, from ../node_modules/nan/nan.h:47, from ../src/segfault-handler.cpp:2: /home/kaushik/.node-gyp/0.10.25/deps/v8/include/v8.h:107:26: error: provided for ‘template<class T> class v8::Persistent’ template <class T> class Persistent; ^ ../src/segfault-handler.cpp:69:83: error: expected ‘,’ or ‘...’ before ‘>’ token callback_args(v8::Persistent<Function, v8::CopyablePersistentTraits<Function> >* callback, void * const* stack, size_t stack_size, int signo, long addr) : ^ ../src/segfault-handler.cpp:83:28: error: ‘CopyablePersistentTraits’ is not a member of ‘v8’ v8::Persistent<Function, v8::CopyablePersistentTraits<Function> > callback; ^ ../src/segfault-handler.cpp:83:28: note: suggested alternatives: In file included from ../node_modules/nan/nan.h:313:0, from ../src/segfault-handler.cpp:2: ../node_modules/nan/nan_persistent_pre_12_inl.h:129:8: note: ‘Nan::CopyablePersistentTraits’ struct CopyablePersistentTraits { ^ ../node_modules/nan/nan_persistent_pre_12_inl.h:129:8: note: ‘Nan::CopyablePersistentTraits’ ../src/segfault-handler.cpp:83:28: error: ‘CopyablePersistentTraits’ is not a member of ‘v8’ v8::Persistent<Function, v8::CopyablePersistentTraits<Function> > callback; ^ ../src/segfault-handler.cpp:83:28: note: suggested alternatives: In file included from ../node_modules/nan/nan.h:313:0, from ../src/segfault-handler.cpp:2: ../node_modules/nan/nan_persistent_pre_12_inl.h:129:8: note: ‘Nan::CopyablePersistentTraits’ struct CopyablePersistentTraits { ^ ../node_modules/nan/nan_persistent_pre_12_inl.h:129:8: note: ‘Nan::CopyablePersistentTraits’ ../src/segfault-handler.cpp:83:65: error: wrong number of template arguments (2, should be 1) v8::Persistent<Function, v8::CopyablePersistentTraits<Function> > callback; ^ In file included from /home/kaushik/.node-gyp/0.10.25/src/node.h:62:0, from ../node_modules/nan/nan.h:47, from ../src/segfault-handler.cpp:2: /home/kaushik/.node-gyp/0.10.25/deps/v8/include/v8.h:107:26: error: provided for ‘template<class T> class v8::Persistent’ template <class T> class Persistent; ^ ../src/segfault-handler.cpp:83:67: error: expected unqualified-id before ‘>’ token v8::Persistent<Function, v8::CopyablePersistentTraits<Function> > callback; ^ ../src/segfault-handler.cpp: In constructor ‘callback_helper::callback_args::callback_args(int)’: ../src/segfault-handler.cpp:70:5: error: class ‘callback_helper::callback_args’ does not have any field named ‘callback’ callback(callback), stack(backtrace_symbols(stack, stack_size)), stack_size(stack_size), signo(signo), addr(addr) { ^ ../src/segfault-handler.cpp:70:14: error: ‘callback’ was not declared in this scope callback(callback), stack(backtrace_symbols(stack, stack_size)), stack_size(stack_size), signo(signo), addr(addr) { ^ ../src/segfault-handler.cpp:70:66: error: invalid conversion from ‘char**’ to ‘void* const*’ [-fpermissive] callback(callback), stack(backtrace_symbols(stack, stack_size)), stack_size(stack_size), signo(signo), addr(addr) { ^ In file included from ../src/segfault-handler.cpp:22:0: /usr/include/execinfo.h:32:15: error: initializing argument 1 of ‘char** backtrace_symbols(void* const*, int)’ [-fpermissive] extern char **backtrace_symbols (void *const *__array, int __size) ^ ../src/segfault-handler.cpp:69:5: warning: ‘callback_helper::callback_args::stack_size’ is initialized with itself [-Winit-self] callback_args(v8::Persistent<Function, v8::CopyablePersistentTraits<Function> >* callback, void * const* stack, size_t stack_size, int signo, long addr) : ^ ../src/segfault-handler.cpp:69:5: warning: ‘callback_helper::callback_args::signo’ is initialized with itself [-Winit-self] ../src/segfault-handler.cpp:69:5: warning: ‘callback_helper::callback_args::addr’ is initialized with itself [-Winit-self] ../src/segfault-handler.cpp: In constructor ‘callback_helper::callback_helper(v8::Handle<v8::Function>)’: ../src/segfault-handler.cpp:88:5: error: ‘callback’ was not declared in this scope callback.Reset(isolate, func); ^ ../src/segfault-handler.cpp:94:59: error: invalid conversion from ‘void (*)(uv_async_t*) {aka void (*)(uv_async_s*)}’ to ‘uv_async_cb {aka void (*)(uv_async_s*, int)}’ [-fpermissive] uv_async_init(uv_default_loop(), handle, make_callback); ^ In file included from ../node_modules/nan/nan.h:46:0, from ../src/segfault-handler.cpp:2: /home/kaushik/.node-gyp/0.10.25/deps/uv/include/uv.h:1186:15: error: initializing argument 3 of ‘int uv_async_init(uv_loop_t*, uv_async_t*, uv_async_cb)’ [-fpermissive] UV_EXTERN int uv_async_init(uv_loop_t*, uv_async_t* async, ^ ../src/segfault-handler.cpp: In destructor ‘callback_helper::~callback_helper()’: ../src/segfault-handler.cpp:99:5: error: ‘callback’ was not declared in this scope callback.Reset(); ^ ../src/segfault-handler.cpp: In member function ‘void callback_helper::send(void* const*, size_t, int, long int)’: ../src/segfault-handler.cpp:107:46: error: ‘callback’ was not declared in this scope callback_args* args = new callback_args(&callback, stack, stack_size, signo, addr); ^ ../src/segfault-handler.cpp: In static member function ‘static void callback_helper::make_callback(uv_async_t*)’: ../src/segfault-handler.cpp:141:34: error: no matching function for call to ‘v8::HandleScope::HandleScope(v8::Isolate*&)’ v8::HandleScope scope(isolate); ^ ../src/segfault-handler.cpp:141:34: note: candidates are: In file included from /home/kaushik/.node-gyp/0.10.25/src/node.h:62:0, from ../node_modules/nan/nan.h:47, from ../src/segfault-handler.cpp:2: /home/kaushik/.node-gyp/0.10.25/deps/v8/include/v8.h:473:3: note: v8::HandleScope::HandleScope(const v8::HandleScope&) HandleScope(const HandleScope&); ^ /home/kaushik/.node-gyp/0.10.25/deps/v8/include/v8.h:473:3: note: no known conversion for argument 1 from ‘v8::Isolate*’ to ‘const v8::HandleScope&’ /home/kaushik/.node-gyp/0.10.25/deps/v8/include/v8.h:448:3: note: v8::HandleScope::HandleScope() HandleScope(); ^ /home/kaushik/.node-gyp/0.10.25/deps/v8/include/v8.h:448:3: note: candidate expects 0 arguments, 1 provided ../src/segfault-handler.cpp:149:65: error: no matching function for call to ‘v8::Array::New(v8::Isolate*&, size_t&)’ Local<Array> argStack = Array::New(isolate, args->stack_size); ^ ../src/segfault-handler.cpp:149:65: note: candidate is: In file included from /home/kaushik/.node-gyp/0.10.25/src/node.h:62:0, from ../node_modules/nan/nan.h:47, from ../src/segfault-handler.cpp:2: /home/kaushik/.node-gyp/0.10.25/deps/v8/include/v8.h:1758:32: note: static v8::Local<v8::Array> v8::Array::New(int) V8EXPORT static Local<Array> New(int length = 0); ^ /home/kaushik/.node-gyp/0.10.25/deps/v8/include/v8.h:1758:32: note: candidate expects 1 argument, 2 provided ../src/segfault-handler.cpp:151:24: error: ‘NewFromUtf8’ is not a member of ‘v8::String’ argStack->Set(i, String::NewFromUtf8(isolate, args->stack[i])); ^ ../src/segfault-handler.cpp:155:61: error: no matching function for call to ‘v8::Number::New(v8::Isolate*&, int&)’ Local<Value> argv[3] = {Number::New(isolate, args->signo), Number::New(isolate, args->addr), argStack}; ^ ../src/segfault-handler.cpp:155:61: note: candidate is: In file included from /home/kaushik/.node-gyp/0.10.25/src/node.h:62:0, from ../node_modules/nan/nan.h:47, from ../src/segfault-handler.cpp:2: /home/kaushik/.node-gyp/0.10.25/deps/v8/include/v8.h:1377:33: note: static v8::Local<v8::Number> v8::Number::New(double) V8EXPORT static Local<Number> New(double value); ^ /home/kaushik/.node-gyp/0.10.25/deps/v8/include/v8.h:1377:33: note: candidate expects 1 argument, 2 provided ../src/segfault-handler.cpp:155:95: error: no matching function for call to ‘v8::Number::New(v8::Isolate*&, long int&)’ Local<Value> argv[3] = {Number::New(isolate, args->signo), Number::New(isolate, args->addr), argStack}; ^ ../src/segfault-handler.cpp:155:95: note: candidate is: In file included from /home/kaushik/.node-gyp/0.10.25/src/node.h:62:0, from ../node_modules/nan/nan.h:47, from ../src/segfault-handler.cpp:2: /home/kaushik/.node-gyp/0.10.25/deps/v8/include/v8.h:1377:33: note: static v8::Local<v8::Number> v8::Number::New(double) V8EXPORT static Local<Number> New(double value); ^ /home/kaushik/.node-gyp/0.10.25/deps/v8/include/v8.h:1377:33: note: candidate expects 1 argument, 2 provided ../src/segfault-handler.cpp:158:42: error: ‘struct callback_helper::callback_args’ has no member named ‘callback’ Local<Function>::New(isolate, *args->callback)->Call(isolate->GetCurrentContext()->Global(), 3, argv); ^ ../src/segfault-handler.cpp:158:67: error: ‘class v8::Isolate’ has no member named ‘GetCurrentContext’ Local<Function>::New(isolate, *args->callback)->Call(isolate->GetCurrentContext()->Global(), 3, argv); ^ make: *** [Release/obj.target/segfault-handler/src/segfault-handler.o] Error 1 make: Leaving directory/home/kaushik/gitRepo/scxml/node_modules/segfault-handler/build' gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/node-gyp/lib/build.js:276:23) gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:797:12) gyp ERR! System Linux 3.13.0-32-generic gyp ERR! command "node" "/usr/local/bin/node-gyp" "rebuild" gyp ERR! cwd /home/kaushik/gitRepo/scxml/node_modules/segfault-handler gyp ERR! node -v v0.10.25 gyp ERR! node-gyp -v v3.4.0 gyp ERR! not ok npm WARN This failure might be due to the use of legacy binary "node" npm WARN For further explanations, please read /usr/share/doc/nodejs/README.Debian

npm ERR! weird error 1 npm ERR! not ok code 0

svkaushik17 avatar Aug 05 '16 19:08 svkaushik17

+1, node v.6.3.1

pkantsedalov avatar Aug 13 '16 11:08 pkantsedalov

Hi @svkaushik17 Thanks for logging this issue - I think the npm issue is correctt as v0.10 is no longer supported npm WARN This failure might be due to the use of legacy binary "node" I would strongly recommend upgrading to 4.x releases as soon as possible.

@pkantsedalov My 6.3.1 build is working fine Can you provide more information please.

No9 avatar Aug 14 '16 11:08 No9

@No9 Thanks, I've already done with it - works fine.

pkantsedalov avatar Aug 14 '16 11:08 pkantsedalov

Hi @No9, I got gyp error when 'npm install segfault-handler' with node v6.9.1.

[email protected] install /opt/tutorconsoleplus/node_modules/segfault-handler node-gyp rebuild

Traceback (most recent call last): File "/opt/node-v6.9.1-linux-x64/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 16, in sys.exit(gyp.script_main()) File "/opt/node-v6.9.1-linux-x64/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/init.py", line 545, in script_main return main(sys.argv[1:]) File "/opt/node-v6.9.1-linux-x64/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/init.py", line 538, in main return gyp_main(args) File "/opt/node-v6.9.1-linux-x64/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/init.py", line 514, in gyp_main options.duplicate_basename_check) File "/opt/node-v6.9.1-linux-x64/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/init.py", line 130, in Load params['parallel'], params['root_targets']) File "/opt/node-v6.9.1-linux-x64/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 2775, in Load variables, includes, depth, check, True) File "/opt/node-v6.9.1-linux-x64/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 391, in LoadTargetBuildFile includes, True, check) File "/opt/node-v6.9.1-linux-x64/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 243, in LoadOneBuildFile None) File "binding.gyp", line 1 { ^ SyntaxError: invalid syntax gyp ERR! configure error gyp ERR! stack Error: gyp failed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (/opt/node-v6.9.1-linux-x64/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:305:16) gyp ERR! stack at emitTwo (events.js:106:13) gyp ERR! stack at ChildProcess.emit (events.js:191:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12) gyp ERR! System Linux 2.6.32-642.6.2.el6.x86_64 gyp ERR! command "/opt/node-v6.9.1-linux-x64/bin/node" "/opt/node-v6.9.1-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /opt/tutorconsoleplus/node_modules/segfault-handler gyp ERR! node -v v6.9.1 gyp ERR! node-gyp -v v3.4.0 gyp ERR! not ok npm WARN [email protected] No repository field. npm ERR! Linux 2.6.32-642.6.2.el6.x86_64 npm ERR! argv "/opt/node-v6.9.1-linux-x64/bin/node" "/opt/node-v6.9.1-linux-x64/bin/npm" "install" "segfault-handler" "--save" npm ERR! node v6.9.1 npm ERR! npm v3.10.9 npm ERR! code ELIFECYCLE npm ERR! [email protected] install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'. 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 segfault-handler package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-gyp rebuild npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs segfault-handler npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls segfault-handler npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /opt/tutorconsoleplus/npm-debug.log

DiegoHuang avatar Nov 16 '16 08:11 DiegoHuang

Hey @DiegoHuang This part of the error looks suspicious File "binding.gyp", line 1 { can make sure the binding.gyp in your install looks like the one in this repo? https://github.com/ddopson/node-segfault-handler/blob/master/binding.gyp If it does can you rerun node-gyp rebuild in the segfault-handler directory Thanks

No9 avatar Nov 16 '16 12:11 No9

@No9 @DiegoHuang I happened to run into this same issue, it looks like the binding.gyp in the repo has windows style line endings, and the \r character after the { is confusing gyp's parsing. I found that if I replace all the \r\n with just \n, it solves the issue. I don't know much about gyp, so not sure if that's the fix you want to check in, tho.

bemjb avatar Jan 06 '17 20:01 bemjb