Skip to content

RR3 native re-host v0.22.13: the load bias is no longer published before the image is mapped, and the review of that fix is in

Pre-release
Pre-release

Choose a tag to compare

@ArakiW ArakiW released this 15 Nov 19:16
· 18 commits to master since this release

Real Racing 3 -- Switch native re-host, v0.22.13

WHAT THIS FIXES

The console crash from 2026-11-10 is closed, and the cause was found by
reproducing the exact build the console ran and running addr2line against it.

commit a5ba9487 rebuilt;  nm(__libnx_exception_handler) = 0x8fb60
runtime base = 0x1abfbc5b60 - 0x8fb60 = 0x1abfb36000
pc  static 0x836f4 -> rr3::reapDetachedThreadWorker(void*)
                    native-switch/source/pthread_bridge.cpp:5881
lr  static 0x836f0 -> native-switch/source/pthread_bridge.cpp:5872

836ec:  bl   guestImageContains      <- the guard
836f0:  tbz  w0, #0, 83754           <- the guard's branch
836f4:  ldr  x26, [x25, x26]         <- the faulting instruction

x25 is the guest's load bias (0x59a29c1000), x26 is 0x1f6d5d0 -- the
port's own kAssetSingletonElfVa, a guest virtual address -- and the
effective address is 0x59a492e5d0, which is exactly the FAR in the dump.
So the port read a guest address that had no memory behind it. The same
site faulted on both console runs of that day.

WHY. The loader publishes the guest's load bias as soon as the image is
LOADED, but at that point the image is only RESERVED: reserveSegmentedTargets()
has claimed a CodeMemory address range and mapProcessCodeImages() has not
mapped it yet. The guard in front of the read, guestImageContains(), asked
the ELF's PT_LOAD table whether the address was in range and never asked
whether the image was mapped -- so it said yes, and the read faulted. The
2026-11-03 crash was the other half of the same bug (there the bias was still
zero and the slot was the raw ELF VA); only that half had been fixed.

guestImageContains() and resolveMainImageLoadBias() are the two doors
every guest-memory reader in the port goes through (guest_rtti,
race_state_probe, guest_action, guest_view_probe's flRead, and the
reaper), so gating both of them on the mapping being live closes the whole
class, not one site of it.

ALSO: the exception class in the dump was being read out of the wrong
field. esr=0x92000005 is EC 0x24 = "Data Abort from a lower Exception
level", with DFSC 0b000101 = "Translation fault, level 1" and WnR = 0, i.e.
an ordinary unmapped read. It is not a pointer-authentication failure:
SPAL is EC 0x0C, whose ESR is 0x3000_00xx. The "SPAL" reading had been
written into the source comment, a commit message and the docs, and it sent
one investigation after TPIDR_EL0 and PAC keys instead of after the unmapped
address. The crash dump now decodes its own ESR, so this cannot be misread
again.

AND THE REVIEW OF THE FIX FOUND THREE MORE DEFECTS IN IT (this release
includes them). The Antigravity CLI reviewed the change adversarially:

  • the new loaderMainImageMapped() would have heap-allocated inside the
    crash handler
    on the kernel exception stack, where nothing may allocate;
  • the reaper's chain of guest pointers after the guarded rung was still
    dereferenced raw -- the same crash, one rung later;
  • the segmented mapping path reported itself mapped after its first range.

All three are fixed. The review also had the instruction-abort and
data-abort exception classes swapped; the decode now names both families
explicitly.

WHAT THE NEXT CRASH FILE WILL TELL YOU

rr3-native-rehost.crash-early.txt now carries three new lines:

field what it answers
fault_class the exception in words: data-abort-translation-fault-l1 / data-abort / spal / instruction-abort / unknown
far_attribution whose MEMORY faulted (a guest DSO, port-nro+0x..., or unmapped) -- the pc already says whose CODE ran
main_image_mapped 1 or 0: was the guest image mapped when it faulted? A 0 here is the bug in one field.

HOW TO TEST

  1. Delete the old "RR3 Native Rehost" icon from the home menu first, then
    install this NSP. (Installing over the old one leaves the old icon and
    the old launch entry behind, and the two will fight.)
  2. Launch it from the home menu -- no hbmenu, no separate NRO.
  3. If it crashes, send rr3-native-rehost.crash-early.txt and
    rr3-native-rehost.guest-view.log back. The three new lines are the
    point of this release.

ALSO IN THIS RELEASE

  • The version is 0.22.13 in all three places it lives (rr3/version.hpp,
    the Makefile, the .nmeta), derived and checked by the contract tests.
  • docs/OPEN-ISSUES.md sections 9.41 and 9.44.2 are corrected and a new
    section 9.46 records the whole finding, including the two wrong readings
    that preceded it, why each was wrong, and what the review of the fix
    found.
  • The image-sized JIT probe was NOT the crash: it succeeded on that console
    (create=00000000 exec=00000000 close=00000000). It is left alone.
  • The 27-to-2 start-lights regression and the 211 compiler warnings are still
    open and are not touched by this release.

SUPERSEDES

v0.22.13 replaces v0.22.12 and every earlier release. v0.22.12 carried the
crash fix but had the three defects listed above; v0.22.13 has the fix and
those three closed.


SUPERSEDED BY v0.22.14. v0.22.13 carried the console crash fix, and that fix is still in v0.22.14. v0.22.14 adds the measurement fix: the "27 -> 2 start lights" collapse was the census counting the port's OWN log lines, not a game regression -- and an adversarial review of that first fix found three real defects in it (the counters sat in a function only ONE resolver branch calls, the contract test caught one of the five ways to break the property, and the document had the bound backwards). All three are fixed in v0.22.14, and the gate now parses the PowerShell harness before it runs it. Install v0.22.14.