Read access violation while using v8::Debug::SetMessageHandler
<p>I'm trying implement V8 debugger in my Qt application but I get exception.</p>

<p>I have 2 threads: main (that handle GUI and debugger commands) and engine thread (that run javascript code).</p>

<ol>
<li><p>In main thread i'm initializing V8 by calling:</p>

<pre><code>V8::InitializeICU();
mPlatform = platform::CreateDefaultPlatform();
V8::InitializePlatform(mPlatform);
V8::Initialize();
</code></pre></li>
<li><p>I'm creating an isolate in engine thread:</p>

<pre><code>ArrayBufferAllocator* allocator = new ArrayBufferAllocator();
Isolate::CreateParams create_params;
create_params.array_buffer_allocator = allocator;
isolate = Isolate::New(create_params);
</code></pre></li>
<li><p>In main thread I'm using SetMessageHandler </p>

<pre><code>isolate-&gt;Enter();
v8::Debug::SetMessageHandler(HandleMessage);

// HandlMessage function: 
void HandleMessage(const v8::Debug::Message&amp; message) {
    v8::String::Utf8Value response(message.GetJSON());
    // TODO do something with |response|
}
</code></pre></li>
<li><p>At line with SetMessageHandler I get read access violation</p>

<p>Here is call stack:</p>

<p><a href="https://i.stack.imgur.com/S6OsM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/S6OsM.png" alt="Call stack"></a></p></li>
</ol>

<p>FWIW I'd asked on <a href="https://groups.google.com/forum/#!topic/v8-users/YT3IhM6oI2c" rel="nofollow noreferrer">v8-users</a> discussion group also. (no answers yet)</p>

<p>Thanks in advance!</p>