From 0acee60a3be9fe252f995d2f5a29908b151976a2 Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Tue, 22 Sep 2026 21:00:14 -0400 Subject: [PATCH] [MG_Remote] (P7): the spawn launcher passes MOBILEGL_IPC_WIRE_DEFERRED_MB through to the server child, the one MOBILEGL_IPC_* knob its environment scrub keeps BuildChildEnv drops every MOBILEGL_IPC_* entry, so the server-owned watermark meant something under inproc and silently nothing under spawn - measured: the spawn server parked 47 MiB against a lane budget of 8 with zero forced syncs, because it had parsed the default out of an environment that no longer carried the variable. The knob names no endpoint, role or segment size, so neither anti-recursion catch (Dial=No, ServerMain's scrub check of TRANSPORT / SERVER_PATH / RING_MB / STAGE_MB) is weakened; it is listed by name, not by widening the prefix. --- MobileGL/MG_Remote/Server/ServerSpawn.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/MobileGL/MG_Remote/Server/ServerSpawn.cpp b/MobileGL/MG_Remote/Server/ServerSpawn.cpp index 74f219ab..acfb4bc2 100644 --- a/MobileGL/MG_Remote/Server/ServerSpawn.cpp +++ b/MobileGL/MG_Remote/Server/ServerSpawn.cpp @@ -80,7 +80,21 @@ namespace MobileGL::MG_Remote::Server { // Every MOBILEGL_TRANSPORT and MOBILEGL_IPC_* goes. Built BEFORE fork: // between fork and execve only async-signal-safe calls are allowed, and // allocating a vector of strings is not one of them. + // + // EXCEPT A KNOB ONLY THE SERVER READS, named here one by one. P7 wave 4 M2's + // MOBILEGL_IPC_WIRE_DEFERRED_MB bounds the server's own orphaned wire buffer stores; + // nothing in the client reads it, so scrubbing it did not make the child safer - it made + // the knob mean something under inproc and silently nothing under spawn, the worst of + // the three states (the tcp server reads its supervisor's environment, as for every + // knob). It names no endpoint, no role and no segment size, so neither anti-recursion + // catch has anything to say about it. bool ShouldScrub(const char* entry) { + static constexpr const char* kServerOwned[] = {"MOBILEGL_IPC_WIRE_DEFERRED_MB="}; + for (const char* kept : kServerOwned) { + if (std::strncmp(entry, kept, std::strlen(kept)) == 0) { + return false; + } + } static constexpr const char* kPrefixes[] = {"MOBILEGL_TRANSPORT=", "MOBILEGL_IPC_"}; for (const char* prefix : kPrefixes) { if (std::strncmp(entry, prefix, std::strlen(prefix)) == 0) {