At commit fb13bfe
Pok茅mon Moon (I don't have Sun to test, but I would assume that the same happens there) crashes at the end of the final battle, transitioning into a black screen, which should normally load into the hall of fame. Stubbing StoreDataCache does not fix the problem.
EDIT: All 6 of my Pok茅mon have nicknames.
Issue occurs when compiling Citra using both Mingw and MSVC.
End of Log: (that was a nice 50MB total log file...)
https://gist.github.com/j-selby/53f967f6d447c016645a2ea258b94b1c
Save File (You do have to go through a pretty long battle, as there is no place to save between this point and the crash): 00175e00.zip
EDIT (Updated): Wait Tree:

so I found 2 fixes for this issue I had it as well.
1.fight the elite 4 only with 3 pokemon (it would take some grinding tho)
2.i didn't test that but there is an option in PKHex that makes you the champion without fighting (use it at your own risk!!!!!)
Could you please try with #2393 and see if that fixes it?
@EnderTheFerret Those are not fixes. More of an override/bypass method to circumvent the issue.
@subv I just ran on this issue with my own save, so this PR did not fix it. I'm on 16a3f9e3.
Can someone please give me a walk-through on how to fix this problem(I am extremely new to programming and don't really know what I'm doing)?
@therabidpotatoe Learn how to program
Hmmm..... Can anyone tell me what exactly is the problem? Why the he*k is the main thread locking up?
just a heads up, the same issue exists in ultra sun/moon (spoilers ahead) after you fight hau in the league.
the workaround used in sun and moon is still working to bypass the issue in ultra sun and moon
This is an edited savegame of the one above with all pokemons in the party at LV 100 to make testing a bit faster:
main.zip
Can confirm still occurs on Pokemon Sun as well.
Tested on Canary 310 - 4a11be6
Fixed by #3440
Most helpful comment
@therabidpotatoe Learn how to program