Hello everyone,
I am getting below core dump stack while trying parallelization of Java script's execution in C++ application by forking child processes in the main program. Below is the code snippet of a v8 helloworld.cc program in which v8 engine has been initialized, created V8 isolate in the main program and executed one java script, later on there is fork() call which creates child process to execute another java script. *Version of V8: 6.4.388* *Questions:* *1) **Why is it dumping core in Child Process? * *2) **Is there a way to achieve this scenario?* *Core Dump stack trace:* (gdb) where #0 0x00007f4a18d4c9bf in raise () from /lib64/libpthread.so.0 #10x00007f4a033052cf in skgesigOSCrash () from libclntsh.so.19.1 #2 0x00007f4a039e7dbd in kpeDbgSignalHandler () from libclntsh.so.19.1 #3 0x00007f4a033055d2 in skgesig_sigactionHandler () from libclntsh.so.19.1 #4 <signal handler called> #5 0x00007f4a18d434c0 in __pthread_timedjoin_ex () from /lib64/libpthread.so.0 #6 0x00007f4a2c4b6837 in v8::platform::WorkerThread::~WorkerThread() () from libv8_libplatform.so #7 0x00007f4a2c4b6849 in v8::platform::WorkerThread::~WorkerThread() () from libv8_libplatform.so #8 0x00007f4a2c4aebae in v8::platform::DefaultBackgroundTaskRunner::Terminate() () from libv8_libplatform.so #9 0x00007f4a2c4b1c1e in v8::platform::DefaultPlatform::~DefaultPlatform() () from libv8_libplatform.so #10 0x00007f4a2c4b1dd9 in v8::platform::DefaultPlatform::~DefaultPlatform() () from libv8_libplatform.so #11 0x00007f4a17e1eb0c in __run_exit_handlers () from /lib64/libc.so.6 #12 0x00007f4a17e1ec40 in exit () from /lib64/libc.so.6 #13 0x0000000000402b60 in ?? () #14 0x00007f4a17e08493 in __libc_start_main () from /lib64/libc.so.6 #15 0x00000000004034de in ?? () (gdb) quit *Code Snippet:* #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include "libplatform/libplatform.h" #include "v8.h" std::unique_ptr<v8::Platform> platform = NULL; v8::Isolate* isolate = NULL ; int main(int argc, char* argv[]) { v8::V8::InitializeICUDefaultLocation(argv[0]); v8::V8::InitializeExternalStartupData(argv[0]); platform = v8::platform::NewDefaultPlatform(); v8::V8::InitializePlatform(platform.get()); v8::V8::Initialize(); v8::Isolate::CreateParams create_params; create_params.array_buffer_allocator = v8::ArrayBuffer::Allocator::NewDefaultAllocator(); isolate = v8::Isolate::New(create_params); { v8::Isolate::Scope isolate_scope(isolate); v8::HandleScope handle_scope(isolate); v8::Local<v8::Context> context = v8::Context::New(isolate); v8::Context::Scope context_scope(context); v8::Local<v8::String> source = v8::String::NewFromUtf8(isolate, "'Hello' + ', World!'", v8::NewStringType::kNormal) .ToLocalChecked(); v8::Local<v8::Script> script = v8::Script::Compile(context, source).ToLocalChecked(); v8::Local<v8::Value> result = script->Run(context).ToLocalChecked(); v8::String::Utf8Value utf8(isolate, result); printf("%s\n", *utf8); } //Parallelization Starts here if(fork() == 0) { { v8::Isolate::Scope isolate_scope(isolate); v8::HandleScope handle_scope(isolate); v8::Local<v8::Context> context = v8::Context::New(isolate); v8::Context::Scope context_scope(context); v8::Local<v8::String> source = v8::String::NewFromUtf8(isolate, "'Hello' + ', World!' + 'from Child'", v8::NewStringType::kNormal) .ToLocalChecked(); v8::Local<v8::Script> script = v8::Script::Compile(context, source).ToLocalChecked(); v8::Local<v8::Value> result = script->Run(context).ToLocalChecked(); v8::String::Utf8Value utf8(isolate, result); printf("%s\n", *utf8); } } return 0; } Thanks all !! -- -- v8-users mailing list v8-users@googlegroups.com 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 v8-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/v8-users/baf82e0f-7895-49ee-8050-33a009535d36n%40googlegroups.com.