Skip to content

Isolate.spawn is broken in snapshots when the original Dart file is missing #25430

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

Closed
nex3 opened this issue Jan 14, 2016 · 1 comment
Closed
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. P0 A serious issue requiring immediate resolution type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) vm-regression
Milestone

Comments

@nex3
Copy link
Member

nex3 commented Jan 14, 2016

This breakage appears under the following conditions:

  • The script contains a package: import.
  • The script uses Isolate.spawn().
  • The script is run from a snapshot.
  • The original file that was snapshotted no longer exists.

To reproduce this, create a package with the following files:

// bin.dart
import 'dart:isolate';

main() async {
  await Isolate.spawn(entrypoint, null);
}

void entrypoint(_) {
}

Run:

$ dart --snapshot=bin.dart.snapshot bin.dart
$ rm bin.dart
$ dart bin.dart.snapshot

You should see an error like the following:

Unhandled exception:
Load Error for "file:///tmp/app/bin/bin.dart": Error loading file:///tmp/app/bin/bin.dart:
  FileSystemException: Cannot open file, path = '/tmp/app/bin/bin.dart' (OS Error: No such file or directory, errno = 2)
#0      _asyncLoadErrorCallback (dart:_builtin:155)
#1      _asyncLoadError (dart:_builtin:566)
#2      _handleLoaderReply (dart:_builtin:383)
#3      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:148)

This is a regression. Running git bisect indicates that this error appeared as of 6d066c7. It's likely related to dart-lang/pub#1379.

@nex3 nex3 added Type-Defect area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. P0 A serious issue requiring immediate resolution vm-regression labels Jan 14, 2016
@nex3 nex3 added this to the 1.14 milestone Jan 14, 2016
@nex3 nex3 changed the title Edit New issue Isolate.spawn is broken in snapshots when the original Dart file is missing Isolate.spawn is broken in snapshots when the original Dart file is missing Jan 14, 2016
@iposva-google
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. P0 A serious issue requiring immediate resolution type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) vm-regression
Projects
None yet
Development

No branches or pull requests

3 participants