Hey there!

I am trying to kick off a v8 instance in a separate thread. But when I do that, 
I get a crash about the used isolate. Here is the debugger output:


 $ lldb ./out/Debug/node
Current executable set to './out/Debug/node' (x86_64).
(lldb) run
Process 1163 launched: './out/Debug/node' (x86_64)
...
Args: ./out/Debug/node


#
# Fatal error in ../../deps/v8/src/v8threads.cc, line 48
# CHECK(isolate != __null) failed
#

==== C stack trace ===============================

 1: ??
 2: ??
 3: ??
 4: ??
 5: ??
 6: ??
 7: ??
 8: ??
 9: ??
Process 1163 stopped
* thread #2: tid = 0x213e41, 0x0000000100836755 
node`v8::internal::OS::DebugBreak() + 5 at platform-posix.cc:294, stop reason = 
EXC_BREAKPOINT (code=EXC_I386_BPT, subcode=0x0)
    frame #0: 0x0000000100836755 node`v8::internal::OS::DebugBreak() + 5 at 
platform-posix.cc:294
   291  #else
   292  #error Unsupported host architecture.
   293  #endif
-> 294  }
   295  
   296  
   297  // 
----------------------------------------------------------------------------
(lldb) bt
* thread #2: tid = 0x213e41, 0x0000000100836755 
node`v8::internal::OS::DebugBreak() + 5 at platform-posix.cc:294, stop reason = 
EXC_BREAKPOINT (code=EXC_I386_BPT, subcode=0x0)
    frame #0: 0x0000000100836755 node`v8::internal::OS::DebugBreak() + 5 at 
platform-posix.cc:294
    frame #1: 0x0000000100836749 node`v8::internal::OS::Abort() + 25 at 
platform-posix.cc:270
    frame #2: 0x0000000100309532 node`V8_Fatal(file=0x000000010099ac09, 
line=48, format=0x000000010094ae90) + 498 at checks.cc:107
    frame #3: 0x0000000100761667 
node`v8::Locker::Initialize(this=0x00000001017c9e88, 
isolate=0x0000000000000000) + 71 at v8threads.cc:48
    frame #4: 0x000000010001e73d 
node`v8::Locker::Locker(this=0x00000001017c9e88, isolate=0x0000000000000000) + 
29 at v8.h:5214
    frame #5: 0x000000010001dd6d 
node`v8::Locker::Locker(this=0x00000001017c9e88, isolate=0x0000000000000000) + 
29 at v8.h:5214
    frame #6: 0x000000010001c4bf node`node::Start(argc=1, 
argv=0x0000000101900000) + 159 at node.cc:3540
    frame #7: 0x0000000100001139 node`runner(data=0x0000000000000000) + 89 at 
node_main.cc:75
    frame #8: 0x00007fff8f8fd899 libsystem_pthread.dylib`_pthread_body + 138
    frame #9: 0x00007fff8f8fd72a libsystem_pthread.dylib`_pthread_start + 137
    frame #10: 0x00007fff8f901fc9 libsystem_pthread.dylib`thread_start + 13


And the respective code:

struct _Args_t { int arg_c; char** arg_v; } Args;
void* runner(void* data) {
        cout << "Args: " << Args.arg_v[0] << endl;
        
        node::Start(Args.arg_c, Args.arg_v);
        return NULL;
}
int main(int argc, char *argv[]) {  
  // Init the struct.
  Args.arg_c=argc;
  Args.arg_v=(char**)argv;
  cout << "..." << endl;

  pthread_t thatOtherThread;
  pthread_create(&thatOtherThread, NULL, runner, NULL);
  pthread_detach(thatOtherThread);
  sleep(5);
  return 0;
}


Any help would be apriciated! ^_^

Kind regards, Ingwie

-- 
-- 
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.

Reply via email to