From d9940113ef66c7846764a8b683fb0d3cc2df3879 Mon Sep 17 00:00:00 2001 From: chrg6 Date: Fri, 13 Nov 2026 18:46:50 -0500 Subject: [PATCH] Give a network task's system event back to the event table before its record is freed. The table counts entries in host memory as live, so each task the game destroyed kept a slot for the rest of the run, and enough of them would fill it. Not reproduced before the change; system_event_check passed. Co-Authored-By: Claude Opus 5.5 --- runtime/net_offline.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/runtime/net_offline.c b/runtime/net_offline.c index 6d362fb5..0ff7d3ed 100644 --- a/runtime/net_offline.c +++ b/runtime/net_offline.c @@ -333,7 +333,11 @@ static void ov_clock_task_ctor(Cpu *c) { *(void **)arg_p(c, 0) = NULL; } static void ov_task_dtor(Cpu *c) { void **slot = arg_p(c, 0); if (slot && *slot) { - free(*slot); // the bound SystemEventType's kernel handles stay (as for any undestroyed guest event) + HostTask *t = *slot; + // The event lives in this record: its entry in the system-event table goes back before the record is freed, + // or the table would count it live for the rest of the run (kernel.c kern_unbind_system_event) + if (t->bound) kern_unbind_system_event(c, (uint64_t)(uintptr_t)t->event); + free(t); *slot = NULL; } }