A log line from a hook is written on the thread's host stack, and the controller applet's stand-in runs there: Drag x Drive (040041601D83A000, v196608) opened the controller applet from a game thread with too little stack left for the stand-in's log lines, SIGBUS in fprintf under focus_sync / h_hid_ShowCtrl 0x60 bytes below sp, then a hang in the crash handler (the PR author's report). Formatting one line takes about 2.7 KB of stack (fprintf to stderr, measured on macOS 27.2) and a hook runs on the stack of the game thread that calls it, so every hook that logs was exposed, as the file system, add-on content and audio hooks were before they moved one by one. LOG is now one call, dm_log (dm.h): the host's definition (hle_bigstack.c) formats the line through dm_bigstack_enter, on the host stack when the caller is on a guest stack and directly anywhere else, the variable arguments read from where the caller left them; programs that do not link hle_bigstack.c (unit tests) get dm.h's weak definition, which writes on the caller's stack. A hook needs HLE_FORCE_BIG only for its own stack use: both ShowControllerSupport overloads take it (the PR's change), since with too few players the front end's prompt runs on the game's thread. t_hid and t_hid_tsan link hle_bigstack.c (the PR left t_hid_tsan out, which no longer linked), and t_audio_stats captures dm_log where it captured fprintf. Not covered: direct fprintf(stderr) calls in a hook (the thread dumps of hle_thread.c, a debug line of hle_svc.c). Checked: t_bigstack (new case: a hook logs with 1 KB of guest stack left; SIGBUS with the line written on the guest stack), make run in dm/host/tests and dm/gfx/tests, the tsan, tsan-threads and memory-tsan targets, test_docs. OCTOPATH TRAVELER II on the Mac (M4 Pro), one full regress route on this host: 59.8 fps, no red line, clean exit (main: 59.5 fps); the regress comparison itself was not completed (the window was covered, and other jobs ran). Not run: Drag x Drive (no files here), iOS (PR #1943)

Co-authored-by: FifteenPen <[email protected]>
This commit is contained in:
seeddsandFifteenPen committed 2026-11-11 16:03:28 +08:00
1 parent 1e69c180ce
commit 2d3fb83b83
9 files changed
+83 -14

No files matched your search

+14 -2
View File
@@ -27,8 +27,20 @@ static inline int dm_host_thread_join(pthread_t thread, void **result) {
return r;
}
// The message and its newline under one stream lock: written apart, another thread's line could land between them and two messages share a log line
#define LOG(...) do { flockfile(stderr); fprintf(stderr, "[dm] " __VA_ARGS__); fputc('\n', stderr); funlockfile(stderr); } while (0)
// One log line: the message and its newline under one stream lock (written apart, another thread's line could land between them and two messages share a log line).
// The host's dm_log (hle_bigstack.c) writes it on the thread's big host stack when the caller is on a guest stack: formatting one line takes about 2.7 KB of stack, and a take-over
// runs on the stack of the game thread that calls it, which can have less left (memory.md, Log lines on small guest stacks). The definition here is a weak one that writes on the
// caller's stack, for the programs that do not link hle_bigstack.c (unit tests, whose stacks are host stacks); the host's replaces it at link time
__attribute__((format(printf, 1, 2))) void dm_log(const char *fmt, ...);
#ifndef DM_LOG_IMPL
#include <stdarg.h>
__attribute__((weak)) void dm_log(const char *fmt, ...) {
va_list ap; va_start(ap, fmt);
flockfile(stderr); vfprintf(stderr, fmt, ap); fputc('\n', stderr); funlockfile(stderr);
va_end(ap);
}
#endif
#define LOG(...) dm_log("[dm] " __VA_ARGS__)
#define die(...) do { LOG("FATAL " __VA_ARGS__); abort(); } while (0)
typedef struct { uint32_t st_name; uint8_t st_info, st_other; uint16_t st_shndx; uint64_t st_value, st_size; } Elf64_Sym;
+20 -1
View File
@@ -8,9 +8,13 @@
// and dm_bigstack_caller (hle.h) gives it back, so take-overs that log their call site (audio Start / Stop / Close) name the game's code on either path.
// Only register arguments are carried over: functions with more than 8 integer / 8 floating-point arguments, or variadic ones reading from the stack, cannot use it.
// iOS does not allow generating executable code at run time, so the stubs are generated at compile time by the macro, not written at run time as DM_HLECOUNT does
// Log lines take the same entry (dm_log below, dm.h LOG): any take-over may log, and formatting one line takes about 2.7 KB of stack, so a line logged on a guest stack is
// written on the host stack whether or not its take-over is registered through HLE_FORCE_BIG (the controller applet's stand-in from a game thread of Drag x Drive, PR #1943)
#include <pthread.h>
#include <stdarg.h>
#include <stdint.h>
#include <sys/mman.h>
#define DM_LOG_IMPL // dm_log is defined here, not by dm.h's weak definition
#include "dm.h"
int dm_guest_as_contains(uintptr_t a); // hle_svc.c
@@ -30,7 +34,7 @@ uintptr_t dm_bigstack_top(uintptr_t sp) {
uint8_t *top = pthread_getspecific(g_bs_key);
if (!top) {
uint8_t *m = mmap(NULL, BS_SIZE + BS_GUARD, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
if (m == MAP_FAILED) { LOG("[RED] big stack mapping failed, staying on the guest stack this time"); return 0; }
if (m == MAP_FAILED) { fputs("[dm] [RED] big stack mapping failed, staying on the guest stack this time\n", stderr); return 0; } // not LOG: its dm_log comes back here for a stack
mprotect(m, BS_GUARD, PROT_NONE); // guard page: running off the host stack itself crashes here instead of quietly corrupting another mapping
top = m + BS_GUARD + BS_SIZE;
pthread_setspecific(g_bs_key, top);
@@ -95,3 +99,18 @@ void *dm_bigstack_caller(void *ra) {
void **top = ra == (void *)dm_bigstack_ret ? pthread_getspecific(g_bs_key) : NULL; // set: a switch happened on this thread
return top ? top[-1] : ra;
}
// A log line (dm.h LOG). The variable arguments stay where the caller put them (on its stack, which stays mapped); only the formatting moves: log_emit is entered through
// dm_bigstack_enter as a take-over is, with the argument list by address, so on a guest stack it runs on the host stack and anywhere else it is jumped to directly
static void log_emit(const char *fmt, va_list *ap) __attribute__((used));
static void log_emit(const char *fmt, va_list *ap) {
flockfile(stderr); vfprintf(stderr, fmt, *ap); fputc('\n', stderr); funlockfile(stderr);
}
void log_emit_bs(const char *fmt, va_list *ap);
__asm__(".text\n.p2align 2\n.globl _log_emit_bs\n.private_extern _log_emit_bs\n_log_emit_bs:\n"
" adrp x16, _log_emit@PAGE\n add x16, x16, _log_emit@PAGEOFF\n b _dm_bigstack_enter\n");
void dm_log(const char *fmt, ...) {
va_list ap; va_start(ap, fmt);
log_emit_bs(fmt, &ap);
va_end(ap);
}
+4 -2
View File
@@ -660,6 +660,8 @@ HLE_FORCE("_ZN2nn3hid20StopLrAssignmentModeEv", "L/R assignment mode; ignored by
// (GitHub issue #1640: Mario Kart World's player screen closed when the second controller had not pressed yet). Without a window, or with scripted input (DM_KEYS, DM_CTL), nobody
// is at the controllers: the host answers at once, as the player closing it. An OK with fewer players is an answer a Switch never gives: Mario Kart 8 Deluxe asks for two in 2P
// and opened the applet again every few frames on it (GitHub issue #550)
// Both overloads run on the big host stack (HLE_FORCE_BIG): with too few players the front end's prompt runs on the game's thread, and Drag x Drive opens the applet from a
// thread with less than a log line's worth of stack left (PR #1943; memory.md, Host calls on small guest stacks)
#define RES_CTRL_CANCELED (202u | 3101u << 9)
int dm_players_reported(void) { // a pair of Joy-Cons split into two npads is two players
int n = 0; for (int p = 0; p < DM_PLAYERS; p++) n += reported(p) + (reported(p) && joy_active(p) && joy_split(p) && split_target(p) >= 0);
@@ -687,7 +689,7 @@ static Result ctrl_support(int32_t *info, const int8_t *arg) {
if (info) { info[0] = count; info[1] = (int32_t)connected_id(); }
return canceled ? RES_CTRL_CANCELED : RES_OK;
}
HLE_FORCE("_ZN2nn3hid21ShowControllerSupportEPNS0_27ControllerSupportResultInfoERKNS0_20ControllerSupportArgE", "controller applet; the host reports the connected players (fewer than the minimum: the front end's prompt waits for more, canceled without a window)",
HLE_FORCE_BIG("_ZN2nn3hid21ShowControllerSupportEPNS0_27ControllerSupportResultInfoERKNS0_20ControllerSupportArgE", "controller applet; the host reports the connected players (fewer than the minimum: the front end's prompt waits for more, canceled without a window)",
Result, h_hid_ShowCtrl, int32_t *info, const int8_t *arg) {
DM_APPLET("controller support");
return ctrl_support(info, arg);
@@ -1129,7 +1131,7 @@ HLE_FORCE("_ZN2nn3hid19GetPlayerLedPatternERKj", "player LED: the Switch's patte
static void ctrl_color(uint32_t *c) { c[0] = 0xff828282u; c[1] = 0xff0f0f0fu; }
HLE_FORCE("_ZN2nn3hid22GetNpadControllerColorEPNS0_19NpadControllerColorERKj", "controller color", Result, h_hid_Color, uint32_t *c, const uint32_t *id) { (void)id; ctrl_color(c); return RES_OK; }
HLE_FORCE("_ZN2nn3hid22GetNpadControllerColorEPNS0_19NpadControllerColorES2_RKj", "left and right Joy-Con colors", Result, h_hid_Color2, uint32_t *l, uint32_t *r, const uint32_t *id) { (void)id; ctrl_color(l); ctrl_color(r); return RES_OK; }
HLE_FORCE("_ZN2nn3hid21ShowControllerSupportERKNS0_20ControllerSupportArgE", "controller applet (no result wanted); the host answers as the overload above", Result, h_hid_ShowCtrl0, const int8_t *arg) { DM_APPLET("controller support"); return ctrl_support(NULL, arg); }
HLE_FORCE_BIG("_ZN2nn3hid21ShowControllerSupportERKNS0_20ControllerSupportArgE", "controller applet (no result wanted); the host answers as the overload above", Result, h_hid_ShowCtrl0, const int8_t *arg) { DM_APPLET("controller support"); return ctrl_support(NULL, arg); }
HLE_FORCE("_ZN2nn3hid24ShowControllerStrapGuideEv", "strap guide applet; not shown by the host", Result, h_hid_Strap, void) { DM_APPLET("controller strap guide"); return RES_OK; }
HLE_FORCE("_ZN2nn3hid24ShowControllerStrapGuideERKNS0_13StrapGuideArgE", "strap guide applet with its argument (SDK 22); not shown by the host", Result, h_hid_StrapArg, const void *arg) { DM_APPLET("controller strap guide"); (void)arg; return RES_OK; }
HLE_FORCE("_ZN2nn3hid28ShowControllerFirmwareUpdateERKNS0_27ControllerFirmwareUpdateArgE", "controller firmware update applet; not shown by the host", Result, h_hid_FwUpd, const void *arg) { DM_APPLET("controller firmware update"); (void)arg; return RES_OK; }
+4 -4
View File
@@ -244,10 +244,10 @@ $(B)/t_motion_pro: t_motion_pro.c ../motion_pro.h | $(B)
$(CLANG) -O1 -g -Wall -Werror -fsanitize=address,undefined -o $@ t_motion_pro.c
$(B)/t_motion_pro_mac: t_motion_pro_mac.m ../motion_pro_mac.h ../motion_pro.h ../dm_input.h | $(B)
$(CLANG) -O1 -g -fobjc-arc -Wall -Werror -Wno-unused-function -fsanitize=address,undefined -I.. -o $@ t_motion_pro_mac.m -framework Foundation -framework GameController -framework IOKit
$(B)/t_hid: t_hid.c ../hle_hid.c ../motion_fusion.h ../hle_haptics.c ../hle_haptics.h ../pad_slots.h ../dm_input.h ../hle.h ../dm.h $(GAME_H) | $(B)
$(CLANG) -O1 -Wall -Werror -Wno-unused-function -I.. $(GINC) -o $@ t_hid.c ../hle_haptics.c
$(B)/t_hid_tsan: t_hid.c ../hle_hid.c ../motion_fusion.h ../hle_haptics.c ../hle_haptics.h ../pad_slots.h ../dm_input.h ../hle.h ../dm.h $(GAME_H) | $(B)
$(CLANG) -O1 -g -fsanitize=thread -Wall -Werror -Wno-unused-function -I.. $(GINC) -o $@ t_hid.c ../hle_haptics.c
$(B)/t_hid: t_hid.c ../hle_hid.c ../motion_fusion.h ../hle_haptics.c ../hle_haptics.h ../pad_slots.h ../dm_input.h ../hle_bigstack.c ../hle.h ../dm.h $(GAME_H) | $(B)
$(CLANG) -O1 -Wall -Werror -Wno-unused-function -I.. $(GINC) -o $@ t_hid.c ../hle_haptics.c ../hle_bigstack.c
$(B)/t_hid_tsan: t_hid.c ../hle_hid.c ../motion_fusion.h ../hle_haptics.c ../hle_haptics.h ../pad_slots.h ../dm_input.h ../hle_bigstack.c ../hle.h ../dm.h $(GAME_H) | $(B)
$(CLANG) -O1 -g -fsanitize=thread -Wall -Werror -Wno-unused-function -I.. $(GINC) -o $@ t_hid.c ../hle_haptics.c ../hle_bigstack.c
$(B)/t_haptics: t_haptics.c ../hle_haptics.c ../hle_haptics.h ../dm_input.h | $(B)
$(CLANG) -O1 -g -Wall -Werror -I.. -o $@ t_haptics.c ../hle_haptics.c
$(B)/t_haptics_apple: t_haptics_apple.m ../haptics_apple.m ../haptics_apple.h ../hle_haptics.c ../hle_haptics.h | $(B)
+8 -5
View File
@@ -12,10 +12,11 @@ static char lines[8][512];
static void checked_flockfile(FILE *f) { (void)f; if (in_callback) atomic_fetch_add(&callback_io, 1); }
static void checked_funlockfile(FILE *f) { (void)f; }
static int checked_fputc(int c, FILE *f) { (void)f; return c; }
static int checked_fprintf(FILE *f, const char *fmt, ...) {
(void)f;
if (in_callback) { atomic_fetch_add(&callback_io, 1); return 0; }
if (!strstr(fmt, "device callbacks")) return 0;
static int checked_fprintf(FILE *f, const char *fmt, ...) { (void)f; (void)fmt; if (in_callback) atomic_fetch_add(&callback_io, 1); return 0; }
// A log line (dm.h LOG is one call, dm_log): hle_audio.c's lines come here
__attribute__((format(printf, 1, 2))) static void checked_log(const char *fmt, ...) {
if (in_callback) { atomic_fetch_add(&callback_io, 1); return; }
if (!strstr(fmt, "device callbacks")) return;
if (atomic_exchange(&block_report, 0)) {
dispatch_semaphore_signal(report_entered);
dispatch_semaphore_wait(report_allow, DISPATCH_TIME_FOREVER);
@@ -25,13 +26,15 @@ static int checked_fprintf(FILE *f, const char *fmt, ...) {
if (n < 8) vsnprintf(lines[n], sizeof lines[n], fmt, ap);
va_end(ap);
atomic_fetch_add(&reports, 1); dispatch_semaphore_signal(report_done);
return 0;
}
#define flockfile checked_flockfile
#define funlockfile checked_funlockfile
#define fputc checked_fputc
#define fprintf checked_fprintf
#define DM_LOG_IMPL // dm.h declares dm_log, which is checked_log here, and leaves its definition out
#define dm_log checked_log
#include "../hle_audio.c"
#undef dm_log
#undef fprintf
#undef fputc
#undef funlockfile
+21
View File
@@ -2,7 +2,9 @@
// gives back the game's call site both after a switch and straight through off the guest block (the audio Start / Stop / Close log it, PR #721)
#include "../hle.h"
#include <stdio.h>
#include <string.h>
#include <sys/mman.h>
#include <unistd.h>
static uintptr_t g_lo, g_hi; // the fake guest stack: 16 KB above a guard page
int dm_guest_as_contains(uintptr_t a) { return a >= g_lo && a < g_hi; }
@@ -18,6 +20,13 @@ HLE_FORCE_BIG("_ZN4test5probeEmmd", "unit test", uint64_t, probe, uint64_t a, ui
return a * 3 + b + (uint64_t)d + (uint64_t)(big[0] + big[sizeof big - 1]);
}
// a take-over on the guest stack (plain HLE_FORCE) that logs, with integer, string and floating-point arguments
HLE_FORCE("_ZN4test4logsEm", "unit test", uint64_t, logs, uint64_t a) {
g_fp = (uintptr_t)__builtin_frame_address(0);
LOG("big-stack test line %llu from a %s stack %.2f", (unsigned long long)a, "guest", 2.5);
return a + 1;
}
// call_on(a, b, d, top, fn): calls fn(a, b, d) with sp = top (0: on this stack); _call_on_site is the return address the call leaves, the "game's call site"
uint64_t call_on(uint64_t a, uint64_t b, double d, uintptr_t top, const void *fn);
extern const char call_on_site[];
@@ -53,6 +62,18 @@ int main(void) {
CHECK(r == 6 + 3, "arguments on the direct path");
CHECK(g_site == (void *)call_on_site, "dm_bigstack_caller passes the call site through on the direct path");
// a log line from a take-over that is not registered through HLE_FORCE_BIG: 1 KB of guest stack is left, less than one line's formatting needs (about 2.7 KB), and the line
// still comes out whole, written on the host stack (dm_log)
int saved = dup(2), fds[2];
if (saved < 0 || pipe(fds) || dup2(fds[1], 2) < 0) { perror("pipe"); return 1; }
r = call_on(41, 0, 0.0, g_lo + guard + 1024, logs);
fflush(stderr); dup2(saved, 2); close(saved); close(fds[1]);
char got[256]; ssize_t n = read(fds[0], got, sizeof got - 1); close(fds[0]);
got[n > 0 ? n : 0] = 0;
CHECK(r == 42, "the logging take-over returned on its own stack");
CHECK(g_fp && dm_guest_as_contains(g_fp), "the logging take-over itself ran on the guest stack");
CHECK(!strcmp(got, "[dm] big-stack test line 41 from a guest stack 2.50\n"), "the log line written from 1 KB of guest stack");
printf("big-stack entry: %d/%d checks %s\n", checks - fails, checks, fails ? "✗" : "✓");
return fails != 0;
}
+2
View File
@@ -44,6 +44,8 @@ void hle_bind_system_event(void *g, int autoclear) { (void)g; (void)autoclear; }
void hle_signal_system_event(void *g) { g_signalled = g; g_signals++; }
int hle_signal_bound_system_event(void *g) { g_signalled = g; g_signals++; return 1; }
void dm_gfx_texlist(int target) { (void)target; }
// the guest address space (hle_svc.c): the unit test has none, so every stack is a host stack and the big-stack take-overs (the controller applet) run on it directly (hle_bigstack.c)
int dm_guest_as_contains(uintptr_t a) { (void)a; return 0; }
void dm_gfx_restop(void) {}
void dm_gfx_texraw(uint64_t serial, const char *path) { (void)serial; (void)path; }
void dm_ctl_peek(uint64_t a, int n) { (void)a; (void)n; }
+1
View File
@@ -166,6 +166,7 @@ One line per symptom in the [subsystem references](../reference/): what you see
- a model load exhausts its resource heap: a null `operator new` at the world load, or `BufferInitialize: pool has no storage` followed by a null-pool crash. A display-list heap that runs out shows as `AddCommandMemory` with a null pool outside a recording, then host-lent segments growing until `FATAL NVN command memory` (Host-lent command memory segments). → [Model heaps sized by the host's command record sizes](../reference/memory.md#model-heaps-sized-by-the-hosts-command-record-sizes)
- the frames stop at the first loading screen, a graphics worker at 100% CPU (17 s in, `UnityGfxDeviceWorker` running, the main thread waiting on a condition variable, no red line). → [Unity's GPU pool block allocation spins at size 0](../reference/memory.md#unitys-gpu-pool-block-allocation-spins-at-size-0)
- SIGBUS inside a host hook (`snprintf` under `mount_ex` / `h_fs_MountSave`), then the process hangs (Super Mario 3D World + Bowser's Fury); SIGBUS inside Metal (`AGCDeserializedReply`, an AGX compiler block) at an address in the guest stack region (Breath of the Wild). → [Host calls on small guest stacks](../reference/memory.md#host-calls-on-small-guest-stacks)
- SIGBUS in `__sfvwrite` / `__vfprintf` under `fprintf`, from a hook that only logs (`focus_sync` under `h_hid_ShowCtrl`, the controller applet), at an address a few bytes below sp and just under a page of the guest thread's stack; then the process hangs in the crash handler. → [Log lines on small guest stacks](../reference/memory.md#log-lines-on-small-guest-stacks)
- the iPhone app is killed for memory; resident memory grows steadily (about 0.2 MB a frame) while the residency set and the texture counts stay flat. → [Deferred-release drain without an autorelease pool](../reference/memory.md#deferred-release-drain-without-an-autorelease-pool)
- out of focus, with the picture still and the sound on, GPU allocated climbs by hundreds of MB a second while the residency set stays flat, and swap follows it. → [Retired pool buffers pile up while a game submits nothing](../reference/memory.md#retired-pool-buffers-pile-up-while-a-game-submits-nothing)
- in an area load GPU allocated jumps by 6-10 GB between two stats windows (Ocarina of Time: 3.3 GB at frame 900, 15.8 GB at frame 1200 on a 16 GB M5, issue #2068; 3.5 to 13.7 GB inside the load on an M5 Pro) while the residency set grows by about 4 GB, and stays there. The memory census's "not counted" line is 8 GB, and the pool buffers made sum to twice the pools' size. → [The pool walk's statistics made chunks of a large pool](../reference/memory.md#the-pool-walks-statistics-made-chunks-of-a-large-pool)
+9
View File
@@ -439,6 +439,15 @@ The guest address space, heaps, pools, virtual address memory and the allocators
- **Fix:** every hook in `hle_fs.c` now registers through `HLE_FORCE_BIG` (`hle.h`): a compile-time stub loads the implementation into x16 and jumps to `dm_bigstack_enter` (`hle_bigstack.c`), which moves the call to a per-thread 512 KB host stack (with a guard page) when sp lies in the guest address block, passing x0–x8 and d0–d7 through. Only for functions with register arguments only (no variadic or stack arguments). iOS forbids generating code at run time, so the stubs are static. NVN functions are not registered through `HLE_FORCE`, so they got their own big-stack entry: every implemented NVN function except the `nvnCommandBuffer*` recording calls goes through `nvn_big_entry` (`nvn_entry.S`), which finds the implementation by slot and hands it to `dm_bigstack_enter` ([NVN entry points on the big host stack](nvn-objects.md#nvn-entry-points-on-the-big-host-stack)).
- **Found on:** [Super Mario 3D World + Bowser's Fury](../../dm/games/010028600EBDA000/README.md) (file system hooks); [The Legend of Zelda: Breath of the Wild](../../dm/games/01007EF00011E000/README.md) (NVN entry points).
### Log lines on small guest stacks
- **Symptom:** SIGBUS in `__sfvwrite` / `__vfprintf` under `fprintf`, from a hook that only logs (`focus_sync` under `h_hid_ShowCtrl`, the controller applet), at an address a few bytes below sp and just under a page of the guest thread's stack; then the process hangs in the crash handler.
- **Cause:** formatting one log line takes about 2.7 KB of stack (`fprintf` to the unbuffered `stderr`, measured on macOS 27.2), and a hook runs on the stack of the game thread that calls it ([Host calls on small guest stacks](#host-calls-on-small-guest-stacks)). Any hook that logs was exposed on a thread with less left; the library applet stand-ins log twice before they answer (`DM_APPLET`'s `oe library applet` line, then `focus_sync`'s focus state), and Drag x Drive opens the controller applet from such a thread.
- **Fix:** `LOG` is one call, `dm_log` (`dm.h`), and the host's definition (`hle_bigstack.c`) formats the line through `dm_bigstack_enter`: on a guest stack the line is written on the thread's host stack, the variable arguments read from where the caller left them; anywhere else it is written directly. So a hook needs `HLE_FORCE_BIG` only for its own stack use, not for logging. Programs that do not link `hle_bigstack.c` (unit tests) get `dm.h`'s weak definition, which writes on the caller's stack. The controller applet's two hooks (`ShowControllerSupport`, `hle_hid.c`) also register through `HLE_FORCE_BIG`: with too few players the front end's prompt runs on the game's thread. Direct `fprintf(stderr, …)` calls in a hook are not covered.
- **Check:** `t_bigstack` logs from a hook with 1 KB of guest stack left (SIGBUS with the line written on the guest stack).
- **Found on:** Drag x Drive (`040041601D83A000`, v196608; PR #1943, its profile is a pull request of its own): once in a session, on the screen after a time trial. Not rerun there with this fix.
### Deferred-release drain without an autorelease pool
- **Symptom:** the iPhone app is killed for memory; resident memory grows steadily (about 0.2 MB a frame) while the residency set and the texture counts stay flat.