Hello All,
I'm trying to understand why the following code would break on an
upgrade from v8 3.3 to 3.9. The code segfaults when creating a new
handle_scope, if I remove the handle scope inside the while loop it
will run but will quickly run out of memory. The segfault i'm
receiving is:
#0 0x00007fffecdc8942 in
v8::internal::HandleScope::DeleteExtensions(v8::internal::Isolate*) ()
from
#1 0x00007fffecd43117 in render::engine::(anonymous
namespace)::threadLoaded (data=<value optimized out>) at engine.cpp:
411
#2 0x00000000004b857c in ink_thread_trampoline (data=<value optimized
out>) at InkIOCoreAPI.cc:116
#3 0x0000003b93a077e1 in start_thread () from /lib64/libpthread.so.0
#4 0x0000003b936e68ed in clone () from /lib64/libc.so.6
The code is as follows:
v8::Isolate* isolate = v8::Isolate::New();
v8::Isolate::Scope isolate_scope(isolate); // enter isolate
v8::Locker locker(isolate);
v8::HandleScope handle_scope;
v8::Persistent<v8::Context> context = v8::Context::New();
v8::Context::Scope context_scope(context); // enter base context
// do some stuff
while (true) {
// Create a new context
v8::HandleScope per_request_handle_scope;
v8::Persistent<v8::Context> per_request_context =
v8::Context::New();
v8::Context::Scope
per_request_context_scope(per_request_context); // enter context
// do some stuff
per_request_context.Dispose(); // As always, dispose of the
context..
} /*
--
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users