From 0d5571a820bb58aeba8eb42d4b545429378f846f Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Wed, 7 Jun 2023 12:25:43 +0200 Subject: [PATCH] base: close PD session last when destructing child This patch moves the destruction of the child's PD session after the closing of all other sessions because the PD session's role as resource container might still be needed for orderly reverting the session quotas when closing the other remaining sessions. Issue #4917 --- repos/base/src/lib/base/child.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/repos/base/src/lib/base/child.cc b/repos/base/src/lib/base/child.cc index dcbdf2728f..05980423c5 100644 --- a/repos/base/src/lib/base/child.cc +++ b/repos/base/src/lib/base/child.cc @@ -889,7 +889,6 @@ void Child::close_all_sessions() _binary.close(); if (_linker.constructed()) _linker->close(); - _pd.close(); /* * Remove statically created env sessions from the child's ID space. @@ -915,6 +914,8 @@ void Child::close_all_sessions() while (_id_space.apply_any(close_fn)); + _pd.close(); + if (!KERNEL_SUPPORTS_EAGER_CHILD_DESTRUCTION) _cpu._connection.destruct(); }