W dniu poniedziałek, 18 stycznia 2016 09:41:18 UTC+1 użytkownik Ben Noordhuis napisał: > > On Thu, Jan 14, 2016 at 11:35 PM, treck <[email protected] <javascript:>> > wrote: > > I'm trying implement V8 debugger in my Qt application but I get > exception. > > > > I have 2 threads: main (that handle GUI and debugger commands) and > engine > > thread (that run javascript code). > > 1. In main thread i'm initializing V8 by calling > > V8::InitializeICU(); > > > > mPlatform = platform::CreateDefaultPlatform(); > > > > V8::InitializePlatform(mPlatform); > > > > V8::Initialize(); > > 2. I'm creating an isolate in engine thread: > > ArrayBufferAllocator* allocator = new ArrayBufferAllocator(); > > Isolate::CreateParams create_params; > > create_params.array_buffer_allocator = allocator; > > isolate = Isolate::New(create_params); > > 3. In main thread I'm using SetMessageHandler > > isolate->Enter(); > > v8::Debug::SetMessageHandler(HandleMessage); > > > > // HandlMessage function: > > void HandleMessage(const v8::Debug::Message& message) { > > v8::String::Utf8Value response(message.GetJSON()); > > // TODO do something with |response| > > } > > > > 4. At line with SetMessageHandler I get read access violation > > Here is call stack > > > > > > Thanks in advance! > > The stack trace suggests a stack overflow happened (the call to > Isolate::StackOverflow() from Genesis::Genesis) while creating the > debug context. > > It suggests the thread's stack is too small but that could be a red > herring because you don't appear to be using a v8::Locker to > synchronize access to the isolate. >
> don't appear to be using a v8::Locker to synchronize access to the isolate. Yes, this was the reason of my problem. Also, there was a missing of isolate->Exit() after v8::Debug:: SetMessageHandler(HandleMessage); Thanks, now it works. -- -- 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/d/optout.
