runtime: make Goexit exit host threads

The threads scheduler handled runtime.Goexit using the generic deadlock
path, which parked the current pthread forever. Add a scheduler-specific
goexit hook so it can remove the current task and exit the pthread while
ordinary blocking deadlocks still block.

Track main goroutine Goexit so the last remaining goroutine reports the
expected deadlock instead of letting the process exit successfully.
Expand the crash coverage with the Goexit cases covered by Big Go's
runtime tests.
This commit is contained in:
Jake Bailey
2026-07-03 16:48:11 -07:00
committed by Ron Evans
parent 16eefc59eb
commit 432ebe13ed
14 changed files with 225 additions and 36 deletions
+1
View File
@@ -51,6 +51,7 @@ type stackState struct {
// The new goroutine is immediately started.
func start(fn uintptr, args unsafe.Pointer, stackSize uintptr) {
t := &Task{}
addLiveTask(t)
t.state.initialize(fn, args, stackSize)
scheduleTask(t)
}