1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:57:44 +00:00

Kernel: Fix crash when delivering signal to barely created thread

We need to wait until a thread is fully set up and ready for running
before attempting to deliver a signal. Otherwise we may not have a
user stack yet.

Also, remove the Skip0SchedulerPasses and Skip1SchedulerPass thread
states that we don't really need anymore with software context switching.

Fixes the kernel crash reported in #3419
This commit is contained in:
Tom 2020-09-07 08:31:00 -06:00 committed by Andreas Kling
parent f1a65d1d70
commit c3d231616c
5 changed files with 32 additions and 21 deletions

View file

@ -306,7 +306,7 @@ int Process::do_exec(NonnullRefPtr<FileDescription> main_program_description, Ve
if (was_profiling)
Profiling::did_exec(path);
new_main_thread->set_state(Thread::State::Skip1SchedulerPass);
new_main_thread->set_state(Thread::State::Runnable);
big_lock().force_unlock_if_locked();
ASSERT_INTERRUPTS_DISABLED();
ASSERT(Processor::current().in_critical());