SchOS/.claude/memory
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Nexoniarz a053a96add signal: the return trampoline was Linux-only, and a test that proves the rest
Went looking for why `X=$(echo hi)` hangs every shell. Did not find it. Found
two other things, and built the instrument that rules out the largest suspect.

**The signal return trampoline was ABI-blind.** deliver_signals() manufactures
a return address for the handler -- seven bytes on the user stack reading
`mov eax, 15 ; syscall`. Fifteen is *Linux's* rt_sigreturn, which is right for
anything musl-linked, and that is every port and every shell. For a first-party
binary it is native syscall 15, which is `open`. So a handler in any cmd/
program ran, returned into the trampoline, called open() with whatever the
handler had left in its registers, got -ENOENT, and carried on executing the
stack bytes after the trampoline.

    pid 14 sigtest: trap 14 err 4 rip 0x46ca7 addr 0xfffffffffffffffe
      rax=fffffffffffffffe ... rsp=46ca0
      ustack: 46e30 46ca0 50f0000000fb8 0 0 0

rip is rsp+7 -- one past a seven-byte trampoline -- and the third word of the
stack is the trampoline's own bytes. It emits the number for the process's ABI
now; syscall_map is the thing that says which numbering this process speaks.

**SIG_BLOCK, SIG_UNBLOCK and SIG_SETMASK were not defined anywhere.**
sys_sigprocmask branched on bare 0, 1 and 2 with the names in comments, so
anything outside the kernel had to spell the number and hope it had the right
one. Defined in posix.h, used in the kernel.

**cmd/sigtest** asserts the SIGCHLD/sigsuspend contract every shell is built
on, and it is written so a permissive stub cannot pass: a blocked SIGCHLD stays
pending, sigsuspend delivers an *already pending* signal without spinning, the
handler runs exactly once, the mask is restored, the child is still reapable,
and a signal arriving mid-wait also wakes it. Eight checks, all green. The
kernel's half of that contract is now proven rather than assumed, which is what
lets the remaining bug be pursued somewhere else.

Along with it, `rt_sigsuspend` in lib/usys.S -- the syscall existed and the
first-party library simply never exposed it.

On the hang itself: it is not job control, not SMP, not zsh (mksh does it too),
and not any value the kernel returns -- a full syscall trace is in
docs/history/kernel.md section 7, which also records what the contradiction
narrows to. That section had said "root cause not yet isolated" with three
suspects; all three are now eliminated, and the note says what to do next
instead of what to guess.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-21 23:56:34 +02:00
..
MEMORY.md memory: the SMP crash is SMP-only, and what the font work cost 2026-09-21 21:05:52 +02:00
nexoniarz-sharing-preference.md Carry project memory in the repo, with tools/memory-sync.sh 2026-08-09 14:27:22 +02:00
schcom-v0.md memory: Schcom v0, and the order change that put it before the installer 2026-08-09 23:12:56 +02:00
schfs-btree-phase1.md Carry project memory in the repo, with tools/memory-sync.sh 2026-08-09 14:27:22 +02:00
schfs-next-and-platform-roadmap.md memory: the SchFS and platform roadmap, and the 614 MB ceiling 2026-08-10 18:53:32 +02:00
schfs-phase2-mount.md Carry project memory in the repo, with tools/memory-sync.sh 2026-08-09 14:27:22 +02:00
schfs-phase3-writes.md Carry project memory in the repo, with tools/memory-sync.sh 2026-08-09 14:27:22 +02:00
schfs-v2-and-ramdisk.md Carry project memory in the repo, with tools/memory-sync.sh 2026-08-09 14:27:22 +02:00
schos-boot-split.md memory: schinit and the BIOS/UEFI split 2026-08-09 16:36:54 +02:00
schos-bootcheck-trust.md Rebuild when RAMROOT is toggled, and add an opt-in KVM target 2026-08-09 22:46:00 +02:00
schos-cross-platform-build.md Rewrite run.ps1; it was five kinds of stale 2026-08-09 14:49:47 +02:00
schos-fedora-move-bugs.md Fix two bugs the Fedora move exposed 2026-08-09 19:29:21 +02:00
schos-linux-machine.md docs: four directories, and a rule for when a thing leaves the roadmap 2026-09-12 17:13:35 +02:00
schos-memory-sync.md Carry project memory in the repo, with tools/memory-sync.sh 2026-08-09 14:27:22 +02:00
schos-performance-and-init.md memory: performance, init signal safety, and trusting the harness 2026-08-09 15:55:11 +02:00
schos-rename-and-git.md Carry project memory in the repo, with tools/memory-sync.sh 2026-08-09 14:27:22 +02:00
schos-schinit.md memory: schinit and the BIOS/UEFI split 2026-08-09 16:36:54 +02:00
schos-smp-userspace-corruption.md signal: the return trampoline was Linux-only, and a test that proves the rest 2026-09-21 23:56:34 +02:00
schos-uefi-loader.md Rebuild when RAMROOT is toggled, and add an opt-in KVM target 2026-08-09 22:46:00 +02:00
schunix-boot-splash-logo.md docs: four directories, and a rule for when a thing leaves the roadmap 2026-09-12 17:13:35 +02:00
schunix-build-environment.md docs: four directories, and a rule for when a thing leaves the roadmap 2026-09-12 17:13:35 +02:00
schunix-build-speed.md Carry project memory in the repo, with tools/memory-sync.sh 2026-08-09 14:27:22 +02:00
schunix-console-tty.md Carry project memory in the repo, with tools/memory-sync.sh 2026-08-09 14:27:22 +02:00
schunix-crash-screen.md branding: one mark, and PSOGM draws it 2026-09-21 21:35:58 +02:00
schunix-devfs-procfs.md Carry project memory in the repo, with tools/memory-sync.sh 2026-08-09 14:27:22 +02:00
schunix-device-model.md docs: four directories, and a rule for when a thing leaves the roadmap 2026-09-12 17:13:35 +02:00
schunix-dirsiz-14.md Carry project memory in the repo, with tools/memory-sync.sh 2026-08-09 14:27:22 +02:00
schunix-doom-acceptance-test.md docs: four directories, and a rule for when a thing leaves the roadmap 2026-09-12 17:13:35 +02:00
schunix-driver-infrastructure.md Carry project memory in the repo, with tools/memory-sync.sh 2026-08-09 14:27:22 +02:00
schunix-e1000-and-driver-layout.md docs: four directories, and a rule for when a thing leaves the roadmap 2026-09-12 17:13:35 +02:00
schunix-framebuffer-device.md Carry project memory in the repo, with tools/memory-sync.sh 2026-08-09 14:27:22 +02:00
schunix-ioremap-and-bars.md memory: UEFI reaches userspace, and the ISO grows a hierarchy 2026-08-09 22:04:12 +02:00
schunix-iso-boot.md memory: the installer is scoped, and the live CD is off the list 2026-08-09 22:20:20 +02:00
schunix-layout-migration.md docs: four directories, and a rule for when a thing leaves the roadmap 2026-09-12 17:13:35 +02:00
schunix-licensing.md docs: four directories, and a rule for when a thing leaves the roadmap 2026-09-12 17:13:35 +02:00
schunix-linux-abi-decision.md Carry project memory in the repo, with tools/memory-sync.sh 2026-08-09 14:27:22 +02:00
schunix-linux-open-flags.md Carry project memory in the repo, with tools/memory-sync.sh 2026-08-09 14:27:22 +02:00
schunix-network-stack-choice.md docs: four directories, and a rule for when a thing leaves the roadmap 2026-09-12 17:13:35 +02:00
schunix-pci-drivers.md Carry project memory in the repo, with tools/memory-sync.sh 2026-08-09 14:27:22 +02:00
schunix-qr-encoder.md docs: four directories, and a rule for when a thing leaves the roadmap 2026-09-12 17:13:35 +02:00
schunix-ramdisk-root-sizing.md Carry project memory in the repo, with tools/memory-sync.sh 2026-08-09 14:27:22 +02:00
schunix-rewrite-priorities.md Carry project memory in the repo, with tools/memory-sync.sh 2026-08-09 14:27:22 +02:00
schunix-roadmap-and-projects.md docs: four directories, and a rule for when a thing leaves the roadmap 2026-09-12 17:13:35 +02:00
schunix-schapi-direction.md docs: four directories, and a rule for when a thing leaves the roadmap 2026-09-12 17:13:35 +02:00
schunix-shm-and-mmap.md Carry project memory in the repo, with tools/memory-sync.sh 2026-08-09 14:27:22 +02:00
schunix-smp-and-memory-bugs.md docs: four directories, and a rule for when a thing leaves the roadmap 2026-09-12 17:13:35 +02:00
schunix-sockets-and-evdev.md Carry project memory in the repo, with tools/memory-sync.sh 2026-08-09 14:27:22 +02:00
schunix-syscall-single-table.md Carry project memory in the repo, with tools/memory-sync.sh 2026-08-09 14:27:22 +02:00
schunix-text-rendering.md Carry project memory in the repo, with tools/memory-sync.sh 2026-08-09 14:27:22 +02:00
schunix-ttf-rasteriser.md memory: the SMP crash is SMP-only, and what the font work cost 2026-09-21 21:05:52 +02:00
schunix-tty-fg-pgrp-coupling.md Carry project memory in the repo, with tools/memory-sync.sh 2026-08-09 14:27:22 +02:00
schunix-usb-ids.md docs: four directories, and a rule for when a thing leaves the roadmap 2026-09-12 17:13:35 +02:00
schunix-usb-xhci.md docs: four directories, and a rule for when a thing leaves the roadmap 2026-09-12 17:13:35 +02:00
schunix-verify-by-driving-shell.md Carry project memory in the repo, with tools/memory-sync.sh 2026-08-09 14:27:22 +02:00
schunix-virtio-gpu.md Carry project memory in the repo, with tools/memory-sync.sh 2026-08-09 14:27:22 +02:00
schunix-wall-clock.md Carry project memory in the repo, with tools/memory-sync.sh 2026-08-09 14:27:22 +02:00