Hi,

i try to extend v8 and everytime i end up in a segmentation fault.

here is the code:
https://gist.github.com/anonymous/54334744f14864c9b242#file-gistfile1-cpp-L69

Line 69 ends up in a segmentation fault (debugged using GCC) but i have no 
idea why.


here is my gdb output:

Breakpoint 1 at 0x56afee: file /home/dev/proj/cpp/v8example/modul_point.cc, 
line 61.
(gdb) c
Continuing.
[New Thread 0x7f61b7c3e700 (LWP 16397)]
[New Thread 0x7f61b7c23700 (LWP 16398)]
[New Thread 0x7f61b7c12700 (LWP 16399)]
[New Thread 0x7f61b7c01700 (LWP 16400)]

Breakpoint 1, modul_point::addToV8Scope (scope=0x7fffd1594d30) at 
/home/dev/proj/cpp/v8example/modul_point.cc:61
61 tpl->InstanceTemplate()->SetInternalFieldCount(1);
(gdb) n
67 Local<String> s = String::NewSymbol("getPosX");
(gdb) 
68 Local<FunctionTemplate> f = FunctionTemplate::New(&getPosX);
(gdb) s
Handle (this=<optimized out>) at /home/dev/Downloads/v8/include/v8.h:242
242  V8_INLINE(Handle()) : val_(0) {}
(gdb) 
modul_point::addToV8Scope (scope=0x7fffd1594d30) at 
/home/dev/proj/cpp/v8example/modul_point.cc:68
68 Local<FunctionTemplate> f = FunctionTemplate::New(&getPosX);
(gdb) 
69 Local<Function> fi = f->GetFunction();
(gdb) p *f
Could not find operator*.
(gdb) p f
$1 = {<v8::Handle<v8::FunctionTemplate>> = {val_ = 0x16178f0}, <No data 
fields>}
(gdb) p f
$2 = {<v8::Handle<v8::FunctionTemplate>> = {val_ = 0x16178f0}, <No data 
fields>}
(gdb) p Handle
No symbol "Handle" in current context.
(gdb) p f
$3 = {<v8::Handle<v8::FunctionTemplate>> = {val_ = 0x16178f0}, <No data 
fields>}
(gdb) p f.val_
$4 = (v8::FunctionTemplate *) 0x16178f0
(gdb) p *f.val_
$5 = {<v8::Template> = {<v8::Data> = {<No data fields>}, <No data fields>}, 
<No data fields>}
(gdb) p f.val_
$6 = (v8::FunctionTemplate *) 0x16178f0
(gdb) n

Program received signal SIGSEGV, Segmentation fault.
0x00000000006a6db5 in v8::internal::Isolate::native_context() ()


is it up to: V8_INLINE(Handle()) : val_(0) {} ?

-- 
-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to