Dart_CreateSnapshot fails if the current isolate was originally from a snapshot #3233
Labels
area-vm
Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
Milestone
This issue was originally filed by [email protected]
Currently if I create an isolate from a snapshot (the standard snapshot_gen.cc) then load another library and try to create a new snapshot, I get an assertion:
/Users/sammccall/dart/source/dart/runtime/vm/raw_object_snapshot.cc:448: error: expected: kind != Snapshot::kMessage && !IsCreatedFromSnapshot()
This seems to indicate that you can't re-snapshot objects loaded from a snapshot.
This is unfortunate and at least should be documented - is there a reason it can't be supported?
Use case 1: My embedding wants to expose the standard libaries (dart:io etc) plus dart:mylib to user code.
I load the standard snapshot, load dart:mylib, make a new snapshot, and use this to prepare all user isolates.
Use case 2: My embedding wants to snapshot the user code for quick loading.
I load the standard snapshot, load the user library, and create a new snapshot. On each invocation I use this snapshot to prepare an isolate.
Workaround: link in the source code to all libraries and load each from source.
The text was updated successfully, but these errors were encountered: