Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

segfault on v0.9.4 with async functions #95

Closed
TooTallNate opened this Issue Dec 15, 2012 · 0 comments

Comments

Projects
None yet
1 participant
Member

TooTallNate commented Dec 15, 2012

test case:

var ref = require('ref')
  , ffi = require('./')
  , assert = require('assert')
  , bindings = require('bindings')({ module_root: __dirname+'/test', bindings: 'ffi_tests' })

var funcPtr = bindings.abs;
var func = ffi.ForeignFunction(funcPtr, 'int', [ 'int' ])

console.error('before async');
func.async(-100, function (err, res) {
  console.error('after async');
  console.error(arguments);
});

gdb:

☮ ~/node-ffi (master) ∴ gdb --args ../node/node_g abs.js 
GNU gdb 6.3.50-20050815 (Apple version gdb-1820) (Sat Jun 16 02:40:11 UTC 2012)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries ...... done

(gdb) run
Starting program: /Users/nrajlich/node/node_g abs.js
Reading symbols for shared libraries +++++........................................................................................................................................ done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
before async


#
# Fatal error in ../deps/v8/src/isolate.h, line 442
# CHECK(isolate != __null) failed
#


Program received signal SIGABRT, Aborted.
[Switching to process 96471 thread 0x2503]
0x00007fff897c5212 in __pthread_kill ()
(gdb) bt full
#0  0x00007fff897c5212 in __pthread_kill ()
No symbol table info available.
#1  0x00007fff8755baf4 in pthread_kill ()
No symbol table info available.
#2  0x00007fff8759fdce in abort ()
No symbol table info available.
#3  0x000000010060eca9 in v8::internal::OS::Abort () at ../deps/v8/src/platform-macos.cc:176
No locals.
#4  0x00000001002358bf in V8_Fatal (file=0x1006ae7be "../deps/v8/src/isolate.h", line=442, format=0x1006acfc7 "CHECK(%s) failed") at ../deps/v8/src/checks.cc:58
No locals.
#5  0x00000001001f7309 in v8::internal::Isolate::Current () at isolate.h:442
    isolate = ('v8::internal::Isolate' *) 0x0
#6  0x00000001002358b2 in V8_Fatal (file=0x1006ae7be "../deps/v8/src/isolate.h", line=442, format=0x1006acfc7 "CHECK(%s) failed") at ../deps/v8/src/checks.cc:55
No locals.
#7  0x00000001001f7309 in v8::internal::Isolate::Current () at isolate.h:442
    isolate = ('v8::internal::Isolate' *) 0x0
#8  0x00000001002358b2 in V8_Fatal (file=0x1006ae7be "../deps/v8/src/isolate.h", line=442, format=0x1006acfc7 "CHECK(%s) failed") at ../deps/v8/src/checks.cc:55
No locals.
#9  0x00000001001f7309 in v8::internal::Isolate::Current () at isolate.h:442
    isolate = ('v8::internal::Isolate' *) 0x0
#10 0x00000001001ee249 in v8::Value::IsObject (this=0x10203a3a0) at ../deps/v8/src/api.cc:2173
No locals.
#11 0x0000000100015370 in node::Buffer::Data (val={val_ = 0x10203a3a0}) at node_buffer.h:76
    data = (void *) 0x10203a3a0
#12 0x00000001010daf71 in FFI::AsyncFFICall (req=0x101504440) at ../src/ffi.cc:338
    fn = 0x102a86e80 "?n?\002\001"
    argv = 0x499e99 <Address 0x499e99 out of bounds>
    p = (AsyncCallParams *) 0x101503350
    cif = 0x306402a87000 <Address 0x306402a87000 out of bounds>
    res = 0x0
#13 0x00000001001defa4 in uv__queue_work (w=0x101504478) at ../deps/uv/src/unix/threadpool.c:198
    req = (uv_work_t *) 0x101504440
#14 0x00000001001df25a in worker (arg=0x0) at ../deps/uv/src/unix/threadpool.c:70
    w = (struct uv__work *) 0x101504478
    q = (ngx_queue_t *) 0x101504490
#15 0x00000001001ce207 in uv__thread_start (ctx_v=0x101502420) at ../deps/uv/src/uv-common.c:285
    entry = (void (*)(void *)) 0x1001df170 <worker>
    arg = (void *) 0x0
    ctx = (struct {...} *) 0x101502420
#16 0x00007fff8755a742 in _pthread_start ()
No symbol table info available.
#17 0x00007fff87547181 in thread_start ()
No symbol table info available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment