ACNHRecomp icon indicating copy to clipboard operation
ACNHRecomp copied to clipboard

HHP Finale Crash – Fatal "Call into the Middle of a Function" at main+0x621410

Open kcijseries opened this issue 2 weeks ago • 7 comments

Environment

ACNHRecomp: v0.11.0

Game version: Animal Crossing: New Horizons 3.0.3

Platform: Linux x64

OS: CachyOS Linux

Kernel: 7.3.5-2

Graphics API: Vulkan

Resolution: 1920×1080

Frame rate setting: 30 FPS

Description

The game consistently crashes during the Happy Home Paradise (HHP) finale.

I have completed all 30 vacation homes and all HHP facilities, including the Apparel Shop.

When I return to the HHP island, Lottie and Niko meet me at the boat. They take me to the Apparel Shop, after which the final event/concert sequence begins. The game crashes during this sequence.

Crash details

The ACNHRecomp problem report contains the following fatal error:

FATAL: call into the middle of a function: main+621410 (lr main+6213e0)

The crash occurs on the game thread.

Investigation

I inspected the original ARM64 game code in analysis/main.bin around the reported address.

The instructions at 0x621400 implement an indirect jump-table dispatch:

00621400: adr x10, #0x621410 00621404: ldrb w11, [x26, x9] 00621408: add x10, x10, w11, lsl #2 0062140C: br x10 00621410: smaddl x10, w8, w21, x20

The jump-table destinations are internal branches within the original function beginning at 0x621310.

The reported crash target, 0x621410, is therefore a legitimate internal branch destination in the original ARM64 code.

This makes me wonder whether the recompiler is incorrectly treating an indirect jump-table destination as a function entry or otherwise mishandling this control-flow pattern.

I understand this is not yet proof of the exact cause, but the crash address and original instructions appear closely related.

Additional information

The installed acnh and acnh_prepare executables have been SHA-256 checked against the downloaded v0.11.0 Linux release and match exactly.

The generated library is game/linux-x64/libacnh_game.so.

Its build ID is FF1D1C05670DB6021C85B624A710B963.

Its revision is 4.

The crash does not appear to be an ordinary Vulkan device-loss error.

Attachments

I can provide:

The ACNHRecomp problem report ZIP containing the current and previous session logs.

The ARM64 disassembly around 0x621310–0x621588.

The original game recording showing the HHP finale crash.

Could you investigate whether this is a recompiler issue involving indirect jump-table targets or function-boundary detection?

Thank you for your work on ACNHRecomp.

kcijseries avatar Nov 22 '26 06:11 kcijseries

Additional technical findings – suspected jump-table / indirect-branch issue

Further investigation has identified a possible cause of the crash in the recompiled main module.

The original crash reports:

FATAL: call into the middle of a function: main+621410 (lr main+6213e0)

The relevant guest ARM64 instructions in analysis/main.bin are:

main+6213DC: bl #0x622a34 main+6213E0: tbz w0, #0, #0x6213b0 ... main+621400: adr x10, #0x621410 main+621404: ldrb w11, [x26, x9] main+621408: add x10, x10, x11, lsl #2 main+62140C: br x10

The indirect branch uses a byte-offset jump table based on the address main+0x621410. The crash target is exactly that base address, which is also an internal location within the function beginning at main+0x621310.

Potential issue: The recompiler may not be correctly accounting for all valid destinations of this jump table. In particular, if main+0x621410 is missing from the recovered target set, the generated indirect-branch switch can fall through to its default nx::call() handler. The runtime then attempts to resolve this internal address as an independent function and reports that it is in the middle of another function.

Relevant implementation:

recomp/analysis.py – jump-table analysis

prepare/recomp/analysis.cpp – native C++ analysis implementation

recomp/emit.py – indirect br and jump-table code generation

runtime/src/loader.cpp – call_slow() function lookup and fatal error

The existing November 5 jump-table overlap fix (8d0f374abb3d67f9f8469cf2b78d6433de9a9a72) is present in v0.11.0, so this may be a separate issue involving recovery of byte-offset jump-table destinations.

I also tested a completely fresh Linux x64 build with --no-60fps. The resulting library was installed and the crash persisted, so this does not appear to be resolved simply by disabling the 60 FPS variant.

Could you investigate whether the jump-table analysis is missing valid destinations for this ADR + LDRB + scaled ADD + BR sequence, and whether the generated switch is incorrectly routing the target through nx::call()?

kcijseries avatar Nov 22 '26 07:11 kcijseries

Just an update. I used Ryujinx and played through the HHP finale DJ KK Slider concert successfully, saved the game and brought it back to the Recomp. No problems so far from then on. This might be a workaround for those of you who have had the same issue.

kcijseries avatar Nov 23 '26 10:11 kcijseries

image

Just went back to the Island. Tonight was a DJ KK concert. Crashed as soon as I took off from my Island. Something in the Recomp does NOT like it when DJ KK plays.

kcijseries avatar Nov 24 '26 15:11 kcijseries

Can confirm this problem also happens with me. Seems DJ K.K. is not yet properly implemented in the Recomp.

91-cell avatar Nov 24 '26 22:11 91-cell

Ditto for me as well. I also noticed that it occurs regardless of time of day which means that just having the morning setup stuff with none of the effects playing still causes a crash.

I'm using Windows 11 at 30 FPS / No 60 fps speedfix active and no mods also for what it's worth I'll attach my log incase it might help.

nx_play.log

dragonloverlord avatar Nov 25 '26 18:11 dragonloverlord

0.12.0 has a fix for the likely cause, but it is not confirmed: we can't run the game to check. The recompiler could miss targets of the game's jump tables, and the instructions in this report match one of the cases it missed. In tests, 101 of 3,416 compiler-made tables had missing targets before, and none do now.

Please update, choose Prepare again (the old game code won't have the fix), then try a K.K. concert and the Happy Home Paradise finale. Let us know either way. If it still stops, please attach nx.log and prepare.log.

Nycolazs avatar Nov 30 '26 23:11 Nycolazs

60fps Balloon crash appears to be fixed! I'll let you know when I get to another DJ KK session.

kcijseries avatar Dec 01 '26 03:12 kcijseries