Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bring up DartDev isolate from kernel instead of an AppJIT snapshot #42804

Closed
bkonyi opened this issue Jul 22, 2020 · 5 comments
Closed

Bring up DartDev isolate from kernel instead of an AppJIT snapshot #42804

bkonyi opened this issue Jul 22, 2020 · 5 comments
Assignees
Labels
area-dart-cli Use area-dart-cli for issues related to the 'dart' command like tool. area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. P2 A bug or feature request we're likely to work on

Comments

@bkonyi
Copy link
Contributor

bkonyi commented Jul 22, 2020

Using a snapshot to bring up the DartDev isolate can cause a failure if incompatible VM flags are provided. We should change to using a kernel file instead to avoid these incompatibilities.

@bkonyi bkonyi added area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. area-dart-cli Use area-dart-cli for issues related to the 'dart' command like tool. labels Jul 22, 2020
@bkonyi bkonyi self-assigned this Jul 22, 2020
@devoncarew devoncarew added this to the September 2020 milestone Jul 28, 2020
@a-siva a-siva added the P2 A bug or feature request we're likely to work on label Aug 5, 2020
@mit-mit
Copy link
Member

mit-mit commented Aug 6, 2020

This is a bit hard to understand; can you explain the issue in a bit more detail?

@bkonyi
Copy link
Contributor Author

bkonyi commented Aug 6, 2020

An example from #42958 where passing --sound-null-safety causes dartdev to fail to load:

out/ReleaseX64/dart --observe --enable-experiment=non-nullable
--sound-null-safety test_hello.dart 

Snapshot not compatible with the current VM
configuration: the snapshot requires 'release no-dwarf_stack_traces_mode
causal_async_stacks no-lazy_async_stacks lazy_dispatchers use_bare_instructions
no-dedup_instructions no-"asserts" "use_field_guards" "use_osr" no-code-comments
x64-sysv no-null-safety' but the VM has 'release no-dwarf_stack_traces_mode
causal_async_stacks no-lazy_async_stacks lazy_dispatchers use_bare_instructions
no-dedup_instructions no-"asserts" "use_field_guards" "use_osr" no-code-comments
x64-sysv null-safety' 

Observatory listening on
http://127.0.0.1:8181/3JgcHLS6A2Q=/

Basically, AppJIT snapshots require that certain VM flags used to generate the snapshot must also be set identically in the VM the snapshot is being loaded into; if they don't match, the snapshot won't be loaded. We have the same issue when we load the kernel isolate, but we fall back to using the kernel snapshot if the AppJIT snapshot fails to load.

@mit-mit
Copy link
Member

mit-mit commented Aug 7, 2020

So here specifically the VM is running with sound null safety and thus cannot load an AppJit snapshot that has unsound null safety? Why is that?

I understand that other "low level" VM flags can affect the snapshot format, but why does something like null safety impact it?

@bkonyi
Copy link
Contributor Author

bkonyi commented Aug 7, 2020

I'm not 100% confident (@a-siva, please correct me if I'm wrong) but I believe that what determines whether or not a flag is compatible with a snapshot is if the flag changes behavior or memory layout in an incompatible way. For the example above we're trying to load a snapshot which was not generated with strong null safety enabled into a VM which expects strong null safety which would break assumptions made by the VM.

@a-siva
Copy link
Contributor

a-siva commented Aug 8, 2020

app JIT snapshots contains code.
The code/runtime stubs that are generated for sound null safety is different from unsound null safety, so it would be incorrect to load up an app JIT snapshot generated in unsound null safety mode into a VM that is expected to run in sound null safety mode or vice-versa.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-dart-cli Use area-dart-cli for issues related to the 'dart' command like tool. area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. P2 A bug or feature request we're likely to work on
Projects
None yet
Development

No branches or pull requests

4 participants