TruffleStackTrace contains CallTargets and is not serializable
amp+graal at singingwizard.org
amp+graal at singingwizard.org
Sun Sep 10 22:36:00 UTC 2017
My group is working on an implementation of a distributed language in
Truffle (distributed Orc,
https://github.com/orc-lang/orc/tree/master/PorcE). We are using Java
serialization to ship information between nodes and this includes
errors. We have run into a bit of a problem.
TruffleStackTrace is not serializable, because it contains CallTargets
to represent the guest language call stack. CallTargets contain both the
full Truffle AST and probably a lot of Graal-related execution
information, so they cannot be serialized (understandably). However,
this means that any exception that went through a Truffle CallTarget is
no longer serializable for transport across the network.
Is it recommended that the Truffle languages catch all exceptions which
are escaping and rewrite those exceptions to include a higher-level
guest language stack trace representation?
I think it might better to have a generic Truffle/Polyglot VM
representation for a guest call stack element. RootNode could have a
method to provide it to TruffleStackTraceElement. Languages could
subclass the generic class to specialize it for their language if needed
as well. This would provide all the information that the guest language
implementation thinks is important without also including (and holding
references to) internal Truffle or Graal data structures.
Should I create a Github issue for this? Or did I totally miss the point
somewhere in this? :-)
-Arthur
More information about the graal-dev
mailing list