From 0bc012eb79894b8596ec2bf183446cc25cbac73f Mon Sep 17 00:00:00 2001 From: Stefan Kalkowski Date: Wed, 5 Feb 2014 11:56:10 +0100 Subject: [PATCH] os: handle ipc error in server framework When using the server framework, it might happen that the main thread tries to forward a signal to the entrypoint, while the context of that signal is already destroyed. In that case the main thread will get an ipc error exception as result. Related to #113 --- os/src/lib/server/server.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/os/src/lib/server/server.cc b/os/src/lib/server/server.cc index 852c192253..faa6abed34 100644 --- a/os/src/lib/server/server.cc +++ b/os/src/lib/server/server.cc @@ -128,6 +128,15 @@ int main(int argc, char **argv) constructor_cap.call(); /* process incoming signals */ - for (;;) - wait_and_dispatch_one_signal(false); + for (;;) { + + /* + * It might happen that we try to forward a signal to the entrypoint, + * while the context of that signal is already destroyed. In that case + * we will get an ipc error exception as result, which has to be caught. + */ + try { + wait_and_dispatch_one_signal(false); + } catch(Genode::Ipc_error) { } + } }