don't click here

Jet Set Radio: Fixing random crashes

Discussion in 'Engineering & Reverse Engineering' started by mogo, Aug 23, 2016.

  1. mogo

    mogo

    Member
    1
    0
    0
    So this is the main problem in JSR speedrunning that I'm trying to fix (https://www.youtube.com/watch?v=ZXLqSevcvmw&t=6m33s) This is from Maxy's SGDQ run a month or two back. This matters cause its 6 minutes into the speedrun after one of the hardest levels to optimize which kills a lot of top speedrunners' motivation with the game. I have some pretty good luck with crashing but I have seen the WR holder crash at this exact spot like 6 times in a row

    So here are the steps to reproduce:
    - Go to any transition in a level where things unload
    -- Most common crash areas are Shibuya GG ending, Love Trap ending, and then Grind square ending but there have been crashes on cutscenes, level transitions in ch.3

    Should) Despawn the things that need to be despawned. Usually the character models, npcs, cars etc.

    Crash) Stops everything, throws a "Jet set is not responding" and gives an error like:

    "First chance exception on 6A5A95A7 (C0000005, EXCEPTION_ACCESS_VIOLATION)" or "HEAP[jsetsetradio.exe]: "
    DebugString: "HEAP: Free Heap block 11F88E58 modified at 11F8F6B0 after it was freed\n"
    First chance exception on 77A6EEAA (80000003, EXCEPTION_BREAKPOINT)!
    DebugString: "Critical error detected c0000374\n"
    First chance exception on 77A6C78C (80000003, EXCEPTION_BREAKPOINT)".

    Here is a pastebin of the debugging info of a crash: "http://pastebin.com/gQfYvWpc". Basically, when a level is completed there is a frame where things are despawned which is followed by the "cleared" screen a frame after.

    System Info:
    All runners have experienced this joy and everyone runs on the PC steam port. Different hardware can effect the crash rate but its mostly random with high end CPUs or GPUs still crashing at the same rate. Contradictorily, the crash rate increases when the computer has a higher load like when you are streaming. When I want to reproduce crashes, what I do is record it on OBS and have like 10 tabs open in Google chrome and grind shibuya GG just using the retry button till I crash. It also crashes like 90% of the time on the Grind square Jet Graffiti level if you want to see it crash very easily (requires a new game + file).

    Hack:
    The quick fix for crashes that aren't Shibuya GG ending or Love Trap ending is to use a debugger and have it skip the line and continue on. Here is the first time I found it: "https://www.twitch.tv/redmogo/v/76288208". Love Trap crashes can be handled using this method but its seems random whether it can or not at maybe 1% success rate when there is a crash. No one has gotten past a Shibuya GG crash with a debugger. I'm using x64dbg since it was the easiest to use though I can use IDA free version thing.

    Basically all of this is very confusing and contradictory at times so I figured I needed help. I was going through some previous work done here: "https://forums.sonicretro.org/index.php?showtopic=34514". I'm still new with decompiling the code and so I don't exactly know what to do next. I'm pretty sure its a memory problem which makes it much harder to see what is going on. Any ideas or suggestions would be welcomed.