mirror of
https://github.com/genodelabs/genode.git
synced 2025-03-23 12:35:41 +00:00
This patch fixes a race condition triggered by the thread test running on Linux inside VirtualBox. The 'test_stack_alloc' sporadically produced one of two errors: A segfault in the 'Thread::deinit_platform_thread' on the attempt to access the 'native_thread' of the to-be-destructed thread (this data structure is located on the thread's stack). Or, an error message about a region conflict within the stack area. The problem was that two instances of 'Region_map_mmap' issued a sequence of munmap and mmap each. Even though each instance locked the attach/detach operations, the lock was held per instance. In a situation where two instances performed attach/detach operations in parallel, the syscall sequences could interfere with each other. In the test scenario, the two region-map instances are the test's address space and the stack area. When creating a thread, the thread's trace-control dataspace is attached at an arbitrary place (picked by the Linux kernel) within the address space whereas the stack is attached at the stack area. The problem is the following sequence: Thread A wants to destruct a thread: 1. Remove stack from stack area (issue unmap syscall) 2. Preserve virtual address range that was occupied from the stack so that Linux won't use it (issue mmap syscall) Thread B wants to construct a thread: 1. Request trace-control dataspace from CPU session 2. Attach trace-control dataspace to address space at a location picked by the Linux kernel (issue mmap syscall) The problem occurs when thread B's second step is executed in between the steps 1 and 2 of thread A and the Linux kernel picks the just-unmapped address as the location for the new trace-control mapping. Now, the trace control dataspace is mapped at the virtual address that was designated for the stack of the to-be-created thread, and the attempt to map the real stack fails. The patch fixes the problem by replacing the former region-map-local locks by a component-global lock. Furthermore, it cleans up core's implementation of the support function for the region-map-mmap implementation, eliminating the temporary unlocking of the region-map lock during RPC.
================================= Genode Operating System Framework ================================= This is the source tree of the reference implementation of the Genode OS architecture. For a general overview about the architecture, please refer to the project's official website: :Official project website for the Genode OS Framework: [https://genode.org/documentation/general-overview] The current implementation can be compiled for 8 different kernels: Linux, L4ka::Pistachio, L4/Fiasco, OKL4, NOVA, Fiasco.OC, seL4, and a custom kernel for running Genode directly on ARM-based hardware. Whereas the Linux version serves us as development vehicle and enables us to rapidly develop the generic parts of the system, the actual target platforms of the framework are microkernels. There is no "perfect" microkernel - and neither should there be one. If a microkernel pretended to be fit for all use cases, it wouldn't be "micro". Hence, all microkernels differ in terms of their respective features, complexity, and supported hardware architectures. Genode allows the use of each of the kernels listed above with a rich set of device drivers, protocol stacks, libraries, and applications in a uniform way. For developers, the framework provides an easy way to target multiple different kernels instead of tying the development to a particular kernel technology. For kernel developers, Genode contributes advanced workloads, stress-testing their kernel, and enabling a variety of application use cases that would not be possible otherwise. For users and system integrators, it enables the choice of the kernel that fits best with the requirements at hand for the particular usage scenario. Documentation ############# The primary documentation is the book "Genode Foundations", which is available on the front page of Genode website: :Download the book "Genode Foundations": [https://genode.org] The book describes Genode in a holistic and comprehensive way. It equips you with a thorough understanding of the architecture, assists developers with the explanation of the development environment and system configuration, and provides a look under the hood of the framework. Furthermore, it contains the specification of the framework's programming interface. The project has a quarterly release cycle. Each version is accompanied with detailed release documentation, which is available at the documentation section of the project website: :Release documentation: [https://genode.org/documentation/release-notes/] Directory overview ################## The source tree is composed of the following subdirectories: :'doc': This directory contains general documentation. Please consider the following document for a quick guide to get started with the framework: ! doc/getting_started.txt If you are curious about the ready-to-use components that come with the framework, please review the components overview: ! doc/components.txt :'repos': This directory contains the so-called source-code repositories of Genode. Please refer to the README file in the 'repos' directory to learn more about the roles of the individual repositories. :'tool': Source-code management tools and scripts. Please refer to the README file contained in the directory. Additional community-maintained components ########################################## The components found within the main source tree are complemented by a growing library of additional software, which can be seamlessly integrated into Genode system scenarios. :Genode-world repository: [https://github.com/genodelabs/genode-world] Contact ####### The best way to get in touch with Genode developers and users is the project's mailing list. Please feel welcome to join in! :Genode Mailing Lists: [https://genode.org/community/mailing-lists] Commercial support ################## The driving force behind the Genode OS Framework is the German company Genode Labs. The company offers commercial licensing, trainings, support, and contracted development work: :Genode Labs website: [https://www.genode-labs.com]
Description
Languages
C++
73.9%
C
17.8%
Makefile
4.4%
Tcl
1.3%
PHP
0.9%
Other
1.5%