Citra core: save states always fail (unregistered class in boost::serialization)
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 14.1k
- Forks
- 2.2k
- Avg merge
- 7h 35m
- Merged PRs (30d)
- 51
Description
Save states in the Citra core (3DS) fail every time, both quick save and quick load. The core reports the option as supported and the menu shows Save State / Load State, but calling either one just fails silently or logs an error, nothing ever gets saved or restored.
Repro: load any 3DS game in the Citra core, try to save a state from the RetroArch quick menu. Log shows:
citra_libretro/citra_libretro.cpp:retro_serialize_size:793: Error saving savestate: unregistered class - derived class not registered or exported
I traced this into the core's own save state code, not the libretro wrapper. src/core/savestate.cpp, System::SaveStateBuffer(), serializes the whole System object with boost::serialization (oa & *this). The error is boost::serialization's own "unregistered class" exception, meaning some polymorphic class reachable from that object graph (most likely something in the renderer, given how much back and forth there's been between the OpenGL and Vulkan backends) was never registered for serialization with BOOST_CLASS_EXPORT.
retro_serialize_size() in citra_libretro.cpp catches the exception and returns 0, so from RetroArch's side it just looks like the core has no state to save, no crash, just nothing happens.
Checked the last several months of commits on both citra_libretro.cpp and savestate.cpp, nothing has touched this since. Couldn't find an existing report anywhere (issues are off on libretro/citra itself, and nothing turned up here either).
I don't have a fix, this would need someone to actually run it under a debugger to get the specific class name from the exception and find where its export registration is missing, but wanted to get it written down somewhere since right now it's not tracked at all.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure through the Citra core and start in src/core/savestate.cpp at System::SaveStateBuffer(), then trace the call from retro_serialize_size() in citra_libretro/citra_libretro.cpp. Use a debugger to identify the unregistered polymorphic class and locate its missing BOOST_CLASS_EXPORT registration. Done means quick save and quick load complete successfully without the unregistered-class error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100