Skip to content
This repository was archived by the owner on Nov 8, 2026. It is now read-only.

tests: start child processes with a start-up handshake - #1

Merged
derfsss merged 1 commit into
mainfrom
tests-startup-handshake
Nov 4, 2026
Merged

derfsss merged 1 commit into
mainfrom
tests-startup-handshake

Conversation

@derfsss

@derfsss derfsss commented Nov 4, 2026

Copy link
Copy Markdown
Owner

TESTs 4, 9, 10 and 12 start child processes with CreateNewProcTags(). A child at a higher priority than the test (MCPd and Run start the test at -2, the children at 0) can run and exit before CreateNewProcTags() returns, before dos.library has linked it into its process list. Its exit then Remove()s an unlinked node: a DSI in the kernel's Remove(), called from dos.library's process exit. dos.doc says a child may exit before the call returns, but dos.library 54.136 does not survive that.

It crashed TEST 9 with this driver too (real reads on two units, round 85 of 150), and with the Rust virtioscsi.device in round 1. Write-up: derfsss/rust-amigaos4-crate, examples/virtio-scsi/docs/PROGRESS.md, "ROOT CAUSE".

Fix: the start-up handshake of the AmigaOS wiki's own child-process example (Exec Signals, SIGB_SINGLE). Each child's first act is Wait(SIGBREAKF_CTRL_F), and the parent sends CTRL-F only after CreateNewProcTags() has returned. The entry functions also get the dos.doc NP_Start prototype and return RETURN_OK. Six call sites, one file.

Tested: three runs at MCPd's priority, system disk plus a second unit, on this driver 53.10. The suite completes each time with no crash. TESTs 4, 9, 10 and 12 pass; the known TEST 14 and TEST 18 failures remain.

🤖 Generated with Claude Code

TESTs 4, 9, 10 and 12 start child processes with CreateNewProcTags().
A child at a higher priority than the test (MCPd and Run start it at
-2, the children at 0) can run and exit before CreateNewProcTags()
returns, before dos.library has linked it into its process list. Its
exit then Remove()s an unlinked node: a DSI in the kernel's Remove(),
called from dos.library's process exit. dos.doc says a child may exit
before the call returns, but dos.library 54.136 does not survive it.

This crashed TEST 9 with this driver too: real reads on two units,
round 85 of 150 (with the Rust virtioscsi.device, round 1). Measured
with QEMU's GDB stub; the write-up is in derfsss/rust-amigaos4-crate,
examples/virtio-scsi/docs/PROGRESS.md, "ROOT CAUSE".

The fix is the start-up handshake of the AmigaOS wiki's own child
process example (Exec Signals, SIGB_SINGLE): each child's first act is
Wait(SIGBREAKF_CTRL_F), and the parent sends CTRL-F only after
CreateNewProcTags() has returned. The entry functions also get the
dos.doc NP_Start prototype and return RETURN_OK.

Run three times at MCPd's priority, the system disk plus a second unit:
this driver 53.10 completes the suite each time with no crash (TESTs
4, 9, 10 and 12 pass; the known TEST 14 and 18 failures remain).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derfsss
derfsss merged commit d49c95f into main Nov 4, 2026
1 check passed
@derfsss
derfsss deleted the tests-startup-handshake branch November 4, 2026 23:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant