mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 17:28:11 +00:00
Kernel: Fix ASSERTION failed in join_thread syscall
set_interrupted_by_death was never called whenever a thread that had a joiner died, so the joiner remained with the joinee pointer there, resulting in an assertion fail in JoinBlocker: m_joinee pointed to a freed task, filled with garbage. Thread::current->m_joinee may not be valid after the unblock Properly return the joinee exit value to the joiner thread.
This commit is contained in:
parent
d28fa89346
commit
05ce8586ea
2 changed files with 9 additions and 4 deletions
|
@ -3844,10 +3844,14 @@ int Process::sys$join_thread(int tid, void** exit_value)
|
|||
if (result == Thread::BlockResult::InterruptedByDeath) {
|
||||
// NOTE: This cleans things up so that Thread::finalize() won't
|
||||
// get confused about a missing joiner when finalizing the joinee.
|
||||
InterruptDisabler disabler;
|
||||
Thread::current->m_joinee->m_joiner = nullptr;
|
||||
Thread::current->m_joinee = nullptr;
|
||||
return 0;
|
||||
InterruptDisabler disabler_t;
|
||||
|
||||
if (Thread::current->m_joinee) {
|
||||
Thread::current->m_joinee->m_joiner = nullptr;
|
||||
Thread::current->m_joinee = nullptr;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue