From 6a1ad86129a82528c5f577faddaf37754387bc78 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Tue, 6 Jan 2026 18:01:24 -0500 Subject: [PATCH] Debugger: Fix jobs trying to re-add dependencies. Linked lists are used to manage these, so if we re-add jobs we'll corrupt the linked lists and cause crashes. Fixes #19864 and possibly others. --- src/kits/debugger/util/Worker.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/kits/debugger/util/Worker.cpp b/src/kits/debugger/util/Worker.cpp index 3d4628996e..03f1ccc6d9 100644 --- a/src/kits/debugger/util/Worker.cpp +++ b/src/kits/debugger/util/Worker.cpp @@ -415,6 +415,13 @@ Worker::WaitForJob(Job* waitingJob, const JobKey& key) if (job == NULL) return JOB_DEPENDENCY_NOT_FOUND; + if (waitingJob->Dependency() == job) + return waitingJob->WaitStatus(); + if (job == waitingJob) + debugger("Jobs can't depend on themselves"); + if (waitingJob->Dependency() != NULL) + debugger("Job already has a dependency"); + waitingJob->SetWaitStatus(JOB_DEPENDENCY_ACTIVE); waitingJob->SetDependency(job); job->DependentJobs().Add(waitingJob);