LinuxUserland::read_maps reads /proc/self/maps into a fixed 8 KiB buffer and panics with buffer too small when the file reaches that limit. This caused the litebox_runner_linux_userland::run::brokered_getrandom test to fail in PR #1327 (failed job); the failed job passed on rerun without code changes.
The failure is timing-dependent in in-process runner mode. The runner establishes the broker association before Platform::new, while the broker concurrently starts eight request workers, its readiness notifier, and transport threads. Their stack VMAs are added while read_maps snapshots the process mappings. A traced successful run read about 6.4 KiB while additional workers were still being created; CI scheduled enough thread creation before or during the read to fill the 8 KiB buffer. Repeated targeted local runs passed, confirming the threshold race.
Replace the fixed-size read with an EOF-driven implementation that handles allocation failure explicitly. The fix should also account for the existing stale-snapshot TODO: allocations and mappings created during or after the read may be omitted, so the implementation and tests should avoid implying a stronger reservation guarantee than the platform actually provides.
LinuxUserland::read_mapsreads/proc/self/mapsinto a fixed 8 KiB buffer and panics withbuffer too smallwhen the file reaches that limit. This caused thelitebox_runner_linux_userland::run::brokered_getrandomtest to fail in PR #1327 (failed job); the failed job passed on rerun without code changes.The failure is timing-dependent in in-process runner mode. The runner establishes the broker association before
Platform::new, while the broker concurrently starts eight request workers, its readiness notifier, and transport threads. Their stack VMAs are added whileread_mapssnapshots the process mappings. A traced successful run read about 6.4 KiB while additional workers were still being created; CI scheduled enough thread creation before or during the read to fill the 8 KiB buffer. Repeated targeted local runs passed, confirming the threshold race.Replace the fixed-size read with an EOF-driven implementation that handles allocation failure explicitly. The fix should also account for the existing stale-snapshot TODO: allocations and mappings created during or after the read may be omitted, so the implementation and tests should avoid implying a stronger reservation guarantee than the platform actually provides.