TooTallNate/node-weak

Broken on node master (soon to be Node 10)

mcollina opened this issue · 4 comments

This module is currently failing on node citgm, very likely because of some V8 updates. This module will stop working in the next Node.js major if it is not updated.

Full log:

       > weak@1.0.1 install /home/iojs/build/workspace/citgm-smoker/nodes/ppcbe-ubuntu1404/citgm_tmp/fb64afdd-19f8-4b35-9a26-3cbb28572c55/weak
 > node-gyp rebuild
 make: Entering directory `/home/iojs/build/workspace/citgm-smoker/nodes/ppcbe-ubuntu1404/citgm_tmp/fb64afdd-19f8-4b35-9a26-3cbb28572c55/weak/build'
   CXX(target) Release/obj.target/weakref/src/weakref.o
   SOLINK_MODULE(target) Release/obj.target/weakref.node
   COPY Release/weakref.node
 make: Leaving directory `/home/iojs/build/workspace/citgm-smoker/nodes/ppcbe-ubuntu1404/citgm_tmp/fb64afdd-19f8-4b35-9a26-3cbb28572c55/weak/build'
 added 20 packages in 8.163s
 > weak@1.0.1 test /home/iojs/build/workspace/citgm-smoker/nodes/ppcbe-ubuntu1404/citgm_tmp/fb64afdd-19f8-4b35-9a26-3cbb28572c55/weak
 > mocha -gc --reporter spec
   weak()
     Buffer
       ✓ should invoke callback before destroying Buffer 
   weak()
     garbage collection callback
       ✓ should accept a function as second argument 
       ✓ should invoke the callback before the target is gc'd 
       ✓ should invoke *all* callbacks in the internal "callback" Array 
       ✓ should preempt code for GC callback but not nextTick callbacks 
   callbacks()
     ✓ should return the Weakref's "callback" Array 
   removeCallback()
     ✓ removed callbacks should not be called 
   removeCallbacks()
     ✓ removed callbacks should not be called 
   create()
     ✓ should throw on non-"object" values 
   exports
     ✓ should be a function 
     ✓ should have a function "get" 
     ✓ should have a function "create" 
     ✓ should have a function "isWeakRef" 
     ✓ should have a function "isNearDeath" 
     ✓ should have a function "isDead" 
     ✓ should have a function "callbacks" 
     ✓ should have a function "addCallback" 
     ✓ should have a function "removeCallback" 
     ✓ should have a function "removeCallbacks" 
     ✓ should be a circular reference to "create" 
   Weakref
     ✓ weak() should return a `Weakref` instance 
     ✓ should proxy named gets to the target 
     ✓ should proxy named sets to the target 
     ✓ should proxy named deletes to the target 
     ✓ should proxy indexed gets to the target 
     ✓ should proxy indexed sets to the target 
     ✓ should proxy indexed deletes to the target 
 #
 # Fatal error in ../deps/v8/src/keys.cc, line 481
 # Check failed: element->ToUint32(&number).
 #
 Trace/breakpoint trap (core dumped)
 npm ERR! Test failed.  See above for more details.

Reduced test case:

var weak = require('./')
var o = { a: 'a' };
var r = weak(o);
Object.keys(r)

Debug stack trace:

#0  0x0000000001597fd9 in v8::base::OS::Abort() ()
#1  0x00000000015941fb in V8_Fatal(char const*, int, char const*, ...) ()
#2  0x0000000000f1c393 in v8::internal::(anonymous namespace)::CollectInterceptorKeysInternal(v8::internal::Handle<v8::internal::JSReceiver>, v8::internal::Handle<v8::internal::JSObject>, v8::internal::Handle<v8::internal::InterceptorInfo>, v8::internal::KeyAccumulator*, v8::internal::(anonymous namespace)::IndexedOrNamed) ()
#3  0x0000000000f1d741 in v8::internal::KeyAccumulator::CollectOwnElementIndices(v8::internal::Handle<v8::internal::JSReceiver>, v8::internal::Handle<v8::internal::JSObject>) ()
#4  0x0000000000f1ea0a in v8::internal::KeyAccumulator::CollectOwnKeys(v8::internal::Handle<v8::internal::JSReceiver>, v8::internal::Handle<v8::internal::JSObject>) ()
#5  0x0000000000f1f715 in v8::internal::KeyAccumulator::CollectKeys(v8::internal::Handle<v8::internal::JSReceiver>, v8::internal::Handle<v8::internal::JSReceiver>) ()
#6  0x0000000000f1fad0 in v8::internal::KeyAccumulator::GetKeys(v8::internal::Handle<v8::internal::JSReceiver>, v8::internal::KeyCollectionMode, v8::internal::PropertyFilter, v8::internal::GetKeysConversion, bool) ()
#7  0x00000000010ed562 in v8::internal::Runtime_ObjectKeys(int, v8::internal::Object**, v8::internal::Isolate*) ()
``
lxe commented

Is this module even going to be possible after NearDeath deprecation?

v8/v8@06193b0