Opened 3 years ago

Closed 3 years ago

#5973 closed defect (fixed)

Segfault by spamming the minimap location

Reported by: Stan Owned by: Imarok
Priority: Must Have Milestone: Alpha 25
Component: Core engine Keywords:
Cc: Patch:

Description (last modified by Stan)

Reproductible in A23B and A24. When loading a game, if you spam the area where the minimap should be, if you do it enough you can get the game to crash as it triggers a reading access violation.

>	[Cadre en ligne] pyrogenesis.exe!CVector3D::{ctor}(float) Ligne 39	C++
 	pyrogenesis.exe!CMatrix3D::GetIn() Ligne 281	C++
 	[Cadre en ligne] pyrogenesis.exe!CMiniMap::GetAngle() Ligne 236	C++
 	pyrogenesis.exe!CMiniMap::GetMouseWorldCoordinates(float & x, float & z) Ligne 217	C++
 	pyrogenesis.exe!CMiniMap::FireWorldClickEvent(int button, int __formal) Ligne 247	C++
 	pyrogenesis.exe!CMiniMap::HandleMessage(SGUIMessage & Message) Ligne 149	C++
 	pyrogenesis.exe!IGUIObject::SendMouseEvent(EGUIMessageType type, const CStr8 & eventName) Ligne 403	C++
 	pyrogenesis.exe!CGUI::HandleEvent(const SDL_Event_ * ev) Ligne 181	C++
 	pyrogenesis.exe!CGUIManager::HandleEvent(const SDL_Event_ * ev) Ligne 311	C++
 	pyrogenesis.exe!gui_handler(const SDL_Event_ * ev) Ligne 53	C++
 	pyrogenesis.exe!in_dispatch_event(const SDL_Event_ * ev) Ligne 63	C++
 	pyrogenesis.exe!PumpEvents() Ligne 249	C++
 	pyrogenesis.exe!Frame() Ligne 394	C++
 	pyrogenesis.exe!RunGameOrAtlas(int argc, const char * * argv) Ligne 685	C++
 	pyrogenesis.exe!SDL_main(int argc, char * * argv) Ligne 736	C++
 	[Code externe]	
 	pyrogenesis.exe!CallStartupWithinTryBlock() Ligne 365	C++
 	[Code externe]	
 	kernel32.dll![Les frames ci-dessous sont peut-être incorrects et/ou manquants, aucun symbole chargé pour kernel32.dll]	Inconnu

Change History (4)

comment:1 by Stan, 3 years ago

Description: modified (diff)

comment:2 by Stan, 3 years ago

As explained by vladislav the problem occurs because the minimap receives a click while it's not yet initialized, dereferencing a nullptr (m_Camera). a potential fix would be to ignore the event if that variable isn't set.

comment:3 by Silier, 3 years ago

Priority: Should HaveMust Have

comment:4 by Imarok, 3 years ago

Owner: set to Imarok
Resolution: fixed
Status: newclosed

In 25710:

Don't store the camera pointer in the minimap

Reviewed by: vladislavbelov
Fix #5973

Differential Revision: https://code.wildfiregames.com/D4100

Note: See TracTickets for help on using tickets.