The printf family formatted floating-point conversions through the host,
which prints every exact digit and rounds ties to even. The libc.prx
that titles ship keeps the exact digits only down to a position derived
from the binary exponent and prints zeros after them, rounds half up on
the kept digits, and rounds an exact tie down once that exponent
estimate reaches 8. So %.0f of 2.5 is 3 and %.1f of 0.25 is 0.3 there,
and %.20f of 0.1 is 0.10000000000000000555.
Format finite double and long double e, f and g conversions with those
rules from exactly generated digits, on every host. On 600,000 random
formats every output with up to 17 significant digits now matches the
copies bundled with PPSA07923, PPSA05916 and PPSA13934; longer outputs
still differ where the console's extended-precision digits end one unit
lower.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The libc debt entry for %a and %A still described the Windows-only
formatter and said Linux hands %a to glibc; since Linux routes %a and %A
to the same formatter, describe it for both platforms.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Linux handed a format without wide arguments, %m or %p to glibc, so %a
there still printed subnormals unnormalised and rounded hexadecimal
digits half to even, and CheckHexFloat, which runs on every host,
failed on Linux. Route %a and %A to FormatWindows on Linux as well.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Windows printf family handed %a and %A to the host, whose UCRT prints
a subnormal unnormalised (0x0.0000000000001p-1022) and pads with zeros
even when the - flag is given (%-010a of 1.5 gave 0x001.8p+0). The
libc.prx that titles ship normalises subnormals (0x1p-1074), rounds a
shorter precision half up without renormalising a carry, and lets -
override 0, as C requires.
Finite doubles are now formatted here, checked against three titles'
copies of libc.prx run side by side.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
pthread_mutexattr_setkind_np stored only kinds 1 to 4 and threw for others.
FreeBSD 11.4 stores any kind, pthread_mutexattr_gettype rejects kinds of
PTHREAD_MUTEX_TYPE_MAX or more with EINVAL, and mutex_check_attr makes
pthread_mutex_init fail with EINVAL for a kind outside the mutex types.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01B7MJ4KkM4JNNWQxjsXT4ib
An executable's local TPOFF64, DTPOFF64 or DTPMOD64 relocation passed
whenever a PT_TLS header existed, so the Linux targets emitted it next
to a PT_TLS with p_memsz 0, while the Windows and macOS relocation
builder rejected the same input. glibc's ld.so sets up the main
program's TLS module only for a PT_TLS with p_memsz > 0, so such a
relocation has no block to resolve against. The pipeline now requires a
PT_TLS with a nonzero p_memsz and fails on every target with "TLS
relocation in an executable without a non-empty PT_TLS segment".
Relocations against imported TLS symbols are unchanged.
A guest STT_NOTYPE import that resolved to another guest's STT_TLS
export was accepted when R_X86_64_64, R_X86_64_GLOB_DAT or
R_X86_64_JUMP_SLOT referenced it, and every target filled the slot
with an address that is not the variable. The gABI lets only TLS
relocations reference an STT_TLS symbol; the reader already rejects
such relocations against a TLS-typed import, and the builder rejects
OBJECT and FUNC imports of a TLS export as a type mismatch. The
builder now also rejects a referenced NOTYPE import of a guest TLS
export with "Non-TLS relocation against guest TLS export". These
inputs exit 2 on Linux, Windows and macOS instead of producing
outputs; unreferenced NOTYPE entries and TLS relocations are
unchanged.
GuestImageReader rejected a defined symbol whose section index is
SHN_LORESERVE (0xff00) or higher, SHN_ABS excepted, only when it was
not STT_TLS, so a TLS symbol in SHN_ABS, SHN_COMMON, 0xff00 or
SHN_XINDEX was accepted. The Linux output kept it in .dynsym with that
section index, Windows and macOS failed only for an export outside
SHN_ABS, and both wrote st_value plus addend for a DTPOFF64 relocation
against a local one. The gABI gives a defined STT_TLS symbol its
assigned TLS offset and no meaning in a special section index, so
every such symbol now fails with "Unsupported special symbol section"
before the TLS bounds check. SHN_ABS stays accepted for other symbol
types.
The Windows registration check fails when a test executable is built but no ctest test runs it. Put the executable under ANYPS5_RUN_QUARANTINED_FRAME_REPLAY as well, so OFF neither builds nor registers it and ON does both.
ImportAllocationProbe::Allocate moves onImport out before calling it.
libc++ leaves a moved-from std::function with a small stored functor
callable, so on macOS the hook fired again on the next import while
HostImportFor held the guest buffer memory mutex; replacing the
unrelated range then waited for imports on that mutex and
agc_driver_graphics hung until the test timeout. Taking the hook with
std::exchange leaves it empty on every standard library.
Co-authored-by: Himansh Raj <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>