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

Unhandled exceptions in isolates does not terminate the VM #12587

Closed
sgjesse opened this issue Aug 21, 2013 · 9 comments
Closed

Unhandled exceptions in isolates does not terminate the VM #12587

sgjesse opened this issue Aug 21, 2013 · 9 comments
Labels
area-vm closed-obsolete Closed as the reported issue is no longer relevant library-isolate type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@sgjesse
Copy link
Contributor

sgjesse commented Aug 21, 2013

The tests

  isolate/isolate2_negative_test.dart
  isolate/isolate3_negative_test.dart

expect the VM to terminate when there is an unhandled exception in an isolate.

Might be releatd to issue #3734.

@iposva-google
Copy link
Contributor

I don't think this is the expected behaviour any longer:

// Dart test program for testing that exceptions in other isolates bring down
// the program.

We specifically added code that will be notified if a spawned isolate had an unhandled exception.


cc @floitschG.
cc @a-siva.
Removed Area-VM label.
Added Area-Library, Library-Isolate labels.

@floitschG
Copy link
Contributor

With the isolate refactoring the error should be propagated back to the spawner. But somehow this is not working.
This issue is hence relevant again. (Not sure if it already was before).

@mkustermann
Copy link
Member

Any updates on this?

Looking at tests/isolate/isolate2_negative_test.dart:
 - test is marked as SKIP on "$compiler == none"!
 - Isolate.spawn() takes 2 parameters, the test gives only 1.
 - when changing the test to call Isolate.spawn() with two arguments, the VM will stay alive (should it?)
   => this makes it timeout instead of fail

@floitsch/iposva: Could you take a look?
Please also assign a priority -- this could impact users if they rely on correct error propagation.

@floitschG
Copy link
Contributor

This seems to be related to issue #8.
After fixing isolate2_negative_test (as suggested by Martin) both tests print an error message, coming from ShutdownIsolate, and then keep running:

Assigning to VM for further investigation. (Ping me, if we misuse the API and should be able to handle these errors in Dart code).
===
$ out/ReleaseIA32/dart --package-root=$PWD/out/ReleaseIA32/packages tests/isolate/isolate3_negative_test.dart
unittest-suite-wait-for-done
in ShutdownIsolate: 'file:///mnt/ssd/floitsch/code/dart/dart/tests/isolate/isolate3_negative_test.dart': error: line 13 pos 41: illegal implicit access to receiver 'this'
  TestClass.named(num this.fld1) : fld2=fld1 {
                                        ^

===
$ out/ReleaseIA32/dart --package-root=$PWD/out/ReleaseIA32/packages tests/isolate/isolate2_negative_test.dart
unittest-suite-wait-for-done
in ShutdownIsolate: Unhandled exception:
foo
#­0 entry (file:///mnt/ssd/floitsch/code/dart/dart/tests/isolate/isolate2_negative_test.dart:13:3)
#­1 _startIsolate.isolateStartHandler (dart:isolate-patch/isolate_patch.dart:226)
#­2 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:120)


Removed Area-Library label.
Added Area-VM label.

@lrhn
Copy link
Member

lrhn commented May 21, 2014

Should an uncaught error in the original isolate terminate the program?
I think it does now, but I don't see why that isolate should be special.

@kevmoo kevmoo added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) and removed priority-unassigned labels Feb 29, 2016
@zanderso
Copy link
Member

This looks stale. The tests named above don't appear to exist anymore.

@zanderso zanderso added the closed-obsolete Closed as the reported issue is no longer relevant label Jun 23, 2016
@floitschG floitschG removed the closed-obsolete Closed as the reported issue is no longer relevant label Jun 23, 2016
@floitschG
Copy link
Contributor

This is still an issue.
The problem is pretty much, that errors in other isolates are completely ignored.

See for example:

import 'dart:isolate';
import 'dart:async';

foo(x) {
  print("throwing");
  throw "in other isolate";
}

main() {
  Isolate.spawn(foo, null);
  new Timer.periodic(const Duration(seconds: 1), (_) { print("tick"); });
}

Silently ignoring is the worst of all options. We should come up with a better way to deal with it.
@zanderso, @a-siva : I suggest working together with us (mostly with @lrhn and me, since we designed most of the isolate library), to improve the situation.

@floitschG floitschG reopened this Jun 23, 2016
@zanderso
Copy link
Member

@floitschG Could you give this issue a better title? As stated, I think the VM is working as intended. Thanks.

@floitschG floitschG added the closed-obsolete Closed as the reported issue is no longer relevant label Jun 23, 2016
@floitschG
Copy link
Contributor

Fair enough. I will close this one.
Let's meet for my example anyway (probably there is already a bug for that one too).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm closed-obsolete Closed as the reported issue is no longer relevant library-isolate type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

7 participants