Crash Triage & Hardware Debugging
The Triangulation Methodology: parsing physical PlayStation Vita .psp2dmp kernel core dumps, distinguishing PC vs LR frames, matching disassembly against Ghidra pseudo-C, and fixing ARMv7 hardware alignment traps.
🎯 The Triangulation Workflow¶
flowchart TD
Crash["💥 Hardware Crash"] --> Step1["1. Read Last Line of game.log"]
Step1 --> Step2["2. Fetch .psp2dmp via FTP"]
Step2 --> Step3["3. Parse Dump with vita-parse-core & loader.elf"]
Step3 --> Step4{"Where does PC (Program Counter) point?"}
Step4 -- "Inside .so memory space" --> FramePC["Relevant Frame = PC (Direct .so Crash)"]
Step4 -- "Inside SceLibKernel or Loader" --> FrameLR["Relevant Frame = LR (Corrupted argument passed to syscall)"]
FramePC & FrameLR --> Step5["4. Compute Offset inside .so"]
Step5 --> Step6["5. Locate Nearest Symbol with objdump / nm"]
Step6 --> Step7["6. Disassemble with objdump -M force-thumb"]
Step7 --> Step8["7. Match with Ghidra Pseudo-C"]
Step8 --> Fix["🔧 Exact Line Found -> Patch or Register Stub"]
📋 Step 1: Flushed Logs¶
Always call fflush(log_file) after every log write so that buffered text is committed to flash storage before a panic:
🔬 Step 2: Parsing .psp2dmp Core Dumps¶
Upon encountering a Data Abort, VitaOS generates a crash dump in ux0:data/ or ur0:temp/core/ named psp2core-XXXXXXXXXX-eboot.bin.psp2dmp.
Parse it with vita-parse-core against your debug loader.elf (the unstripped ELF with symbols):
Exception Type: Data abort (read access to 0x00000004)
Registers:
r0: 0x00000000 r1: 0x98124000 r2: 0x00000001 r3: 0x81005a20
r4: 0x810ff320 r5: 0x00000000 r6: 0x98200000 r7: 0x810ff3f8
r8: 0x00000000 r9: 0x81000000 r10: 0x00000000 r11: 0x810ff410
ip: 0x00000000 SP: 0x810ff400 LR: 0x98045a05 PC: 0x98045a1c
CPSR: 0x20000030 (Thumb Mode, User)
⚖️ Step 3: Deciding Between PC and LR¶
- If
PClies within.somemory (0x98000000+): The crash instruction was executed inside the game's native library. Investigate that offset. - If
PClies withinSceLibKernelor the loader (eboot.bin):LR(Link Register) is the caller! The game code invoked a system function (e.g.memcpyorfopen) with an invalid parameter (NULLpointer or corrupt size). Inspect the call-site inLR.
🔎 Step 4: Resolving the Offset & Matching Disassembly¶
Calculate: offset = PC - so_base_address (e.g. 0x98045a1c - 0x98000000 = 0x45a1c).
⚠️ ARMv7 Memory Alignment Traps¶
On x86 PCs, unaligned memory accesses are transparently handled by CPU microcode.
On the ARM Cortex-A9 CPU of the PS Vita, LDRD (Load Register Dual, 64-bit), STRD, and NEON vector instructions (VLD1) trigger an instant hardware Data Abort if the address is not aligned to 8 or 16 bytes.
[!TIP] Always check the last hexadecimal digit of the address in
r0or the base pointer whenldrdcrashes. If it ends in4,c, or odd digits, enforce struct packing or aligned allocation.