Skip to content

SerialShell v1.3 — spawn-per-connection + output cap

Latest

Choose a tag to compare

@derfsss derfsss released this 24 Apr 17:49

SerialShell v1.3 completes the four-step hardening plan motivated by the 2026-04-23 A1222 wedge incident.

What's new since v1.2

  • Spawn-per-connection (step 3). Each accepted TCP connection is released from the parent's bsdsocket fd table with ReleaseSocket(UNIQUE_ID), handed to a freshly spawned handler process (CreateNewProcTags), and the listener resumes accepting immediately. Up to 8 concurrent handlers; additional connections receive SERIALSHELL_BUSY and are closed. A single wedged command now only hangs its own handler — the listener stays responsive.
  • Output cap. send_file caps per-command output at 64 KiB with a [OUTPUT TRUNCATED AT 65536 BYTES] marker, applied to both the default-command and SERIALSHELL_RUNCONSOLE paths. Binary UPLOAD/DOWNLOAD transfers are not capped (the caller already knows the size).
  • Per-command temp filenames. Output files live at T:serialshell_out_<task>_<seq>.txt so concurrent handlers can't collide and an orphan redirect from a still-running command can't lock out the next invocation.
  • Listen backlog raised to 32 so burst-connect storms queue rather than getting ECONNREFUSED'd before the parent can accept.
  • Recv timeout lowered to 10 s (idle-between-lines limit, not a command-duration cap).

Design note

An async SYS_Asynch + timer.device + NP_NotifyOnDeathSignalBit wall-clock watchdog on the default exec path was prototyped but abandoned: the death signal did not fire reliably on the A1222 for shell commands that spawn children. Step 3's isolation already prevents a hung command from affecting the listener, so the watchdog reduces to a prompt-timeout nicety rather than a correctness fix — not worth the AOS4-specific debugging burden.

Installation

The .lha archive contains SerialShell (PPC ELF binary built with walkero/amigagccondocker:os4-gcc11), SerialShell.readme, and an AmiUpdate-compatible AutoInstall script. See the readme inside the archive for manual/AmiUpdate install instructions.

Verification

Validated on A1222 Plus (NXP P1022) on 2026-04-24:

  • Functional regression (echo, copy, delete, list, upload/download round-trip) — all return within 10 s.
  • 50-connection stress test (half abandoned-banner, half cmd-then-drop) — server survived, post-stress echo clean.

Full changelog

See amiga/dist/SerialShell.readme inside the archive, or the CHANGELOG section.