Skip to content
pi-c Check-in [6ce6dfd386]
Login

Check-in [6ce6dfd386]

Overview
Comment:tui: act on SIGTERM, SIGHUP and SIGQUIT outside the handler; fix the sign-in test's browser race

The terminal interface forked its SessionEnd launcher inside the signal handler. On macOS fork() runs the allocator's atfork lock, so a handler that interrupted malloc() crashes (SIGTRAP in _malloc_fork_prepare) or hangs: the "hooks SIGTERM" case hung with the reply on screen. The handler now only notes the signal and wakes the main loop (and run_sync), which restores the terminal, cancels the request, starts the launcher and re-raises. Crash signals restore the terminal and re-raise without forking.

The sign-in case's scripted browser counted launches with a read-modify-write of a file. macOS holds every run of a freshly written executable for about half a second on its first run, so the first two launches ran at once, both counted 1, and the third never signed in. Launches now take a slot with mkdir, and the script is run once before the sign-ins.

Timelines: family | ancestors | descendants | both | tui-flakes
Files: files | file ages | folders
SHA3-256: 6ce6dfd386746696de7a5964a2c77dab9364f6c87cbdf567588a87a6f4f19463
User & Date: dmestas on 2026-11-22 17:13:10.804
Other Links: branch diff | manifest | tags
Context
2026-11-22
17:38
land tui-flakes

via mac, quarry check-in: ec6e1a0c23 user: dmestas tags: trunk

17:24
Merge tui-flakes into vendor-8aa1823 closed check-in: cbb9a9dbb4 user: dmestas tags: vendor-8aa1823
17:13
tui: act on SIGTERM, SIGHUP and SIGQUIT outside the handler; fix the sign-in test's browser race

The terminal interface forked its SessionEnd launcher inside the signal handler. On macOS fork() runs the allocator's atfork lock, so a handler that interrupted malloc() crashes (SIGTRAP in _malloc_fork_prepare) or hangs: the "hooks SIGTERM" case hung with the reply on screen. The handler now only notes the signal and wakes the main loop (and run_sync), which restores the terminal, cancels the request, starts the launcher and re-raises. Crash signals restore the terminal and re-raise without forking.

The sign-in case's scripted browser counted launches with a read-modify-write of a file. macOS holds every run of a freshly written executable for about half a second on its first run, so the first two launches ran at once, both counted 1, and the third never signed in. Launches now take a slot with mkdir, and the script is run once before the sign-ins. closed check-in: 6ce6dfd386 user: dmestas tags: tui-flakes

14:39
land oauth-login

via mac, quarry check-in: c9fca5659c user: dmestas tags: trunk

Changes