[remoting] Serialize exceptions between domains inside try/catch
authorVlad Brezae <brezaevlad@gmail.com>
Tue, 9 May 2017 21:54:47 +0000 (00:54 +0300)
committerVlad Brezae <brezaevlad@gmail.com>
Tue, 9 May 2017 21:54:47 +0000 (00:54 +0300)
commitdf047ec2db46f2af653693c0842b08b8a3c87f05
tree051921034a7a8ac167402f4fbb92a642fa669ed5
parent5e7137b6fee0d51acc9569f9f85bacda52592db6
[remoting] Serialize exceptions between domains inside try/catch

If a remote invoke in another domain throws an exception, the xdomain-dispatch wrapper will serialize the exception and pass it over to the calling domain so that it can be rethrown there. Serializing the exception object can itself throw an exception which we didn't properly catch, leading to unwinding to the caller domain without changing the domain state back and wreaking havoc.

If the serialization of the original exception throws a new exception, this new exception takes its place, being passed instead to the caller domain.
mono/metadata/remoting.c
mono/tests/Makefile.am
mono/tests/appdomain-serialize-exception.cs [new file with mode: 0644]