kuno / GeoIP

GeoIP binding for nodejs(>=0.10) and iojs
GNU Lesser General Public License v2.1
414 stars 129 forks source link

Doesn't build with nodejs 6.1.0 #91

Open arzeth opened 8 years ago

arzeth commented 8 years ago
  CXX(target) Release/obj.target/native/src/global.o
In file included from ../src/global.h:10:0,
                 from ../src/global.cc:7:
../node_modules/nan/nan.h:590:20: error: variable or field ‘AddGCEpilogueCallback’ declared void
       v8::Isolate::GCEpilogueCallback callback
                    ^~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:590:7: error: ‘GCEpilogueCallback’ is not a member of ‘v8::Isolate’
       v8::Isolate::GCEpilogueCallback callback
       ^~
../node_modules/nan/nan.h:591:18: error: expected primary-expression before ‘gc_type_filter’
     , v8::GCType gc_type_filter = v8::kGCTypeAll) {
                  ^~~~~~~~~~~~~~
../node_modules/nan/nan.h:596:20: error: variable or field ‘RemoveGCEpilogueCallback’ declared void
       v8::Isolate::GCEpilogueCallback callback) {
                    ^~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:596:7: error: ‘GCEpilogueCallback’ is not a member of ‘v8::Isolate’
       v8::Isolate::GCEpilogueCallback callback) {
       ^~
../node_modules/nan/nan.h:601:20: error: variable or field ‘AddGCPrologueCallback’ declared void
       v8::Isolate::GCPrologueCallback callback
                    ^~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:601:7: error: ‘GCPrologueCallback’ is not a member of ‘v8::Isolate’
       v8::Isolate::GCPrologueCallback callback
       ^~
../node_modules/nan/nan.h:602:18: error: expected primary-expression before ‘gc_type_filter’
     , v8::GCType gc_type_filter = v8::kGCTypeAll) {
                  ^~~~~~~~~~~~~~
../node_modules/nan/nan.h:607:20: error: variable or field ‘RemoveGCPrologueCallback’ declared void
       v8::Isolate::GCPrologueCallback callback) {
                    ^~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:607:7: error: ‘GCPrologueCallback’ is not a member of ‘v8::Isolate’
       v8::Isolate::GCPrologueCallback callback) {
       ^~

But I can build it if I change the dependency "nan": "~2.1.0" to "nan": "~2.3.0" in package.json. But then it crashes (on Debian Jessie x86_64 and Arch Linux x86_32) with multiple almost the same stacktraces (i.e., the following one has 2: native::NetSpeedCell::Init(v8::Local<v8::Object>), other stacktraces have another lines) like this one:

test4@DebianLinux:~/geoip$ node index.js 
(node) v8::ObjectTemplate::Set() with non-primitive values is deprecated
(node) and will stop working in the next major release.

==== JS stack trace =========================================

Security context: 0x3ac1469c9fa9 <JS Object>#0#
    1: .node [module.js:568] [pc=0x8988fa4f544] (this=0x351acc0b98f9 <an Object with map 0x36e300617871>#1#,module=0x351acc0d2639 <a Module with map 0x36e300617e49>#2#,filename=0x351acc0d2599 <String[43]: /home/test4/geoip/build/Release/native.node>)
    2: load [module.js:456] [pc=0x8988fa39db2] (this=0x351acc0d2639 <a Module with map 0x36e300617e49>#2#,filename=0x351acc0d2599 <String[43]: /home/test4/geoip/build/Release/native.node>)
    3: tryModuleLoad(aka tryModuleLoad) [module.js:415] [pc=0x8988fa398dd] (this=0x3ac146904189 <undefined>,module=0x351acc0d2639 <a Module with map 0x36e300617e49>#2#,filename=0x351acc0d2599 <String[43]: /home/test4/geoip/build/Release/native.node>)
    4: _load [module.js:407] [pc=0x8988fa35522] (this=0x351acc0777d9 <JS Function Module (SharedFunctionInfo 0x363ef84295f1)>#3#,request=0x351acc0d16e1 <String[43]: /home/test4/geoip/build/Release/native.node>,parent=0x351acc0c4271 <a Module with map 0x36e300617e49>#4#,isMain=0x3ac146904299 <false>)
    5: require [module.js:466] [pc=0x8988fa43a13] (this=0x351acc0c4271 <a Module with map 0x36e300617e49>#4#,path=0x351acc0d16e1 <String[43]: /home/test4/geoip/build/Release/native.node>)
    6: require(aka require) [internal/module.js:20] [pc=0x8988fa43746] (this=0x3ac146904189 <undefined>,path=0x351acc0d16e1 <String[43]: /home/test4/geoip/build/Release/native.node>)
    7: bindings [/home/test4/geoip/node_modules/bindings/bindings.js:76] [pc=0x8988fa4a596] (this=0x3ac1469e7531 <JS Global Object>#5#,opts=0x363ef8459459 <String[11]: native.node>)
    8: /* anonymous */ [/home/test4/geoip/index.js:4] [pc=0x8988fa42c11] (this=0x351acc0bc601 <an Object with map 0x2c999c507bc9>#6#,exports=0x351acc0bc601 <an Object with map 0x2c999c507bc9>#6#,require=0x351acc0be911 <JS Function require (SharedFunctionInfo 0x363ef845a199)>#7#,module=0x351acc0bc509 <a Module with map 0x36e300617e49>#8#,__filename=0x351acc0bc479 <String[26]: /home/test4/geoip/index.js>,__dirname=0x351acc0be839 <String[17]: /home/test4/geoip>)
    9: _compile [module.js:541] [pc=0x8988fa42884] (this=0x351acc0bc509 <a Module with map 0x36e300617e49>#8#,content=0x351acc0bdcc1 <String[996]\: var path  = require('path'),\n    read  = require('fs').readFileSync;\n\nvar binding = require('bindings')('native.node');\n\nvar version  = JSON.parse(read(path.resolve(__dirname, './package.json'))).version;\n\n// Native classes\nexports.native = binding;\n\n// Libraries\nexports.NetSpeedCell = require('./lib/netspeedcell');\nexports.NetSpeed     = require('./lib/netspeed');\nexports.Country6     = require('./lib/country6');\nexports.Country      = require('./lib/country');\nexports.Region       = require('./lib/region');\nexports.City6        = require('./lib/city6');\nexports.City         = require('./lib/city');\nexports.Org          = require('./lib/org');\n\n// Utilities\nexports.check       = binding.check;\nexports.isString    = binding.isString;\nexports.utils       = {\n    check: binding.check,\n    isString: binding.isString\n}\n\n// Versions\nexports.version  = 'v' + version;\nexports.libgeoip = 'v' + binding.libgeoip;\nexports.versions = {\n    'geoip': version,\n    'libgeoip': binding.libgeoip\n};\n>,filename=0x351acc0bc479 <String[26]: /home/test4/geoip/index.js>)
   10: .js [module.js:550] [pc=0x8988fa3b3ab] (this=0x351acc0b98f9 <an Object with map 0x36e300617871>#1#,module=0x351acc0bc509 <a Module with map 0x36e300617e49>#8#,filename=0x351acc0bc479 <String[26]: /home/test4/geoip/index.js>)
   11: load [module.js:456] [pc=0x8988fa39db2] (this=0x351acc0bc509 <a Module with map 0x36e300617e49>#8#,filename=0x351acc0bc479 <String[26]: /home/test4/geoip/index.js>)
   12: tryModuleLoad(aka tryModuleLoad) [module.js:415] [pc=0x8988fa398dd] (this=0x3ac146904189 <undefined>,module=0x351acc0bc509 <a Module with map 0x36e300617e49>#8#,filename=0x351acc0bc479 <String[26]: /home/test4/geoip/index.js>)
   13: _load [module.js:407] [pc=0x8988fa35522] (this=0x351acc0777d9 <JS Function Module (SharedFunctionInfo 0x363ef84295f1)>#3#,request=0x351acc0721b1 <String[26]: /home/test4/geoip/index.js>,parent=0x3ac146904101 <null>,isMain=0x3ac146904231 <true>)
   14: runMain [module.js:575] [pc=0x8988fa34fea] (this=0x351acc0777d9 <JS Function Module (SharedFunctionInfo 0x363ef84295f1)>#3#)
   15: startup(aka startup) [node.js:160] [pc=0x8988f9408a2] (this=0x3ac146904189 <undefined>)
   16: /* anonymous */(aka /* anonymous */) [node.js:445] [pc=0x8988f93e4f2] (this=0x3ac146904101 <null>,process=0x3ac1469e36d1 <a process with map 0x2c999c511151>#9#)
=====================

==== C stack trace ===============================

 1: v8::Template::Set(v8::Local<v8::Name>, v8::Local<v8::Data>, v8::PropertyAttribute)
 2: native::NetSpeedCell::Init(v8::Local<v8::Object>)
 3: 0x7fd25edbafe4
 4: node::DLOpen(v8::FunctionCallbackInfo<v8::Value> const&)
 5: v8::internal::FunctionCallbackArguments::Call(void (*)(v8::FunctionCallbackInfo<v8::Value> const&))
 6: 0x9a29ec
 7: 0x9a2f8d
 8: 0x8988f90961b
kkoopa commented 8 years ago

That is not a crash.

konklone commented 7 years ago

Crash or not, is there any resolution for this?

jimmy9065 commented 6 years ago

Confirmed this. Tested nodejs6 and it worked. But it doesn't work with any version from either nodejs6 or nodejs8.