[go: nahoru, domu]

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

Vm crashes on async error handling #22446

Closed
sigurdm opened this issue Feb 17, 2015 · 3 comments
Closed

Vm crashes on async error handling #22446

sigurdm opened this issue Feb 17, 2015 · 3 comments
Labels
area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. P1 A high priority bug; for example, a single project is unusable or has many test failures

Comments

@sigurdm
Copy link
Contributor
sigurdm commented Feb 17, 2015

r43804
This program:
import "dart:async";

foo() async {
  try {
    bool firstTime = true;
    while(true) {
      print("a");
      if (firstTime) {
        try {
          await new Future.value(3);
          print("b");
          throw "Error";
        } catch(error) {
          print(error);
          print("c");
          firstTime = false;
          continue;
        } finally {
          print("d");
        }
      } else {
        print("e");
        return;
      }
    }
  } finally {
    print("f");
  }
  print("g");
}

main() async {
  await foo();
}
Expected output:
a
b
Error
c
d
a
e
f

Prints:
a
b
Error
c
d
a
e
f
f
Unhandled exception:
Uncaught Error: The null object does not have a method 'complete'.

NoSuchMethodError: method not found: 'complete'
Receiver: null
Arguments: [null]
Stack Trace:

­0 Object._noSuchMethod (dart:core-patch/object_patch.dart:42)

­1 Object.noSuchMethod (dart:core-patch/object_patch.dart:45)

­2 foo.<foo_async_body> (file:///usr/local/google/home/sigurdm/test/main.dart)

­3 _asyncCatchHelper.<anonymous closure> (dart:core-patch/core_patch.dart:11)

­4 _RootZone.runBinary (dart:async/zone.dart:1160)

­5 _Future._propagateToListeners.handleError (dart:async/future_impl.dart:511)

­6 _Future._propagateToListeners (dart:async/future_impl.dart:570)

­7 _Future._completeError (dart:async/future_impl.dart:366)

­8 _Future._asyncCompleteError.<anonymous closure> (dart:async/future_impl.dart:421)

­9 _asyncRunCallbackLoop (dart:async/schedule_microtask.dart:41)

­10 _asyncRunCallback (dart:async/schedule_microtask.dart:48)

­11 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:96)

­12 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:143)

­0 _rootHandleUncaughtError.<anonymous closure> (dart:async/zone.dart:886)

­1 _asyncRunCallbackLoop (dart:async/schedule_microtask.dart:41)

­2 _asyncRunCallback (dart:async/schedule_microtask.dart:48)

­3 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:96)

­4 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:143)

@iposva-google
Copy link
Contributor

Set owner to @crelier.
Removed Priority-Unassigned label.
Added Priority-High, Accepted labels.

@crelier
Copy link
Contributor
crelier commented Mar 4, 2015

After r44210, I am getting a new error:

a
b
Error
c
d
a
e
f
f
The null object does not have a method 'scheduleMicrotask'.

NoSuchMethodError: method not found: 'scheduleMicrotask'
Receiver: null
Arguments: [Closure: () => dynamic]
c
d
a
e
f
f
Unhandled exception:
Uncaught Error: Bad state: Future already completed
Stack Trace:
#­0 _Completer.completeError (dart:async/future_impl.dart:21)
#­1 foo.<foo_async_body> (file:///usr/local/google/home/regis/bug.dart:36:1)
#­2 _asyncCatchHelper.<anonymous closure> (dart:core-patch/core_patch.dart:15)
#­3 _RootZone.runBinary (dart:async/zone.dart:1160)
#­4 _Future._propagateToListeners.handleError (dart:async/future_impl.dart:511)
#­5 _Future._propagateToListeners (dart:async/future_impl.dart:570)
#­6 _Future._completeWithValue (dart:async/future_impl.dart:358)
#­7 _Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:412)
#­8 _asyncRunCallbackLoop (dart:async/schedule_microtask.dart:41)
#­9 _asyncRunCallback (dart:async/schedule_microtask.dart:48)
#­10 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:96)
#­11 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:143)

#­0 _rootHandleUncaughtError.<anonymous closure> (dart:async/zone.dart:886)
#­1 _asyncRunCallbackLoop (dart:async/schedule_microtask.dart:41)
#­2 _asyncRunCallback (dart:async/schedule_microtask.dart:48)
#­3 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:96)
#­4 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:143)

Reassigning to Matthias.


Set owner to @mhausner.

@DartBot
Copy link
DartBot commented Mar 13, 2015

This comment was originally written by @mhausner


This works as expected now on bleeding_edge after r44465.

$ dart ~/tmp/e.dart
a
b
Error
c
d
a
e
f


Added Fixed label.

@sigurdm sigurdm added Type-Defect P1 A high priority bug; for example, a single project is unusable or has many test failures area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. labels Mar 13, 2015
This issue was closed.
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, FFI, and the AOT and JIT backends. P1 A high priority bug; for example, a single project is unusable or has many test failures
Projects
None yet
Development

No branches or pull requests

4 participants