Andreas Zwinkau <zwin...@kit.edu> wrote on 11/19/2012 09:22:25 AM:
>
> I got a stacktrace like this:
>
> Uncaught exception at place 0: x10.lang.MultipleExceptions
> x10.lang.ExceptionInInitializer
> at x10::lang::CheckedThrowable::fillInStackTrace()
> at x10aux::throwException(x10::lang::CheckedThrowable*)
> at
> x10aux::StaticInitController::initField
(x10aux::StaticInitController::status
> volatile*, void (*)(), x10::lang::CheckedThrowable**, char const*)
> ...
>
> Is there a way to show the actual exception that was thrown during
> initField? This stack trace is not helpful.
Hi,
The code is supposed to be setting the cause of the exception so that
you can back-chain through the various levels to find it. For example,
with the program below:
import x10.io.Console;
public class StaticInitException {
static x:Int = f();
static def f() {
if (Math.sin(42) < 1000) { // should always happen
throw new Exception("I will try to break things.");
}
return 42;
}
static y:Int = x;
public static def main (args : Array[String]) {
Console.OUT.println("Value is: "+y);
}
}
You get a long & ugly stack series of stack traces (appended), but
all of the information is still there. Is the cause not being set
correctly in your example? If so, I'd be interested in trying to debug it,
since I thought I had things properly setup so it would do that.
thanks,
--dave
[dgrove@linchen myTests]$ ./a.out
Uncaught exception at place 0: x10.lang.MultipleExceptions
x10.lang.ExceptionInInitializer
at x10::lang::CheckedThrowable::fillInStackTrace()
at x10aux::throwException(x10::lang::CheckedThrowable*)
at x10aux::StaticInitController::initField
(x10aux::StaticInitController::status volatile*, void (*)(),
x10::lang::CheckedThrowable**, char const*)
at StaticInitException::x10__y__init()
at StaticInitException::x10__y__get()
at StaticInitException::main(x10::array::Array<x10::lang::String*>*)
at x10::lang::Activity::run()
at x10::lang::Runtime__Worker::loop()
at x10::lang::Runtime__Worker::__apply()
at x10::lang::Runtime__Pool::__apply(int)
at x10::lang::Runtime::start(x10::lang::VoidFun_0_0*)
at
at GC_inner_start_routine
at GC_call_with_stack_base
at /lib64/libpthread.so.0() [0x3270e07851]
at clone
Caused by: x10.lang.ExceptionInInitializer
at x10::lang::CheckedThrowable::fillInStackTrace()
at x10aux::throwException(x10::lang::CheckedThrowable*)
at x10aux::StaticInitController::initField
(x10aux::StaticInitController::status volatile*, void (*)(),
x10::lang::CheckedThrowable**, char const*)
at StaticInitException::x10__x__init()
at StaticInitException::x10__x__get()
at StaticInitException::x10__y__do_init()
at x10aux::StaticInitController::initField
(x10aux::StaticInitController::status volatile*, void (*)(),
x10::lang::CheckedThrowable**, char const*)
at StaticInitException::x10__y__init()
at StaticInitException::x10__y__get()
at StaticInitException::main(x10::array::Array<x10::lang::String*>*)
at x10::lang::Activity::run()
at x10::lang::Runtime__Worker::loop()
at x10::lang::Runtime__Worker::__apply()
at x10::lang::Runtime__Pool::__apply(int)
at x10::lang::Runtime::start(x10::lang::VoidFun_0_0*)
at
at GC_inner_start_routine
at GC_call_with_stack_base
at /lib64/libpthread.so.0() [0x3270e07851]
at clone
Caused by: x10.lang.Exception: I will try to break things.
at x10::lang::CheckedThrowable::fillInStackTrace()
at x10aux::throwException(x10::lang::CheckedThrowable*)
at StaticInitException::f()
at StaticInitException::x10__x__do_init()
at x10aux::StaticInitController::initField
(x10aux::StaticInitController::status volatile*, void (*)(),
x10::lang::CheckedThrowable**, char const*)
at StaticInitException::x10__x__init()
at StaticInitException::x10__x__get()
at StaticInitException::x10__y__do_init()
at x10aux::StaticInitController::initField
(x10aux::StaticInitController::status volatile*, void (*)(),
x10::lang::CheckedThrowable**, char const*)
at StaticInitException::x10__y__init()
at StaticInitException::x10__y__get()
at StaticInitException::main(x10::array::Array<x10::lang::String*>*)
at x10::lang::Activity::run()
at x10::lang::Runtime__Worker::loop()
at x10::lang::Runtime__Worker::__apply()
at x10::lang::Runtime__Pool::__apply(int)
at x10::lang::Runtime::start(x10::lang::VoidFun_0_0*)
at
at GC_inner_start_routine
at GC_call_with_stack_base
at /lib64/libpthread.so.0() [0x3270e07851]
at clone
------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users