tests: guest_floating_point fails at random on AMD hosts: "feholdexcept workers preserve the main environment" #10899
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by TechLevelZero on 2026-10-25T08:21:46Z.
What happens
guest_floating_pointaborts in roughly a quarter to a third of runs on an AMD EPYC host, even with the machine idle:The check (
core/libs/tests/GuestFloatingPoint.cpp:331) compares all 28 bytes of thefnstenvimage from before the two worker threads with the image afterjoin. That includes the last x87 instruction pointer, its selector and opcode, and the last operand pointer and its selector (words 3 to 6). AMD CPUs only save those when an x87 exception is pending, so when the main thread is switched out duringjoinand its state is restored, they come back as zero. The control, status and tag words and MXCSR, which are what the workers could affect, are unchanged.Logged from an instrumented build, on a failing run:
Title, test or build step
ctest
guest_floating_point. It failed 47 of 200 rounds of the full suite.AnyPS5 commit
main25c1aa1e79; the test is unchanged on2742004ed2.System
AMD EPYC 7281 (Zen 1), Proxmox VM with 56 vCPUs, Ubuntu 24.04, GCC 14.2.0, Release.
Steps to reproduce
Run
build/tests/guest_floating_point_tests build/core/libs/libs/unpatched/libc.prx300 times in a loop.Fix
The branch
fix/floating-point-thread-check-fpu-pointerscompares only words 0 to 2 and MXCSR at that check.CheckHoldstill checks thatfeholdexceptitself keeps the pointer state (line 254).maintools/check_conventions.pypasses andtools/pr_overlap.pyfinds no overlap. I'll open it as a pull request once my first one is merged (open-PR limit).AI-assisted: yes (Claude Code)