News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

Destructor crash on Simutrans quit...

Started by Max-Max, October 04, 2013, 02:40:53 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Max-Max

When I have played a map for a couple of hours and then exit Simutrans, I sometimes (maybe in 60%) end up in the dbghook. When tracing the call stack it is an assert( all_koords.empty() ); causing it in haltestelle_t::destroy_all(karte_t *welt) called from karte_t::destroy().

This is the call stack:


    msvcr110.dll!_crt_debugger_hook(int _Reserved) Line 60   C
    msvcr110.dll!_call_reportfault(int nDbgHookCode, unsigned long dwExceptionCode, unsigned long dwExceptionFlags) Line 152   C++
    msvcr110.dll!abort() Line 90   C
    msvcr110.dll!_wassert(const wchar_t * expr, const wchar_t * filename, unsigned int lineno) Line 141   C
>   Simutrans.exe!haltestelle_t::destroy_all(karte_t * welt) Line 314   C++
    Simutrans.exe!karte_t::destroy() Line 706   C++
    Simutrans.exe!karte_t::~karte_t() Line 2301   C++
    Simutrans.exe!karte_t::`scalar deleting destructor'(unsigned int)   C++
    Simutrans.exe!simu_main(int argc, char * * argv) Line 1264   C++
    Simutrans.exe!sysmain(int argc, char * * argv) Line 703   C++
    Simutrans.exe!WinMain(HINSTANCE__ * hInstance, HINSTANCE__ * __formal, char * __formal, int __formal) Line 725   C++
    Simutrans.exe!main() Line 691   C++
    Simutrans.exe!__tmainCRTStartup() Line 536   C
    kernel32.dll!@BaseThreadInitThunk@12()   Unknown
    ntdll.dll!___RtlUserThreadStart@8()   Unknown
    ntdll.dll!__RtlUserThreadStart@8()   Unknown


I think the chance increases the longer the game is played. If I let it run over the night it is almost 95% certain.
- My code doesn't have bugs. It develops random features...

Dwachs

#1
Imho, this assertion does not make sense, as the table in question is cleared anyway.

Also this hashtable is only (?) used when loading savegames. Thus at the beginning of the routing it can be cleared as well.

However, the failed assert points to some programming error ...

Edit: This hashtable is not changed when rotating ...
Parsley, sage, rosemary, and maggikraut.

Max-Max

So the assert can be ignored here, is that what you mean?
- My code doesn't have bugs. It develops random features...

Dwachs

Yes.

This hashtable is only used during loading. It is unneeded afterwards but still gets filled.
Parsley, sage, rosemary, and maggikraut.