Skip to content

Crash: SIGSEGV in RunAffineAnimFromTaskData (fault addr 0x161e558) #16

Closed

Description

@dbut2

Filed automatically by emerald's crash reporter.

commit unknown
platform darwin/arm64
go go1.26.1
args (none)
signal segmentation fault

What were you doing?

Replace this with what was happening in-game.

Crash log

AI WILD gAIScriptPtr=0x10252047100 logic=0 idx=0 -- recent opcodes:
  op=0x5e @ 0x102503940
  op=0x00 @ 0x102503949
AI WILD gAIScriptPtr=0x1025204c450 logic=0 idx=1 -- recent opcodes:
  op=0x5e @ 0x102503940
  op=0x00 @ 0x102503949
  op=0x5e @ 0x102503940
  op=0x00 @ 0x102503949
  op=0x00 @ 0x102503953
  op=0x00 @ 0x10250395d
  op=0x00 @ 0x102503967
  op=0x00 @ 0x102503971
  op=0x00 @ 0x10250397b
  op=0x00 @ 0x102503985
  op=0x00 @ 0x10250398f
  op=0x00 @ 0x102503999
  op=0x00 @ 0x1025039a3
  op=0x00 @ 0x1025039ad
  op=0x00 @ 0x1025039b7
  op=0x00 @ 0x1025039c1
  op=0x00 @ 0x1025039cb
  op=0x00 @ 0x1025039d5
  op=0x00 @ 0x1025039df

=== EMERALD C CRASH: SIGSEGV at fault addr 0x161e558 ===
0   emerald                             0x0000000100c1ebb0 RunAffineAnimFromTaskData + 68
1   emerald                             0x0000000100bcee34 pe_install_crash_handler + 424
2   libsystem_platform.dylib            0x000000018e1eb744 _sigtramp + 56
3   emerald                             0x0000000100c1eb90 RunAffineAnimFromTaskData + 36
4   emerald                             0x0000000100bfda94 AnimTask_DeepInhale + 472
5   emerald                             0x0000000100f2adc0 RunTasks + 80
6   emerald                             0x0000000100ca8c14 BattleMainCB2 + 28
7   emerald                             0x0000000100e1fac0 ClearPokemonCrySongs + 144
8   emerald                             0x0000000100e1f8a0 DoSoftReset + 256
9   emerald                             0x0000000100e1f3b4 AgbMain + 328
10  emerald                             0x0000000100bcd2b8 pe_init + 176
11  libsystem_pthread.dylib             0x000000018e1e1c58 _pthread_start + 136
12  libsystem_pthread.dylib             0x000000018e1dcc1c thread_start + 8

symbolize static frames with:
  atos -o /var/folders/hm/g88g9mfs1390g9vccx6r28kc0000gn/T/go-build3370761922/b001/exe/emerald -l 0x1004e4000 0x100c1ebb0 0x100bcee34 0x18e1eb744 0x100c1eb90 0x100bfda94 0x100f2adc0 0x100ca8c14 0x100e1fac0 0x100e1f8a0 0x100e1f3b4 0x100bcd2b8 0x18e1e1c58 0x18e1dcc1c

Full log on the reporter's machine: /var/folders/hm/g88g9mfs1390g9vccx6r28kc0000gn/T/emerald-crash-84543.log

Activity

  1. added
    crashAutomated crash report; triggers Crash Autofix
    on Jul 9, 2026
  2. dylan-botler commented on Jul 9, 2026

    @dylan-botler

    Investigated. Root cause is a 64-bit pointer truncation in the affine battle-anim path: PrepareAffineAnimInTaskData packs the const union AffineAnimCmd * into two s16 task slots (StorePointerInVars), and RunAffineAnimFromTaskData reloads only 32 bits (LoadPointerFromVars) before dereferencing — the fault addr 0x161e558 is the surviving low 32 bits of an affine-cmds table that lives above 4 GB on the LP64 host. Fixed by keeping the pointer full-width in a side table keyed by task index (same pattern as StoreSpriteCallbackInData6 in this file).

    PR: #17 (not runtime-verified — the native core doesn't build in CI here).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    crashAutomated crash report; triggers Crash Autofix

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions