Could some one please tell why without isolate_scope I get exception?

30 views
Skip to first unread message

Pankaj Chhabra

unread,
Jun 5, 2023, 9:14:48 PM6/5/23
to v8-users
I have a method in DLL that calls using V8 C++ myMethod of myClass instance. If I don't call isolate_scope, the is a crash after making around 100 calls to myMethod, I get an exception 0xC0000005: Access violation writing location 0x00000000. When I call isolate_scope, the exception does not happen even for 1 million calls.

There is one isolate only. I have already called isolate_scope in initialization
  isolate = Isolate::New(create_params);
  Isolate::Scope isolate_scope(isolate);
       
Could some one please tell why without isolate_scope I get exception after making 100 or so calls to myMethod?

Omer Katz (chromium.org)

unread,
Jun 6, 2023, 3:48:04 AM6/6/23
to v8-u...@googlegroups.com
Are you keeping the isolate_scope alive while calling your method?
V8 requires that you have a live Isolate::Scope while you're using it.
Some parts of V8 may work without it but others definitely won't, and you can't/shouldn't disable the parts that won't.
I suspect that after ~100 calls is when you first encounter the parts of V8 that need an Isolate::Scope.

--
--
v8-users mailing list
v8-u...@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+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/v8-users/078cd53f-f3da-40e5-a3ef-770e6cede758n%40googlegroups.com.

Pankaj Chhabra

unread,
Jun 10, 2023, 11:51:01 AM6/10/23
to v8-u...@googlegroups.com
I am keeping the scope alive while calling the method. Your point that some parts require the isolate::Scope seems right and this is the reason it works.



--
Best Regards,
Pankaj Chhabra


Reply all
Reply to author
Forward
0 new messages