Embedding v8 6.7, open to upgrade if necessary.

I modified v8 shell.cc to experiment with the new Module API and am trying 
to figure out how to handle error conditions while resolving a module.  

If the resolve callback calls v8::Isolate::throwException, I get:

#
# Fatal error in ../../src/api.cc, line 2325
# Check failed: self->status() >= i::Module::kInstantiated (0 vs. 3).
#

Thread #1 [v8_shell] 3310 [core: 2] (Suspended : Signal : SIGILL:Illegal 
instruction) 
 v8::base::OS::Abort() at 
/space/projects/v8upgrade6.7/v8/v8/src/base/platform/platform-posix.cc:381 
0x7ffff7fa9f49 
 V8_Fatal() at /space/projects/v8upgrade6.7/v8/v8/src/base/logging.cc:170 
0x7ffff7f9e7b4 
 v8::base::(anonymous namespace)::DefaultDcheckHandler at 
/space/projects/v8upgrade6.7/v8/v8/src/base/logging.cc:56 0x7ffff7f9e7d5 
 v8::internal::Isolate::scheduled_exception() at 
/space/projects/v8upgrade6.7/v8/v8/src/isolate-inl.h:68 0x7ffff73c4bd8 
 v8::internal::Isolate::PromoteScheduledException() at 
/space/projects/v8upgrade6.7/v8/v8/src/isolate.cc:1,636 0x7ffff73c4bd8 
 v8::internal::Module::PrepareInstantiate() at 
/space/projects/v8upgrade6.7/v8/v8/src/objects/module.cc:475 0x7ffff74c20ae 
 v8::internal::Module::Instantiate() at 
/space/projects/v8upgrade6.7/v8/v8/src/objects/module.cc:434 0x7ffff74c3fcb 
 v8::Module::InstantiateModule() at 
/space/projects/v8upgrade6.7/v8/v8/src/api.cc:2,309 0x7ffff6d0f08c 
 ExecuteString() at /space/projects/v8upgrade6.7/v8/v8/samples/shell.cc:367 
0x555555557435 
 RunShell() at /space/projects/v8upgrade6.7/v8/v8/samples/shell.cc:324 
0x555555557a6e 

If resolve callback returns a module not containing the imported functions:

V8 version 6.7.288.52 [sample shell]
> import { square, diag } from 'lib';
(shell):1: SyntaxError: The requested module 'lib' does not provide an 
export named 'square'
import { square, diag } from 'lib';
         ^^^^^^
SyntaxError: The requested module 'lib' does not provide an export named 
'square'

#
# Fatal error in ../../src/api.cc, line 2325
# Check failed: self->status() >= i::Module::kInstantiated (0 vs. 3).
#

Thread #1 [v8_shell] 7277 [core: 17] (Suspended : Signal : SIGILL:Illegal 
instruction) 
 v8::base::OS::Abort() at 
/space/projects/v8upgrade6.7/v8/v8/src/base/platform/platform-posix.cc:381 
0x7ffff7fa9f49 
 V8_Fatal() at /space/projects/v8upgrade6.7/v8/v8/src/base/logging.cc:170 
0x7ffff7f9e7b4 
 v8::Module::Evaluate() at 
/space/projects/v8upgrade6.7/v8/v8/src/api.cc:2,325 0x7ffff6d0f611 
 ExecuteString() at /space/projects/v8upgrade6.7/v8/v8/samples/shell.cc:380 
0x5555555575df 
 RunShell() at /space/projects/v8upgrade6.7/v8/v8/samples/shell.cc:324 
0x555555557bfe 
 main() at /space/projects/v8upgrade6.7/v8/v8/samples/shell.cc:89 
0x55555555676e

How is ResolveCallback supposed to handle these error conditions to avoid 
v8 crashes?

If I upgrade to the latest stable v8 version, is it going to help?

Thanks a lot in advance!

-- 
-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to