core: handle cap-ref-cnt overflow in create_thread

The code in Core's Cpu_session_component::create_thread might throw a
capability refernce-count overflow if one creates many threads, which would
kill core if not handled.

Ref #2120
This commit is contained in:
Martin Stein 2016-11-14 15:34:31 +01:00 committed by Christian Helmuth
parent 288c2c50ba
commit 99f18a2fe6

View File

@ -67,8 +67,9 @@ Thread_capability Cpu_session_component::create_thread(Capability<Pd_session> pd
};
try { _thread_ep->apply(pd_cap, create_thread_lambda); }
catch (Region_map::Out_of_metadata) { throw Out_of_metadata(); }
catch (Allocator::Out_of_memory) { throw Out_of_metadata(); }
catch (Region_map::Out_of_metadata) { throw Out_of_metadata(); }
catch (Allocator::Out_of_memory) { throw Out_of_metadata(); }
catch (Native_capability::Reference_count_overflow) { throw Thread_creation_failed(); }
thread->session_exception_sigh(_exception_sigh);