1

I developed a Windows Service in C++ that has V8 embedded. The Debug version is working good. The problem is that the Release version is not working at all.

I compiled the V8 engine using VisualStudio 2010 into a static-lib file. I linked the Debug version of the service with V8 debug libs and the Release version of the service with V8 release libs.

The Release version give SegmFault at the first line of the program which is HandleScope v8Scope;. (I instantiated the local scope for the v8 engine).

Unfortunately, I can't debug because I run the Release version, and I can't see what is the problem because in debug version is running ok.

I don't understand why I receive a SegmFault, when I try to instantiate the scope.

Do you have any suggestions for me how to approach this situation?

LaterEdit:

Using the followind code, I realized that the current Isolate is NULL. SO, now my question is how to create a Isolate context that is not NULL.

Isolate* isolate = Isolate::GetCurrent();
if (isolate==NULL)
    return;
Locker v8Locker;
HandleScope v8Scope(isolate);  

Thank you,

banuj
  • 3,080
  • 28
  • 34

1 Answers1

1

If someone has the same problem, here is the answer:

For some reason, it seems that V8 engine doesn't call its own initialize function. So if you put the line V8::initialize(); as the first line of your program it's gonna be ok.

To create, a new Isolate that is not NULL, you have to call Isolate *isolate=Isolate::New()

banuj
  • 3,080
  • 28
  • 34