From 67fd77d10ad71ea48e8103e3b437e1baeae2ec8b Mon Sep 17 00:00:00 2001 From: Christian Prochaska Date: Wed, 13 Mar 2019 17:49:34 +0100 Subject: [PATCH] base: catch 'Ipc_error' in 'Expanding_parent_client::exit()' If a component is being destroyed just before it calls `exit()` at its parent, the `exit()` call causes an `Ipc_error` exception, which leads to an `abort()` loop with repeated error messages, because `abort()` calls `exit()` too. Catching the exception in `Expanding_parent_client::exit()` avoids this problem. Fixes #3228 --- .../base/internal/expanding_parent_client.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/repos/base/src/include/base/internal/expanding_parent_client.h b/repos/base/src/include/base/internal/expanding_parent_client.h index e7eba15b14..bd93d4267d 100644 --- a/repos/base/src/include/base/internal/expanding_parent_client.h +++ b/repos/base/src/include/base/internal/expanding_parent_client.h @@ -93,6 +93,20 @@ class Genode::Expanding_parent_client : public Parent_client ** Parent interface ** **********************/ + void exit(int exit_value) override + { + try { + Parent_client::exit(exit_value); + } catch (Genode::Ipc_error) { + /* + * This can happen if the child is being destroyed before + * calling 'exit()'. Catching the exception avoids an + * 'abort()' loop with repeated error messages, because + * 'abort()' calls 'exit()' too. + */ + } + } + Session_capability session(Client::Id id, Service_name const &name, Session_args const &args,