Opened 10 years ago

Closed 10 years ago

#2408 closed defect (fixed)

Crash in MSVC debug build when GUI page closes

Reported by: historic_bruno Owned by: Yves
Priority: Must Have Milestone: Alpha 16
Component: Core engine Keywords:
Cc: Yves, sanderd17 Patch:

Description

Consistently reproducible crash, according to Yves it is likely due to r14645, see IRC discussion here from 21:48.

First-chance exception at 0x5ad409e7 in pyrogenesis_dbg.exe: 0xC0000005: Access violation reading location 0xdddddead.

Call stack:

 	mozjs185-ps-debug-1.0.dll!5ad409e7() 	
 	[Frames below may be incorrect and/or missing, no symbols loaded for mozjs185-ps-debug-1.0.dll]	
 	mozjs185-ps-debug-1.0.dll!5ad35905() 	
 	mozjs185-ps-debug-1.0.dll!5ad34647() 	
 	mozjs185-ps-debug-1.0.dll!5ad33ac9() 	
 	mozjs185-ps-debug-1.0.dll!5ad2eeb5() 	
 	mozjs185-ps-debug-1.0.dll!5aca2793() 	
>	pyrogenesis_dbg.exe!Unrooter::operator()(unsigned __int64 * p=0x02d83c90)  Line 27 + 0x2a bytes	C++
 	pyrogenesis_dbg.exe!boost::detail::sp_counted_impl_pd<unsigned __int64 *,Unrooter>::dispose()  Line 154	C++
 	pyrogenesis_dbg.exe!boost::detail::sp_counted_base::release()  Line 103 + 0xf bytes	C++
 	pyrogenesis_dbg.exe!boost::detail::shared_count::~shared_count()  Line 375	C++
 	pyrogenesis_dbg.exe!boost::shared_ptr<unsigned __int64>::~shared_ptr<unsigned __int64>()  + 0x19 bytes	C++
 	pyrogenesis_dbg.exe!CScriptValRooted::~CScriptValRooted()  + 0x16 bytes	C++
 	pyrogenesis_dbg.exe!ScriptInterface::~ScriptInterface()  Line 595 + 0x2d bytes	C++
 	pyrogenesis_dbg.exe!ScriptInterface::`scalar deleting destructor'()  + 0x16 bytes	C++
 	pyrogenesis_dbg.exe!boost::checked_delete<ScriptInterface>(ScriptInterface * x=0x02d82530)  Line 34 + 0x1c bytes	C++
 	pyrogenesis_dbg.exe!boost::detail::sp_counted_impl_p<ScriptInterface>::dispose()  Line 78 + 0xc bytes	C++
 	pyrogenesis_dbg.exe!boost::detail::sp_counted_base::release()  Line 103 + 0xf bytes	C++
 	pyrogenesis_dbg.exe!boost::detail::shared_count::~shared_count()  Line 375	C++
 	pyrogenesis_dbg.exe!boost::shared_ptr<ScriptInterface>::~shared_ptr<ScriptInterface>()  + 0x19 bytes	C++
 	pyrogenesis_dbg.exe!CGUI::~CGUI()  Line 332 + 0xa8 bytes	C++
 	pyrogenesis_dbg.exe!CGUI::`scalar deleting destructor'()  + 0x16 bytes	C++
 	pyrogenesis_dbg.exe!boost::checked_delete<CGUI>(CGUI * x=0x02d96e38)  Line 34 + 0x1c bytes	C++
 	pyrogenesis_dbg.exe!boost::detail::sp_counted_impl_p<CGUI>::dispose()  Line 78 + 0xc bytes	C++
 	pyrogenesis_dbg.exe!boost::detail::sp_counted_base::release()  Line 103 + 0xf bytes	C++
 	pyrogenesis_dbg.exe!boost::detail::shared_count::~shared_count()  Line 375	C++
 	pyrogenesis_dbg.exe!boost::shared_ptr<CGUI>::~shared_ptr<CGUI>()  + 0x19 bytes	C++
 	pyrogenesis_dbg.exe!CGUIManager::HandleEvent(const SDL_Event_ * ev=0x011af2ac)  Line 337	C++
 	pyrogenesis_dbg.exe!gui_handler(const SDL_Event_ * ev=0x011af2ac)  Line 47 + 0xf bytes	C++
 	pyrogenesis_dbg.exe!in_dispatch_event(const SDL_Event_ * ev=0x011af2ac)  Line 62 + 0x12 bytes	C++
 	pyrogenesis_dbg.exe!PumpEvents()  Line 191 + 0x9 bytes	C++
 	pyrogenesis_dbg.exe!Frame()  Line 320	C++
 	pyrogenesis_dbg.exe!RunGameOrAtlas(int argc=1, const char * * argv=0x002781e8)  Line 472 + 0x5 bytes	C++
 	pyrogenesis_dbg.exe!main(int argc=1, char * * argv=0x002781e8)  Line 514 + 0xd bytes	C++
 	pyrogenesis_dbg.exe!wmain(int argc=1, wchar_t * * argv=0x00278988)  Line 380 + 0x14 bytes	C++
 	pyrogenesis_dbg.exe!__tmainCRTStartup()  Line 552 + 0x19 bytes	C
 	pyrogenesis_dbg.exe!wmainCRTStartup()  Line 371	C
 	pyrogenesis_dbg.exe!CallStartupWithinTryBlock()  Line 396 + 0x5 bytes	C++
 	pyrogenesis_dbg.exe!wseh_EntryPoint()  Line 424	C++
 	kernel32.dll!@BaseThreadInitThunk@12()  + 0x12 bytes	
 	ntdll.dll!___RtlUserThreadStart@8()  + 0x27 bytes	
 	ntdll.dll!__RtlUserThreadStart@8()  + 0x1b bytes	

Attachments (1)

scriptinterface_cache_crash_v1.0.diff (3.6 KB ) - added by Yves 10 years ago.

Download all attachments as: .zip

Change History (2)

comment:1 by Yves, 10 years ago

Owner: set to Yves
Resolution: fixed
Status: newclosed

In 14705:

Fixes a crash introduced in r14645 by ensuring that the CScriptValRooted values are destroyed before calling JS_DestroyContext.
I've tested the performance on Combat Demo (Huge) again with the code from #2394.
It's very close but probably a little bit lower (hard to tell because it's so close).

Closes #2408
Refs #2394

Note: See TracTickets for help on using tickets.