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

Static variables are reused in local isolates with --fast-startup #27558

Closed
whesse opened this issue Oct 10, 2016 · 3 comments
Closed

Static variables are reused in local isolates with --fast-startup #27558

whesse opened this issue Oct 10, 2016 · 3 comments
Labels
closed-not-planned Closed as we don't intend to take action on the reported issue type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) web-dart2js

Comments

@whesse
Copy link
Contributor

whesse commented Oct 10, 2016

The co19 test co19/LibTest/isolate/Isolate/spawn_A04_t04 is failing on a very diverse collection of platforms. The test should be investigated to see if it is pointing out a real failure in the async library.

It is failing if: $compiler == dart2js && ($runtime == jsshell || ($fast_startup && ($runtime == safari || ($minified && $runtime == d8))))

@whesse whesse added library-async type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Oct 10, 2016
whesse added a commit that referenced this issue Oct 10, 2016
@floitschG floitschG added area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. web-dart2js and removed area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-async labels Oct 12, 2016
@floitschG floitschG changed the title LibTest/isolate/Isolate/spawn_A04_t04 failing on many platforms Lazily initialized variables are reused in local isolates Oct 12, 2016
@floitschG floitschG changed the title Lazily initialized variables are reused in local isolates Static variables are reused in local isolates with --fast-startup Oct 12, 2016
@floitschG
Copy link
Contributor

floitschG commented Oct 12, 2016

This is not an isolate problem. Changed the title accordingly.
This is a bug in the --fast-startup emitter. Static variables variables are reused in different local isolates.
This is not a problem for browsers as long as they support webworkers. However, in d8 and browsers that don't support webworkers we fall back to local isolates (where we run them in the same JS isolate).
The fast-startup emitter doesn't separate the static variables of the local workers.

Example:

import 'dart:isolate';

final fin = () { print("initializing fin"); return true; }();
int global = 0;

f(arg) {
  print("calling lazy global");
  var x = fin;
  print("called");
  print("global: $global");
}

main() {
  f(null);
  global++;
  Isolate.spawn(f, null);
}

Run it with and without --fast-startup.

I have a vague memory of this being on purpose since it simplified the compiler and the output. If I remember correctly we agreed that isolate tests would need to be run with content_shell.

/cc @sigmundch : do you remember if that's what we agreed on?

@sigmundch
Copy link
Member

I honestly can't recall whether we discussed where to run isolate tests, but running them only in content_shell seems like a fair requirement.

In general - if we only to support isolates when webworkers are available, should we change the isolate library to fail proactively in that case & delete the local isolates logic?

@sigmundch
Copy link
Member

@floitschG - what do you think about failing proactively and deleting the local-isolates logic?

Regarding this original bug, I'll mark it as "wont fix". FYI - after some fixes to custom-elements + js-interop, the test is now passing in safari. The test is only failing on d8 and jsshell.

@sigmundch sigmundch added the closed-not-planned Closed as we don't intend to take action on the reported issue label Oct 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-not-planned Closed as we don't intend to take action on the reported issue type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) web-dart2js
Projects
None yet
Development

No branches or pull requests

3 participants