RetroAchievements / RAIntegration

The DLL responsible to integrate emulators with RetroAchievements.org
https://retroachievements.org
MIT License
97 stars 23 forks source link

Emulator crashes when loading a game on RAI master #527

Closed rzumer closed 4 years ago

rzumer commented 4 years ago

While testing RASCV, during RA_OnLoadNewRom(), I hit the following error. Rebasing to the last release (tag) fixes it.

Output:

Successfully looked up game with ID 14129
Loading game 14129
FetchGameData Request: u=Euclide&r=patch&g=14129
'scv.exe' (Win32): Loaded 'C:\Windows\SysWOW64\OnDemandConnRouteHelper.dll'. Cannot find or open the PDB file.
'scv.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\OnDemandConnRouteHelper.dll'
-- FetchGameData Response: {"Success":true,"PatchData":{"ID":14129,"Title":"Astro Wars - Invader From Space","ConsoleID":55,"ForumTopicID":0,"Flags":0,"ImageIcon":"\/Images\/000001.png","ImageTitle":"\/Images\/031658.png","ImageIngame":"\/Images\/031659.png","ImageBoxArt":"\/Images\/000002.png","Publisher":null,"Developer":null,"Genre":null,"Released":null,"IsFinal":false,"ConsoleName":"Super Cassette Vision","RichPresencePatch":"Display:\r\nShooting some invaders from space","Achievements":[],"Leaderboards":[]}}
FetchCodeNotes Request: u=Euclide&r=codenotes2&g=14129
'scv.exe' (Win32): Loaded 'C:\Windows\SysWOW64\OnDemandConnRouteHelper.dll'. Cannot find or open the PDB file.
'scv.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\OnDemandConnRouteHelper.dll'
Starting new session for game 14129
FetchUserUnlocks Request: u=Euclide&r=unlocks&g=14129&h=0
StartSession Request: u=Euclide&r=postactivity&a=3&m=14129
Exception thrown: read access violation.
**std::_Tree_comp_alloc<std::_Tmap_traits<int,int,std::less<int>,std::allocator<std::pair<int const ,int> >,0> >::_Get_data**(...) returned 0x10.

Call stack:

>   RA_Integration.dll!std::_Tree<std::_Tmap_traits<int,int,std::less<int>,std::allocator<std::pair<int const ,int> >,0> >::_Lbound<int>(const int & _Keyval) Line 2045 C++
    RA_Integration.dll!std::_Tree<std::_Tmap_traits<int,int,std::less<int>,std::allocator<std::pair<int const ,int> >,0> >::lower_bound(const int & _Keyval) Line 1486  C++
    RA_Integration.dll!std::_Tree<std::_Tmap_traits<int,int,std::less<int>,std::allocator<std::pair<int const ,int> >,0> >::find(const int & _Keyval) Line 1433 C++
    RA_Integration.dll!ra::ui::ViewModelBase::GetValue(const ra::ui::ModelProperty<int> & pProperty) Line 88    C++
    RA_Integration.dll!ra::ui::viewmodels::MemoryViewerViewModel::GetSize() Line 130    C++
    RA_Integration.dll!Dlg_Memory::UpdateBits() Line 1102   C++
    RA_Integration.dll!Dlg_Memory::OnWatchingMemChange() Line 927   C++
    RA_Integration.dll!Dlg_Memory::SetWatchingAddress(unsigned int nAddr) Line 1132 C++
    RA_Integration.dll!Dlg_Memory::OnLoad_NewRom() Line 971 C++
    RA_Integration.dll!ra::services::GameIdentifier::ActivateGame(unsigned int nGameId) Line 208    C++
    RA_Integration.dll!ra::services::GameIdentifier::IdentifyAndActivateGame(const unsigned char * pROM, unsigned int nROMSize) Line 218    C++
    RA_Integration.dll!_RA_OnLoadNewRom(const unsigned char * pROM, unsigned int nROMSize) Line 213 C++
    scv.exe!RA_OnLoadNewRom(unsigned char * pROMData, unsigned int nROMSize) Line 124   C++
Jamiras commented 4 years ago

I believe this was a temporary issue caused by an incomplete conversion of the Memory Inspector dialog. The stack trace shows both Dlg_Memory (old code) and MemoryViewerViewMode (new code). Now that the dialog has been fully converted, I can't reproduce the issue. I've tried loading several games both with and without the dialog open. So this has either been fixed, or is somehow related to the SCV emulator that no longer exists.