mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-20 14:13:09 +00:00
base: throw exception if thread creation failed
Sanity check that the context area has been attached. Otherwise the code later tries to access the context area and core dies with a unhandled page fault.
This commit is contained in:
parent
cef9af1978
commit
df3c0d4786
@ -142,7 +142,8 @@ Thread_base::Context *Thread_base::_alloc_context(size_t stack_size)
|
||||
try {
|
||||
ds_cap = env_context_area_ram_session()->alloc(ds_size);
|
||||
addr_t attach_addr = ds_addr - Native_config::context_area_virtual_base();
|
||||
env_context_area_rm_session()->attach_at(ds_cap, attach_addr, ds_size);
|
||||
if (attach_addr != (addr_t)env_context_area_rm_session()->attach_at(ds_cap, attach_addr, ds_size))
|
||||
throw Stack_alloc_failed();
|
||||
}
|
||||
catch (Ram_session::Alloc_failed) { throw Stack_alloc_failed(); }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user