From cb232891bfb1882e9ef7b8a250eb4b14e0825434 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Tue, 10 May 2016 11:55:25 +0200 Subject: [PATCH] Fix noux.run on base-linux The recent move of the initial three region maps into the PD session breaks the noux.run test on Linux because the address spaces are locally managed on this platform but the generic code of Noux still tries to execute the regular procedure of creating the virtualized PD session for a new Noux process. This patch handles a corner case that occurs on Linux but no other platform. It enables the successful creation of the virtualized PD session so that the test runs to completion. Still noux on Linux remains to be limited to non-forking programs. Issue #1938 --- repos/base-linux/src/lib/base/region_map_client.cc | 2 +- repos/ports/src/noux/dataspace_registry.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/repos/base-linux/src/lib/base/region_map_client.cc b/repos/base-linux/src/lib/base/region_map_client.cc index 7f3364f43..63adf4341 100644 --- a/repos/base-linux/src/lib/base/region_map_client.cc +++ b/repos/base-linux/src/lib/base/region_map_client.cc @@ -65,5 +65,5 @@ Region_map::State Region_map_client::state() { return _local(*this)->state(); } Dataspace_capability Region_map_client::dataspace() { - return _local(*this)->dataspace(); } + return _local(*this) ? _local(*this)->dataspace() : Dataspace_capability(); } diff --git a/repos/ports/src/noux/dataspace_registry.h b/repos/ports/src/noux/dataspace_registry.h index c42bfa5d1..36a209f41 100644 --- a/repos/ports/src/noux/dataspace_registry.h +++ b/repos/ports/src/noux/dataspace_registry.h @@ -44,7 +44,7 @@ namespace Noux { Dataspace_info(Dataspace_capability ds_cap) : Object_pool::Entry(ds_cap), - _size(Dataspace_client(ds_cap).size()), + _size(ds_cap.valid() ? Dataspace_client(ds_cap).size() : 0), _ds_cap(ds_cap) { }