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

Errors thrown from runZonedExperimental's onDone handler are crazy confusing. #11969

Closed
jbdeboer opened this issue Jul 23, 2013 · 6 comments
Closed
Assignees
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-duplicate Closed in favor of an existing report

Comments

@jbdeboer
Copy link

The following code snippet:

var nul;
var c;
runZonedExperimental(() {
  c = new Completer.sync();
  c.future.then((_) {});
}, onDone: () => nul.sad());
c.complete("ss");

produces an error:

Caught 'dart:async/zone.dart': Failed assertion: line 115 pos 12: '! _children.isEmpty' is not true.
    _ZoneBase._removeChild dart:async/zone.dart 115:12
    _ZoneBase._dispose dart:async/zone.dart 48:31
    _WaitForCompletionZone._dispose dart:async/zone.dart 169:19
    _ZoneBase._checkIfDone dart:async/zone.dart 53:15
    _ZoneBase._runInZone dart:async/zone.dart 95:19
    _ZoneBase._runUnguarded dart:async/zone.dart 102:22
    _ZoneBase.executeCallback dart:async/zone.dart 58:23
    _TransformFuture._sendValue dart:async/future_impl.dart 350:26
    _FutureImpl._setValueUnchecked dart:async/future_impl.dart 186:26
    _FutureImpl._setValue dart:async/future_impl.dart 176:23
    _SyncCompleter._setFutureValue dart:async/future_impl.dart 50:21
    _Completer.complete dart:async/future_impl.dart 17:20
    main.<anonymous closure>.<anonymous closure> /home/deboer/github/angular-dart/test/http_spec.dart 119:17 (e.g. the c.complete() call)

when it should throw an error like:

The null object does not have a method 'sad'.

NoSuchMethodError : method not found: 'sad'
Receiver: null
Arguments: []

­0 Object.noSuchMethod (dart:core-patch/object_patch.dart:19:25)

­1 main.<anonymous closure>.<anonymous closure>.<anonymous closure> (http://localhost:9876/base/test/http_spec.dart:116:36)

­2 _WaitForCompletionZone._dispose (dart:async/zone.dart:170:12)

­3 _ZoneBase._checkIfDone (dart:async/zone.dart:53:15)

­4 _ZoneBase._runInZone (dart:async/zone.dart:95:19)

@dgrove
Copy link
Contributor

dgrove commented Jul 23, 2013

Set owner to @floitschG.
Added Area-Library, Triaged labels.

@floitschG
Copy link
Contributor

Added Accepted label.

@floitschG
Copy link
Contributor

Added Started label.

@floitschG
Copy link
Contributor

The example works fine with newest revision, but I suspect that some refactorings just made the bug not manifest itself (instead of being fixed).
Now switched back to revision 24946 where the assert triggers. (Thanks for the nice test-case).

@floitschG
Copy link
Contributor

Turns out this is a VM bug, where finally clauses are sometimes executed twice.
Filed issue #11972.


Added Duplicate label.
Marked as being merged into #11972.

@floitschG
Copy link
Contributor

Issue #12195 has been merged into this issue.


cc @justinfagnani.

@jbdeboer jbdeboer added Type-Defect area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-duplicate Closed in favor of an existing report labels Aug 2, 2013
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-duplicate Closed in favor of an existing report
Projects
None yet
Development

No branches or pull requests

4 participants