Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: X10 SVN HEAD
-
Fix Version/s: X10 2.3
-
Component/s: XRX Runtime
-
Labels:None
-
Number of attachments :
Description
Because catching x10.lang.Throwable is not sufficient to catch exceptions from java, XRX must catch and propagate java.lang.Throwable in addition to what it is currently doing. One challenge here is to avoid breaking the compilation of native X10, so probably some judicious use of @Native will be required.
import x10.io.Console; public class AsyncJavaThrowable { public static def main (args : Array[String]) { Console.OUT.println(1); try { at (here.next()) { throw new java.lang.RuntimeException("1"); } } catch (e:java.lang.Throwable) { e.printStackTrace(); } Console.OUT.println(2); try { finish async { throw new java.lang.RuntimeException("2"); } } catch (e:Throwable) { // multiple exceptions here -- java exception packaged inside x10 exception e.printStackTrace(); } Console.OUT.println("Done"); } }
Run with 1 place, "Done" is not printed, program exits.
Run with 2 places, deadlocks at 1
Issue Links
- is depended upon by
-
XTENLANG-2118
Java interoperability
-
- relates to
-
XTENLANG-2989
java-interop: Cannot call an @Throws method inside of an async or an at
-
Implemented for async, in 24345