News:

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

*Confusion* generic access violation?

Started by jamespetts, April 22, 2012, 03:41:38 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jamespetts

I have encountered a really quite bizarre problem that I cannot understand when trying to fix a problem on the -devel branch of Experimental. The bug (reported here) where a new game will crash a year and a month after being created occurs in karte_t::neuer_monat(), during the city iteration loop. It occurs particularly in the line:


s->neuer_monat(recheck_road_connexions);


Normally, with an access violation, I get an error that tells me whether the access violation is trying to read or write something, and what the address is that it is trying to read or write. I can then see in the debugger which variables have that address and track from there how the access violation occurs.

Here, the access violation message is generic. It reads:


Unhandled exception at 0x0a1dedd0 in Simutrans-Experimental-Debug.exe
0xC0000005: Access violation.


The problem is not that the pointer "s" to the city is corrupted, as an earlier line that I inserted for testing purposes:


const char* TEST_name = s->get_name();


runs without a problem, and gives the correct name of the town (it is the same name every time). Furthermore, "s" has a different address to either of the addresses shown in the error message: in the latest test that I have run, it has the address of 0x0a0d8958. The pointer to stadt_t::neuer_monat() is 0x005d3080, and the address of recheck_road_connexions is 0x09aca0fc.

The stack frame menu shows that karte_t::neuer_monat() is the the most recent but one frame. The most recent frame is shown as being 0x0a1dedd, which has no associated source code. It is almost as if, for some unknown reason, at this deterministic point in the program, it will try to access the stadt_t::neuer_monat() method by using the wrong pointer (to 0x0a1dedd0 instead of to 0x005d3080, in this run, in any case). I have no idea why it might do that, or how to try to fix it.

I did try manually to incorporate the latest changes/optimisations from Standard into the city iteration code in karte_t::neuer_monat(), but the problem was identical before and after this change. I also tried to use the ITERATE macro (just a macro creating a for loop and accessing elements in the vector by index, skipping repeated entries in the weighted vector), again with identical results. I noticed, however, that the "i" (iterator index) was always at 3 rather than 0 when the error occurred, meaning that this does not happen to the first city to be iterated in the problem month (it might have been the second, however, given the weighted vector repeat skipping code).

The only other clue (and bizarre thing) about this problem is that sometimes, instead of an access violation error, it will give a "privileged instruction" error, which I find even more inexplicable in the circumstances (I had to look up what that error meant, and it's hard to see how ordinary user space code could create it without major memory corruption - but, if it is memory corruption, I don't understand why the results are so exactly deterministic every time, causing an error to occur exactly a year and a month after game creation on completely different newly created games).

Any thoughts on this issue from anyone more experienced than I in programming would be most welcome!
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

prissi

I have these error often during development in MSVC. It just means that a pointer outside the reference frame is used for reading or writing. The line, where the cursor in the debugger is, has mostly no connection to the error.

But for more detailed analysis, either look at the code or run valgrind on a linux machine. This will find any stray pointer when it occurs.

jamespetts

Ahh, thank you for the reply - that is helpful. I only seldom have access to a Linux machine (apart from the server, which I administer remotely), however, and Valgrind is not compatible with Windows. What might a Windows user do to try to find this issue?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

prissi

Honestly, I do not know. Using Linux in a virtual machine is what I do ...

Ters

Since you get a privileged instruction error, it sounds like it's the instruction pointer that has gone wild. I can only think of three ways to achieve that: virtual method call on a corrupted pointer, corrupted function pointer, and stack corruption.

Markohs

those errors are hard to track, you prolly corrupted the heap. the line that you get the error polly doesn't has nothing to do with it, comes mostly from the one that manipulated memory before.

prissi

Well, valgrind does, it tracks the pointer and find about writing to them too (at least most of the times).

Markohs

I tried this one on windows and it was not bad, but was too verbose, but you can check it out:

http://code.google.com/p/drmemory/

But installing virtualbox with linux and trying there as prissi suggests can be a good idea too.

jamespetts

Thank you very much for that - that is helpful. I shall look into trying Dr. Memory, or Valgrind on a virtual Linux machine if that fails. Does it seem odd to anyone that heap corruption occurs at exactly a year and a month after game creation, and at exactly the same point in the code, reliably?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Markohs

I had a bug in CEGUI related to how did I set up OpenGL and buffers and I allways got the segmentation fault later, when CEGUI used expat to parse the XML file, totally unrelated, and it allways crashed that way. It was hard to debug! I guess at that moment you menction some code kicks in that manages memory, failing as a consequence of a prevous memory corruption.

jamespetts

Thank you for the suggestion re: Dr. Memory. I ran a brief test with it. The brief summary is:


ERRORS FOUND:
      0 unique,     0 total unaddressable access(es)
   5774 unique, 4725910 total uninitialized access(es)
    282 unique, 45945 total invalid heap argument(s)
      0 unique,     0 total warning(s)
     44 unique,  9968 total,  23252 byte(s) of leak(s)
      9 unique,    17 total,   8672 byte(s) of possible leak(s)
ERRORS IGNORED:
  163617 still-reachable allocation(s)
         (re-run with "-show_reachable" for details)
  52308 leak(s) beyond -report_leak_max


However, it was not immediately clear whether the detailed results were useful. Most were of the type:


WARNING: application is missing line number information.

Error #1: UNINITIALIZED READ: reading register ecx
# 0 ntdll.dll!RtlAllocateHeap                +0x2c     (0x7785e072 <ntdll.dll+0x2e072>)
# 1 MSVCR100.dll!malloc                      +0x35     (0x53890269 <MSVCR100.dll+0x10269>)
# 2 MSVCR100.dll!operator new                +0xf      (0x538902d1 <MSVCR100.dll+0x102d1>)
# 3 Simutrans-Experimental.exe!?             +0x0      (0x005dc0da <Simutrans-Experimental.exe+0x1dc0da>)
# 4 Simutrans-Experimental.exe!?             +0x0      (0x00438d18 <Simutrans-Experimental.exe+0x38d18>)
# 5 KERNEL32.dll!BaseThreadInitThunk         +0x11     (0x752d339a <KERNEL32.dll+0x1339a>)
# 6 ntdll.dll!RtlInitializeExceptionChain    +0x62     (0x77869ef2 <ntdll.dll+0x39ef2>)
# 7 ntdll.dll!RtlInitializeExceptionChain    +0x35     (0x77869ec5 <ntdll.dll+0x39ec5>)
Note: @0:00:00.732 in thread 2188
Note: instruction: cmp    %ecx %esi


The warning about the application missing line number information suggests that I should be using a debug build, yet, when I do, Dr. Memory gives me an error message telling me that I need to use a release build. There is obviously a pattern of settings that will give Dr. Memory the debugging information that it needs whilst not giving it things that make it choke - does anyone have any idea what it is?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ters

That depends on which compiler you use.

jamespetts

Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

prissi

As the documentation says, you must use GCC.4.4 or higher, with the flag -ggdb

Markohs

I think there is a way of making a debug version compatible with msvc 2010, but I didn't find how still, I'll make some tests.

Markohs

Found it, switch to debug mode and:

Properties->C/C++->Runtime Library: Multi-threaded Debug (MTd)

Rebuild and go.

Worked for me.

Sample:


Error #1077: UNINITIALIZED READ: reading register eflags
# 0 grund_t::display_dinge_all                    [c:\code\simutrans\trunk\boden\grund.cc:1145]
# 1 planquadrat_t::display_dinge                  [c:\code\simutrans\trunk\simplan.cc:424]
# 2 karte_ansicht_t::display_region               [c:\code\simutrans\trunk\simview.cc:497]
# 3 karte_ansicht_t::display                      [c:\code\simutrans\trunk\simview.cc:220]
# 4 intr_refresh_display                          [c:\code\simutrans\trunk\simintr.cc:74]
# 5 karte_t::sync_step                            [c:\code\simutrans\trunk\simworld.cc:2990]
# 6 interrupt_check                               [c:\code\simutrans\trunk\simintr.cc:102]
# 7 karte_t::neuer_monat                          [c:\code\simutrans\trunk\simworld.cc:3185]
# 8 karte_t::step_month                           [c:\code\simutrans\trunk\simworld.cc:5284]
# 9 simu_main                                     [c:\code\simutrans\trunk\simmain.cc:986]
#10 sysmain                                       [c:\code\simutrans\trunk\simsys.cc:622]
#11 WinMain                                       [c:\code\simutrans\trunk\simsys_opengl.cc:1169]
Note: @0:01:23.187 in thread 776
Note: instruction: jz     $0x00636994

jamespetts

#16
Excellent, that worked - thank you very much.

The question is now what to do with these results - all of the errors seem to be "uninitialised read" errors such as these:


Error #8: UNINITIALIZED READ: reading register ecx
# 0 button_t::set_text                                                         [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\components\gui_button.cc:344]
# 1 gui_file_table_delete_column_t::gui_file_table_delete_column_t             [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\savegame_frame.h:70]
# 2 pakselector_t::pakselector_t                                               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\pakselector.cc:99]
# 3 ask_objfilename                                                            [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simmain.cc:288]
# 4 simu_main                                                                  [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simmain.cc:743]
# 5 sysmain                                                                    [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simsys.cc:109]
# 6 WinMain                                                                    [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simsys_w.cc:703]
Note: @0:00:04.285 in thread 6132
Note: instruction: test   %ecx %ecx


Many of them appear in areas of the code untouched by Experimental. Performance is so poor when running with Dr. Memory that it takes literally minutes to respond to basic commands, so actually reproducing the bug with Dr. Memory running is impossible. I'm currently unsure how to interpret these results usefully.

Edit:

Aha, I found the "light" option, which is most useful, making the whole thing run much faster and removing the uninitalised read errors. I am now able to run it with Dr. Memory until the actual error occurs, and get the following results:


Dr. Memory version 1.4.6 build 2 built on Mar  7 2012 10:14:04
Application cmdline: ""C:\Users\James\Documents\Development\Simutrans\simutrans-experimental-sources\simutrans\Simutrans-Experimental-debug.exe""
Recorded 62 suppression(s) from default C:\Program Files (x86)\Dr. Memory/bin/suppress-default.txt

Error #1: INVALID HEAP ARGUMENT: allocated with malloc, freed with operator delete[]
# 0 list_tpl<gui_table_column_t>::set_capacity                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\tpl\list_tpl.h:454]
# 1 list_tpl<gui_table_column_t>::set_count                   [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\tpl\list_tpl.h:470]
# 2 gui_table_t::change_size                                  [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\components\gui_table.cc:57]
# 3 gui_table_t::set_size                                     [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\components\gui_table.h:224]
# 4 gui_table_t::~gui_table_t                                 [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\components\gui_table.cc:34]
# 5 gui_file_table_t::~gui_file_table_t
# 6 savegame_frame_t::~savegame_frame_t                       [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\savegame_frame.cc:237]
# 7 pakselector_t::~pakselector_t   
# 8 pakselector_t::`scalar deleting destructor'
# 9 destroy_framed_win                                        [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simwin.cc:683]
#10 process_kill_list                                         [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simwin.cc:641]
#11 check_pos_win                                             [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simwin.cc:1338]
Note: @0:00:05.013 in thread 720
Note: memory was allocated here:
Note: # 0 <not in a module>                          (0x1bcb0048)
Note: # 1 xrealloc                                                 [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simmem.cc:209]
Note: # 2 list_tpl<gui_table_column_t>::set_capacity               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\tpl\list_tpl.h:459]
Note: # 3 list_tpl<gui_table_column_t>::grow                       [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\tpl\list_tpl.h:47]
Note: # 4 list_tpl<gui_table_column_t>::append                     [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\tpl\list_tpl.h:252]
Note: # 5 list_tpl<gui_table_column_t>::add                        [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\tpl\list_tpl.h:242]
Note: # 6 gui_table_t::add_column                                  [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\components\gui_table.cc:40]
Note: # 7 pakselector_t::init                                      [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\pakselector.cc:16]
Note: # 8 pakselector_t::pakselector_t                             [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\pakselector.cc:101]
Note: # 9 ask_objfilename                                          [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simmain.cc:288]
Note: #10 simu_main                                                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simmain.cc:743]
Note: #11 sysmain                                                  [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simsys.cc:109]

Error #2: INVALID HEAP ARGUMENT: allocated with operator new, freed with RtlFreeHeap
# 0 KERNEL32.dll!HeapFree                         +0x13     (0x76e014dd <KERNEL32.dll+0x114dd>)
# 1 _free_base                                     [f:\dd\vctools\crt_bld\self_x86\crt\src\free.c:50]
# 2 _HeapManager::Destructor                       [f:\dd\vctools\langapi\undname\undname.cxx:120]
# 3 __unDName                                      [f:\dd\vctools\langapi\undname\undname.cxx:673]
# 4 type_info::_Name_base                          [f:\dd\vctools\crt_bld\self_x86\crt\prebuild\eh\typname.cpp:124]
# 5 type_info::name                                [f:\dd\vctools\crt_bld\self_x86\crt\prebuild\eh\typinfo.cpp:45]
# 6 list_tpl<gui_table_row_t>::qsort               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\tpl\list_tpl.h:382]
# 7 list_tpl<gui_table_row_t>::sort                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\tpl\list_tpl.h:483]
# 8 gui_table_t::sort_rows                         [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\components\gui_table.cc:270]
# 9 savegame_frame_t::fill_list                    [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\savegame_frame.cc:184]
#10 savegame_frame_t::infowin_event                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\savegame_frame.cc:534]
#11 create_win                                     [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simwin.cc:587]
Note: @0:00:22.568 in thread 720
Note: memory was allocated here:
Note: # 0 _heap_alloc_base                              [f:\dd\vctools\crt_bld\self_x86\crt\src\malloc.c:55]
Note: # 1 _malloc_base                                  [f:\dd\vctools\crt_bld\self_x86\crt\src\malloc.c:89]
Note: # 2 _HeapManager::getMemory                       [f:\dd\vctools\langapi\undname\undname.inl:146]
Note: # 3 operator new                                  [f:\dd\vctools\langapi\undname\undname.inl:137]
Note: # 4 _HeapManager::getMemory                       [f:\dd\vctools\langapi\undname\undname.inl:165]
Note: # 5 operator new                                  [f:\dd\vctools\langapi\undname\undname.inl:137]
Note: # 6 DName::doPchar                                [f:\dd\vctools\langapi\undname\undname.inl:945]
Note: # 7 DName::operator=                              [f:\dd\vctools\langapi\undname\undname.inl:823]
Note: # 8 UnDecorator::getECSUDataType                  [f:\dd\vctools\langapi\undname\undname.cxx:3531]
Note: # 9 UnDecorator::getBasicDataType                 [f:\dd\vctools\langapi\undname\undname.cxx:3404]
Note: #10 UnDecorator::getPrimaryDataType               [f:\dd\vctools\langapi\undname\undname.cxx:3130]
Note: #11 UnDecorator::getDataType                      [f:\dd\vctools\langapi\undname\undname.cxx:3012]

Error #3: INVALID HEAP ARGUMENT: allocated with operator new, freed with RtlFreeHeap
# 0 KERNEL32.dll!HeapFree                         +0x13     (0x76e014dd <KERNEL32.dll+0x114dd>)
# 1 _free_base                                     [f:\dd\vctools\crt_bld\self_x86\crt\src\free.c:50]
# 2 type_info::_Name_base                          [f:\dd\vctools\crt_bld\self_x86\crt\prebuild\eh\typname.cpp:180]
# 3 type_info::name                                [f:\dd\vctools\crt_bld\self_x86\crt\prebuild\eh\typinfo.cpp:45]
# 4 list_tpl<gui_table_row_t>::qsort               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\tpl\list_tpl.h:382]
# 5 list_tpl<gui_table_row_t>::sort                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\tpl\list_tpl.h:483]
# 6 gui_table_t::sort_rows                         [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\components\gui_table.cc:270]
# 7 savegame_frame_t::fill_list                    [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\savegame_frame.cc:184]
# 8 savegame_frame_t::infowin_event                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\savegame_frame.cc:534]
# 9 create_win                                     [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simwin.cc:587]
#10 create_win                                     [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simwin.cc:517]
#11 banner_t::action_triggered                     [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\banner.cc:76]
Note: @0:00:22.571 in thread 720
Note: memory was allocated here:
Note: # 0 _heap_alloc_base                               [f:\dd\vctools\crt_bld\self_x86\crt\src\malloc.c:55]
Note: # 1 _malloc_base                                   [f:\dd\vctools\crt_bld\self_x86\crt\src\malloc.c:89]
Note: # 2 _HeapManager::getMemory                        [f:\dd\vctools\langapi\undname\undname.inl:146]
Note: # 3 operator new                                   [f:\dd\vctools\langapi\undname\undname.inl:137]
Note: # 4 UnDecorator::operator char *                   [f:\dd\vctools\langapi\undname\undname.cxx:855]
Note: # 5 __unDName                                      [f:\dd\vctools\langapi\undname\undname.cxx:668]
Note: # 6 type_info::_Name_base                          [f:\dd\vctools\crt_bld\self_x86\crt\prebuild\eh\typname.cpp:124]
Note: # 7 type_info::name                                [f:\dd\vctools\crt_bld\self_x86\crt\prebuild\eh\typinfo.cpp:45]
Note: # 8 list_tpl<gui_table_row_t>::qsort               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\tpl\list_tpl.h:382]
Note: # 9 list_tpl<gui_table_row_t>::sort                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\tpl\list_tpl.h:483]
Note: #10 gui_table_t::sort_rows                         [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\components\gui_table.cc:270]
Note: #11 savegame_frame_t::fill_list                    [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\savegame_frame.cc:184]

Error #4: INVALID HEAP ARGUMENT: allocated with malloc, freed with operator delete[]
# 0 list_tpl<gui_table_column_t>::set_capacity                   [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\tpl\list_tpl.h:454]
# 1 list_tpl<gui_table_column_t>::set_count                      [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\tpl\list_tpl.h:470]
# 2 gui_table_t::change_size                                     [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\components\gui_table.cc:57]
# 3 gui_table_t::set_size                                        [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\components\gui_table.h:224]
# 4 gui_table_t::~gui_table_t                                    [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\components\gui_table.cc:34]
# 5 gui_file_table_t::~gui_file_table_t
# 6 savegame_frame_t::~savegame_frame_t                          [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\savegame_frame.cc:237]
# 7 loadsave_frame_t::~loadsave_frame_t                          [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\loadsave_frame.cc:379]
# 8 loadsave_frame_t::`scalar deleting destructor'
# 9 destroy_framed_win                                           [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simwin.cc:683]
#10 process_kill_list                                            [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simwin.cc:641]
#11 check_pos_win                                                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simwin.cc:1338]
Note: @0:00:30.667 in thread 720
Note: memory was allocated here:
Note: # 0 <not in a module>                          (0x1bcb0048)
Note: # 1 xrealloc                                                 [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simmem.cc:209]
Note: # 2 list_tpl<gui_table_column_t>::set_capacity               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\tpl\list_tpl.h:459]
Note: # 3 list_tpl<gui_table_column_t>::grow                       [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\tpl\list_tpl.h:47]
Note: # 4 list_tpl<gui_table_column_t>::append                     [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\tpl\list_tpl.h:252]
Note: # 5 list_tpl<gui_table_column_t>::add                        [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\tpl\list_tpl.h:242]
Note: # 6 gui_table_t::add_column                                  [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\components\gui_table.cc:40]
Note: # 7 loadsave_frame_t::init                                   [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\loadsave_frame.cc:154]
Note: # 8 loadsave_frame_t::loadsave_frame_t                       [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\loadsave_frame.cc:98]
Note: # 9 banner_t::action_triggered                               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\banner.cc:76]
Note: #10 gui_action_creator_t::call_listeners                     [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\components\gui_action_creator.h:36]
Note: #11 button_t::infowin_event                                  [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\components\gui_button.cc:439]

Error #5: UNADDRESSABLE ACCESS: writing 0xffffffff-0x00000000 1 byte(s) within 0xffffffff-0x00000003
# 0 <not in a module>    (0x0c7f4ada)
# 1 karte_t::neuer_monat               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simworld.cc:3299]
# 2 karte_t::step                      [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simworld.cc:3659]
# 3 karte_t::interactive               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simworld.cc:6475]
# 4 simu_main                          [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simmain.cc:1158]
# 5 sysmain                            [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simsys.cc:109]
# 6 WinMain                            [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simsys_w.cc:703]
Note: @0:10:43.947 in thread 720
Note: instruction: stos   %eax %edi -> %es:(%edi) %edi


I should be interested in views on interpreting this.

Edit 2:

Hmm - looking at that briefly, all the errors bar the last seem to be generated by the GUI (and probably irrelevant), and the last tells me no more than the debugger.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Dwachs

I found that simutrans running under valgrind is much more responsive when started as server. Maybe this help for the  DrMem tool.
Parsley, sage, rosemary, and maggikraut.

jamespetts

Dwachs,

thank you for the tip. As noted above, however, I managed to make Dr. Memory responsive by using "light" mode, which does not check for uninitialised reads (which in any event, according to the documentation, generate many false positives under Windows 7 64-bit).
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

isidoro

Well, Dr.Memory speaks like an opened book... Take the first error.  It says:
QuoteYou cannot use delete[] to free some memory if you used malloc to reserve it (you should use free instead).  He (Dr.Memory) even tells you where you reserved the memory and where you are trying to free it.
When freeing, in line 1338 of simwin.cc check_pos_win called process_kill_list, which in line 641 of simwin.cc called destroy_framed_win, ..., some destructors called, until in line 454 of list_tpl.h in method list_tpl<gui_table_column_t>::set_capacity, the actual memory is freed.

And the same goes for Dr.Memory report about where the memory was allocated....

The error most probably happens when you close a window.

I'm amazed about how you can deal with the whole branch of Experimental with so little knowledge about basic programming.  It must be a very titanic work indeed.  I would only wish I had half the willpower you certainly have, James...


jamespetts

Isidoro,

thank you for the explanation - it wasn't so much that I hadn't worked out the malloc/delete[] thing, but that those appeaerd to be errors with the GUI, which code has not changed between 10.11 and -devel and which is also inconsistent with the error being entirely determinate as to when it arises, so I assumed that the error was not relevant to this particular bug (and had not also caused other crashes, since no crashes that relate to this appear ot have been reported).
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

prissi

Depending on the implementation, free will happily put the block to some list using invisible information before or after the block. This heap may however be using different list (or even a different format) than malloc. On some architekture you will no notice an error, other might crash even when calling free.

For MSVC in my (limited) experience those crashes of wrong memory occur way after the free the next time memory is actually allocated/freed.

Even translating experimental with GCC give some serious warnings, and also stuff like assigned variable never used and so on. Use those hint to remove that code. Any program will have real bugs, even if all the formal stuff is fixed. But then those are easier to find.

About the list template: It should also get a copy constructor like all other templates. Missing constructor could also cause all kind of strange stuff. (As a side issue: why not using the vector template? Those actually have an inserted_sorted function. I would also recommend standard sort algorithms from libraries ... )

Markohs

Just commenting about the warnings, even some of them are harmless, I tend to consider warnings as errors most of the times, because they allways show you missed something when you wrote the code. Warnings are errors, and should be corrected.

(Even I know the CEGUI/Simu3D shows some warnings about default type conversions, I want to remove them when I got a moment to do it :) )

jamespetts

Hmm - the difficulty with debugging this GUI code is that I didn't write it, so it is not always easy to work out what is intended. I think that I have dealt with some of the issues now by deleting with "free(data)" instead of "delete [] data", but two errors still remain as follows:


Dr. Memory version 1.4.6 build 2 built on Mar  7 2012 10:14:04
Application cmdline: ""C:\Users\James\Documents\Development\Simutrans\simutrans-experimental-sources\simutrans\Simutrans-Experimental-debug.exe""
Recorded 62 suppression(s) from default C:\Program Files (x86)\Dr. Memory/bin/suppress-default.txt

Error #1: INVALID HEAP ARGUMENT: allocated with operator new, freed with RtlFreeHeap
# 0 KERNEL32.dll!HeapFree                         +0x13     (0x76b314dd <KERNEL32.dll+0x114dd>)
# 1 _free_base                                     [f:\dd\vctools\crt_bld\self_x86\crt\src\free.c:50]
# 2 _HeapManager::Destructor                       [f:\dd\vctools\langapi\undname\undname.cxx:120]
# 3 __unDName                                      [f:\dd\vctools\langapi\undname\undname.cxx:673]
# 4 type_info::_Name_base                          [f:\dd\vctools\crt_bld\self_x86\crt\prebuild\eh\typname.cpp:124]
# 5 type_info::name                                [f:\dd\vctools\crt_bld\self_x86\crt\prebuild\eh\typinfo.cpp:45]
# 6 list_tpl<gui_table_row_t>::qsort               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\tpl\list_tpl.h:382]
# 7 list_tpl<gui_table_row_t>::sort                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\tpl\list_tpl.h:484]
# 8 gui_table_t::sort_rows                         [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\components\gui_table.cc:270]
# 9 savegame_frame_t::fill_list                    [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\savegame_frame.cc:184]
#10 savegame_frame_t::infowin_event                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\savegame_frame.cc:534]
#11 create_win                                     [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simwin.cc:587]
Note: @0:00:23.202 in thread 2920
Note: memory was allocated here:
Note: # 0 _heap_alloc_base                              [f:\dd\vctools\crt_bld\self_x86\crt\src\malloc.c:55]
Note: # 1 _malloc_base                                  [f:\dd\vctools\crt_bld\self_x86\crt\src\malloc.c:89]
Note: # 2 _HeapManager::getMemory                       [f:\dd\vctools\langapi\undname\undname.inl:146]
Note: # 3 operator new                                  [f:\dd\vctools\langapi\undname\undname.inl:137]
Note: # 4 _HeapManager::getMemory                       [f:\dd\vctools\langapi\undname\undname.inl:165]
Note: # 5 operator new                                  [f:\dd\vctools\langapi\undname\undname.inl:137]
Note: # 6 DName::doPchar                                [f:\dd\vctools\langapi\undname\undname.inl:945]
Note: # 7 DName::operator=                              [f:\dd\vctools\langapi\undname\undname.inl:823]
Note: # 8 UnDecorator::getECSUDataType                  [f:\dd\vctools\langapi\undname\undname.cxx:3531]
Note: # 9 UnDecorator::getBasicDataType                 [f:\dd\vctools\langapi\undname\undname.cxx:3404]
Note: #10 UnDecorator::getPrimaryDataType               [f:\dd\vctools\langapi\undname\undname.cxx:3130]
Note: #11 UnDecorator::getDataType                      [f:\dd\vctools\langapi\undname\undname.cxx:3012]

Error #2: INVALID HEAP ARGUMENT: allocated with operator new, freed with RtlFreeHeap
# 0 KERNEL32.dll!HeapFree                         +0x13     (0x76b314dd <KERNEL32.dll+0x114dd>)
# 1 _free_base                                     [f:\dd\vctools\crt_bld\self_x86\crt\src\free.c:50]
# 2 type_info::_Name_base                          [f:\dd\vctools\crt_bld\self_x86\crt\prebuild\eh\typname.cpp:180]
# 3 type_info::name                                [f:\dd\vctools\crt_bld\self_x86\crt\prebuild\eh\typinfo.cpp:45]
# 4 list_tpl<gui_table_row_t>::qsort               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\tpl\list_tpl.h:382]
# 5 list_tpl<gui_table_row_t>::sort                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\tpl\list_tpl.h:484]
# 6 gui_table_t::sort_rows                         [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\components\gui_table.cc:270]
# 7 savegame_frame_t::fill_list                    [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\savegame_frame.cc:184]
# 8 savegame_frame_t::infowin_event                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\savegame_frame.cc:534]
# 9 create_win                                     [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simwin.cc:587]
#10 create_win                                     [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simwin.cc:517]
#11 banner_t::action_triggered                     [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\banner.cc:76]
Note: @0:00:23.206 in thread 2920
Note: memory was allocated here:
Note: # 0 _heap_alloc_base                               [f:\dd\vctools\crt_bld\self_x86\crt\src\malloc.c:55]
Note: # 1 _malloc_base                                   [f:\dd\vctools\crt_bld\self_x86\crt\src\malloc.c:89]
Note: # 2 _HeapManager::getMemory                        [f:\dd\vctools\langapi\undname\undname.inl:146]
Note: # 3 operator new                                   [f:\dd\vctools\langapi\undname\undname.inl:137]
Note: # 4 UnDecorator::operator char *                   [f:\dd\vctools\langapi\undname\undname.cxx:855]
Note: # 5 __unDName                                      [f:\dd\vctools\langapi\undname\undname.cxx:668]
Note: # 6 type_info::_Name_base                          [f:\dd\vctools\crt_bld\self_x86\crt\prebuild\eh\typname.cpp:124]
Note: # 7 type_info::name                                [f:\dd\vctools\crt_bld\self_x86\crt\prebuild\eh\typinfo.cpp:45]
Note: # 8 list_tpl<gui_table_row_t>::qsort               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\tpl\list_tpl.h:382]
Note: # 9 list_tpl<gui_table_row_t>::sort                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\tpl\list_tpl.h:484]
Note: #10 gui_table_t::sort_rows                         [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\components\gui_table.cc:270]
Note: #11 savegame_frame_t::fill_list                    [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\savegame_frame.cc:184]


These are much harder to understand. Line 382 of list_tpl.h is:


sprintf(name, "%s.qsort(%d, %d)", typeid(*this).name(), ll, rr);


The typeid(*this).name() is not used elsewhere in the block, and no new keyword appears at all, so I do not understand how this arises. Also, fixing the malloc/delete[] error has not fixed the crash bug.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ters

The errors seem to come from inside the type_info instance returned by typeid(). If so, there is little one can do about it except switch compiler. But I don't think these two errors have anything to do with the crash.

In fact, as far as I can tell, only "Error #5: UNADDRESSABLE ACCESS: writing 0xffffffff-0x00000000 1 byte(s) within 0xffffffff-0x00000003" from an earlier post seems to be related to the crash.

jamespetts

#25
Ters,

thank you - that is helpful. The difficulty is that the error no. 5 from the earlier post gives no clue as to what is actually causing the crash, or how to go about tracking it down. Does anyone have any suggestions as to how to go about doing this? I should be extremely grateful.

Edit: I have noticed, incidentally, that the trouble always occurs on the third iteration of FOR(weighted_vector_tpl<stadt_t*>, const s, stadt)  in karte_t::neuer_monat() one year and one month after map creation. Why it should be the third iteration is rather beyond my comprehension: the first or second I could understand, but not the third.

Edit 2: Further testing shows that it sometimes happens on the fourth or fifth iteration, which is also confusing. Sometimes the error is "privileged instruction" rather than "access violation".
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

isidoro

What Ters says makes sense.  One year and one month after the game is loaded, the function neuer_monat is called.  As you said, in the third iteration, that is to say, when looking into the third city, in line 3299, a bad access is thrown.

I guess that stadt list got corrupted somewhere else so that the pointer to the third city was overwritten.  And that's the problem.  It can even happen in the previous iteration when rechecking road conexions.

The best way to catch those errors is with a debugger.  You set a breakpoint in that function and step by step look at the relevant variables to see if any of them is corrupted.  Some debuggers, gdb for instance, even allows you to watch a variable for changes, so that they stop when that variable is changed...  You look to see if it is corrupted and, if it is, that is the piece of code to be blamed...

You are lucky, because the worst thing with those kind of errors would be that they were indeterministic, i.e. not always happening...  But yours always happens...

jamespetts

#27
Isidoro,

thank you for the thoughts, but that's not the issue. I normally use the debugger method that you described, which makes the bugs fairly easy to find, but this one is different: the access violation error does not state whether it is an access violation reading or writing any particular variable, and, more importantly, the value of "s" in the debugger when it breaks for the access violation (or sometimes privileged instruction) does point to a valid city object, so it can't be that. That's what has made this particular bug so very difficult to track down.

Edit: Odd. Attempting a further test, using the debugger on karte_t::neuer_monat() on the on the offending month, I stepped the code through the FOR loop...


FOR(weighted_vector_tpl<stadt_t*>, const s, stadt) {
        count ++;
        s->neuer_monat(recheck_road_connexions);
        outstanding_cars += s->get_outstanding_cars();
        //INT_CHECK("simworld 3117");
        total_electric_demand += s->get_power_demand();
    }


...using the "step over" command except on the line "s->neuer_monat(recheck_road_connexions);", in which I used the "step into" command, then immediately used the "step out" command. On this occasion, the problem occurred on the 10th iteration, and the error occurred on the step out step, not the step into step. This suggests that the problem is somewhere inside stadt_t::neuer_monat(), rather than in karte_t::neuer_monat(), but that, for some reason, where inside that method the problem is occurring is hidden.

Edit 2: Hmm - seem to have narrowed the problem further. When I comment out the following code in stadt_t::neuer_monat(), the error does not occur:


while(!current_cars.empty() && number_of_cars < 0)
        {
            //Make sure that there are not too many cars on the roads.
            stadtauto_t* car = current_cars.remove_first();
            car->set_list(NULL);
            welt->sync_remove(car);
            delete car;
            number_of_cars++;
        }


This code was changed recently to fix this problem with city cars causing slowdowns. Can anyone spot any errors with it? I cannot immediately see any problems.

Thank you all very much for your help so far with this issue.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

isidoro

I don't know, I'm only guessing.  The most suspicious line is delete car.  Must the car be deleted or will it be deleted in sync_step?  Another rule with all the new delete stuff is that you cannot delete something twice.

Ters

To throw in a few more possibilities:
* current_cars in invalid
* current_cars contains one or more invalid pointers
* other parts of the code still hold on to pointers to the car being deleted

jamespetts

Thank you both for your thoughts. I am not sure how current_cars might come to be invalid, or contain an invalid pointer (and, why, if it does, that I do not get a normal access violation where the breakpoint shows the particular line on which the error occurred). The cars deleted will not be called again in sync_step, since the line:


welt->sync_remove(car);


will prevent it from being called in any future sync_steps.

As to one of the individual cars being invalid, it should be removed automatically from the list if it is deleted, so this ought not occur.

Edit: Are there any special precautions required if deleting sync_steppable objects in a non-sync step?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Dwachs

Quote from: jamespetts on April 28, 2012, 03:09:38 PM
Edit: Are there any special precautions required if deleting sync_steppable objects in a non-sync step?
No, imho.
Parsley, sage, rosemary, and maggikraut.

Ters

Quote from: jamespetts on April 28, 2012, 03:09:38 PM
Thank you both for your thoughts. I am not sure how current_cars might come to be invalid, or contain an invalid pointer

Writes to some other invalid pointer can cause that.

Quote from: jamespetts on April 28, 2012, 03:09:38 PM
(and, why, if it does, that I do not get a normal access violation where the breakpoint shows the particular line on which the error occurred).

There are invalid pointers and there are invalid pointers. If the address it points to points to an address in use by the program, just not for whatever the pointer was supposed to point to, then the OS can not tell that the program did something wrong and no access violation is raised. If the pointer points to an address that has not been set up for the process, or to an address in kernel space, then the OS will shout.

Debugging these kinds of errors is an art, and whatever skills I have, are decaying in these days of Java programming.

jamespetts

 What I don't understand is why the debugger cannot even work out that the error has occurred in stadt_t::neuer_monat(), as if the pointer to that method had itself somehow gone awry.

Incidentally, the latest results from Dr. Memory do not seem to show anything relevant, nor do they show the crash, nor do they even seem to show anything in Experimental specific code:


Dr. Memory version 1.4.6 build 2 built on Mar  7 2012 10:14:04
Application cmdline: ""C:\Users\James\Documents\Development\Simutrans\simutrans-experimental-sources\simutrans\Simutrans-Experimental-debug.exe""
Recorded 62 suppression(s) from default C:\Program Files (x86)\Dr. Memory/bin/suppress-default.txt

Error #1: INVALID HEAP ARGUMENT: allocated with operator new, freed with RtlFreeHeap
# 0 KERNEL32.dll!HeapFree                         +0x13     (0x75db14dd <KERNEL32.dll+0x114dd>)
# 1 _free_base                                     [f:\dd\vctools\crt_bld\self_x86\crt\src\free.c:50]
# 2 _HeapManager::Destructor                       [f:\dd\vctools\langapi\undname\undname.cxx:120]
# 3 __unDName                                      [f:\dd\vctools\langapi\undname\undname.cxx:673]
# 4 type_info::_Name_base                          [f:\dd\vctools\crt_bld\self_x86\crt\prebuild\eh\typname.cpp:124]
# 5 type_info::name                                [f:\dd\vctools\crt_bld\self_x86\crt\prebuild\eh\typinfo.cpp:45]
# 6 list_tpl<gui_table_row_t>::qsort               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\tpl\list_tpl.h:382]
# 7 list_tpl<gui_table_row_t>::sort                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\tpl\list_tpl.h:483]
# 8 gui_table_t::sort_rows                         [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\components\gui_table.cc:270]
# 9 savegame_frame_t::fill_list                    [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\savegame_frame.cc:184]
#10 savegame_frame_t::infowin_event                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\savegame_frame.cc:534]
#11 create_win                                     [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simwin.cc:587]
Note: @0:00:25.202 in thread 2852
Note: memory was allocated here:
Note: # 0 _heap_alloc_base                              [f:\dd\vctools\crt_bld\self_x86\crt\src\malloc.c:55]
Note: # 1 _malloc_base                                  [f:\dd\vctools\crt_bld\self_x86\crt\src\malloc.c:89]
Note: # 2 _HeapManager::getMemory                       [f:\dd\vctools\langapi\undname\undname.inl:146]
Note: # 3 operator new                                  [f:\dd\vctools\langapi\undname\undname.inl:137]
Note: # 4 _HeapManager::getMemory                       [f:\dd\vctools\langapi\undname\undname.inl:165]
Note: # 5 operator new                                  [f:\dd\vctools\langapi\undname\undname.inl:137]
Note: # 6 DName::doPchar                                [f:\dd\vctools\langapi\undname\undname.inl:945]
Note: # 7 DName::operator=                              [f:\dd\vctools\langapi\undname\undname.inl:823]
Note: # 8 UnDecorator::getECSUDataType                  [f:\dd\vctools\langapi\undname\undname.cxx:3531]
Note: # 9 UnDecorator::getBasicDataType                 [f:\dd\vctools\langapi\undname\undname.cxx:3404]
Note: #10 UnDecorator::getPrimaryDataType               [f:\dd\vctools\langapi\undname\undname.cxx:3130]
Note: #11 UnDecorator::getDataType                      [f:\dd\vctools\langapi\undname\undname.cxx:3012]

Error #2: INVALID HEAP ARGUMENT: allocated with operator new, freed with RtlFreeHeap
# 0 KERNEL32.dll!HeapFree                         +0x13     (0x75db14dd <KERNEL32.dll+0x114dd>)
# 1 _free_base                                     [f:\dd\vctools\crt_bld\self_x86\crt\src\free.c:50]
# 2 type_info::_Name_base                          [f:\dd\vctools\crt_bld\self_x86\crt\prebuild\eh\typname.cpp:180]
# 3 type_info::name                                [f:\dd\vctools\crt_bld\self_x86\crt\prebuild\eh\typinfo.cpp:45]
# 4 list_tpl<gui_table_row_t>::qsort               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\tpl\list_tpl.h:382]
# 5 list_tpl<gui_table_row_t>::sort                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\tpl\list_tpl.h:483]
# 6 gui_table_t::sort_rows                         [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\components\gui_table.cc:270]
# 7 savegame_frame_t::fill_list                    [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\savegame_frame.cc:184]
# 8 savegame_frame_t::infowin_event                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\savegame_frame.cc:534]
# 9 create_win                                     [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simwin.cc:587]
#10 create_win                                     [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simwin.cc:517]
#11 banner_t::action_triggered                     [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\banner.cc:76]
Note: @0:00:25.206 in thread 2852
Note: memory was allocated here:
Note: # 0 _heap_alloc_base                               [f:\dd\vctools\crt_bld\self_x86\crt\src\malloc.c:55]
Note: # 1 _malloc_base                                   [f:\dd\vctools\crt_bld\self_x86\crt\src\malloc.c:89]
Note: # 2 _HeapManager::getMemory                        [f:\dd\vctools\langapi\undname\undname.inl:146]
Note: # 3 operator new                                   [f:\dd\vctools\langapi\undname\undname.inl:137]
Note: # 4 UnDecorator::operator char *                   [f:\dd\vctools\langapi\undname\undname.cxx:855]
Note: # 5 __unDName                                      [f:\dd\vctools\langapi\undname\undname.cxx:668]
Note: # 6 type_info::_Name_base                          [f:\dd\vctools\crt_bld\self_x86\crt\prebuild\eh\typname.cpp:124]
Note: # 7 type_info::name                                [f:\dd\vctools\crt_bld\self_x86\crt\prebuild\eh\typinfo.cpp:45]
Note: # 8 list_tpl<gui_table_row_t>::qsort               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\tpl\list_tpl.h:382]
Note: # 9 list_tpl<gui_table_row_t>::sort                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\tpl\list_tpl.h:483]
Note: #10 gui_table_t::sort_rows                         [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\components\gui_table.cc:270]
Note: #11 savegame_frame_t::fill_list                    [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\gui\savegame_frame.cc:184]

Error #3: WARNING: GDI usage error: DC created by one thread 2852 and used by another 5708
# 0 USER32.dll!UnregisterClassA                +0x4c3    (0x7723e1b0 <USER32.dll+0x1e1b0>)
# 1 USER32.dll!UnregisterClassA                +0x36d    (0x7723e05b <USER32.dll+0x1e05b>)
# 2 USER32.dll!GetWindowCompositionAttribute   +0x1ea    (0x7723f64d <USER32.dll+0x1f64d>)
# 3 USER32.dll!UnregisterClassA                +0x657    (0x7723e345 <USER32.dll+0x1e345>)
# 4 USER32.dll!UnregisterClassA                +0x869    (0x7723e557 <USER32.dll+0x1e557>)
# 5 USER32.dll!UnregisterClassA                +0xb65    (0x7723e853 <USER32.dll+0x1e853>)
# 6 USER32.dll!UnregisterClassA                +0xa97    (0x7723e785 <USER32.dll+0x1e785>)
# 7 USER32.dll!RegisterHotKey                  +0x156    (0x7723f120 <USER32.dll+0x1f120>)
# 8 USER32.dll!UnregisterClassA                +0xbc5    (0x7723e8b3 <USER32.dll+0x1e8b3>)
# 9 ntdll.dll!KiUserCallbackDispatcher         +0x2d     (0x77bf010a <ntdll.dll+0x1010a>)
#10 USER32.dll!UnregisterClassW                +0xab7    (0x7723aa3c <USER32.dll+0x1aa3c>)
#11 USER32.dll!CreateWindowExA                 +0x32     (0x7723d261 <USER32.dll+0x1d261>)
Note: @0:02:56.086 in thread 5708

Error #4: WARNING: GDI usage error: DC created by one thread 2852 and used by another 5708
# 0 USER32.dll!UnregisterClassA                +0x576    (0x7723e263 <USER32.dll+0x1e263>)
# 1 USER32.dll!UnregisterClassA                +0x36d    (0x7723e05b <USER32.dll+0x1e05b>)
# 2 USER32.dll!GetWindowCompositionAttribute   +0x1ea    (0x7723f64d <USER32.dll+0x1f64d>)
# 3 USER32.dll!UnregisterClassA                +0x657    (0x7723e345 <USER32.dll+0x1e345>)
# 4 USER32.dll!UnregisterClassA                +0x869    (0x7723e557 <USER32.dll+0x1e557>)
# 5 USER32.dll!UnregisterClassA                +0xb65    (0x7723e853 <USER32.dll+0x1e853>)
# 6 USER32.dll!UnregisterClassA                +0xa97    (0x7723e785 <USER32.dll+0x1e785>)
# 7 USER32.dll!RegisterHotKey                  +0x156    (0x7723f120 <USER32.dll+0x1f120>)
# 8 USER32.dll!UnregisterClassA                +0xbc5    (0x7723e8b3 <USER32.dll+0x1e8b3>)
# 9 ntdll.dll!KiUserCallbackDispatcher         +0x2d     (0x77bf010a <ntdll.dll+0x1010a>)
#10 USER32.dll!UnregisterClassW                +0xab7    (0x7723aa3c <USER32.dll+0x1aa3c>)
#11 USER32.dll!CreateWindowExA                 +0x32     (0x7723d261 <USER32.dll+0x1d261>)
Note: @0:02:56.098 in thread 5708

Error #5: WARNING: GDI usage error: DC created by one thread 2852 and used by another 5708
# 0 USER32.dll!UnregisterClassA                +0x4c3    (0x7723e1b0 <USER32.dll+0x1e1b0>)
# 1 USER32.dll!GetWindowCompositionAttribute   +0x2f2    (0x7723f755 <USER32.dll+0x1f755>)
# 2 USER32.dll!UnregisterClassA                +0x657    (0x7723e345 <USER32.dll+0x1e345>)
# 3 USER32.dll!UnregisterClassA                +0x869    (0x7723e557 <USER32.dll+0x1e557>)
# 4 USER32.dll!UnregisterClassA                +0xb65    (0x7723e853 <USER32.dll+0x1e853>)
# 5 USER32.dll!UnregisterClassA                +0xa97    (0x7723e785 <USER32.dll+0x1e785>)
# 6 USER32.dll!RegisterHotKey                  +0x156    (0x7723f120 <USER32.dll+0x1f120>)
# 7 USER32.dll!UnregisterClassA                +0xbc5    (0x7723e8b3 <USER32.dll+0x1e8b3>)
# 8 ntdll.dll!KiUserCallbackDispatcher         +0x2d     (0x77bf010a <ntdll.dll+0x1010a>)
# 9 USER32.dll!UnregisterClassW                +0xab7    (0x7723aa3c <USER32.dll+0x1aa3c>)
#10 USER32.dll!CreateWindowExA                 +0x32     (0x7723d261 <USER32.dll+0x1d261>)
#11 WINMM.dll!timeGetTime                      +0x126    (0x750c2807 <WINMM.dll+0x2807>)
Note: @0:02:56.098 in thread 5708

Error #6: WARNING: GDI usage error: DC created by one thread 2852 and used by another 5708
# 0 USER32.dll!UnregisterClassA                +0x576    (0x7723e263 <USER32.dll+0x1e263>)
# 1 USER32.dll!GetWindowCompositionAttribute   +0x2f2    (0x7723f755 <USER32.dll+0x1f755>)
# 2 USER32.dll!UnregisterClassA                +0x657    (0x7723e345 <USER32.dll+0x1e345>)
# 3 USER32.dll!UnregisterClassA                +0x869    (0x7723e557 <USER32.dll+0x1e557>)
# 4 USER32.dll!UnregisterClassA                +0xb65    (0x7723e853 <USER32.dll+0x1e853>)
# 5 USER32.dll!UnregisterClassA                +0xa97    (0x7723e785 <USER32.dll+0x1e785>)
# 6 USER32.dll!RegisterHotKey                  +0x156    (0x7723f120 <USER32.dll+0x1f120>)
# 7 USER32.dll!UnregisterClassA                +0xbc5    (0x7723e8b3 <USER32.dll+0x1e8b3>)
# 8 ntdll.dll!KiUserCallbackDispatcher         +0x2d     (0x77bf010a <ntdll.dll+0x1010a>)
# 9 USER32.dll!UnregisterClassW                +0xab7    (0x7723aa3c <USER32.dll+0x1aa3c>)
#10 USER32.dll!CreateWindowExA                 +0x32     (0x7723d261 <USER32.dll+0x1d261>)
#11 WINMM.dll!timeGetTime                      +0x126    (0x750c2807 <WINMM.dll+0x2807>)
Note: @0:02:56.098 in thread 5708

Error #7: WARNING: GDI usage error: DC created by one thread 2852 and used by another 5708
# 0 USER32.dll!UnregisterClassA                +0x8e2    (0x7723e5cf <USER32.dll+0x1e5cf>)
# 1 USER32.dll!UnregisterClassA                +0x885    (0x7723e573 <USER32.dll+0x1e573>)
# 2 USER32.dll!GetWindowCompositionAttribute   +0x2f2    (0x7723f755 <USER32.dll+0x1f755>)
# 3 USER32.dll!UnregisterClassA                +0x657    (0x7723e345 <USER32.dll+0x1e345>)
# 4 USER32.dll!UnregisterClassA                +0x869    (0x7723e557 <USER32.dll+0x1e557>)
# 5 USER32.dll!UnregisterClassA                +0xb65    (0x7723e853 <USER32.dll+0x1e853>)
# 6 USER32.dll!UnregisterClassA                +0xa97    (0x7723e785 <USER32.dll+0x1e785>)
# 7 USER32.dll!RegisterHotKey                  +0x156    (0x7723f120 <USER32.dll+0x1f120>)
# 8 USER32.dll!UnregisterClassA                +0xbc5    (0x7723e8b3 <USER32.dll+0x1e8b3>)
# 9 ntdll.dll!KiUserCallbackDispatcher         +0x2d     (0x77bf010a <ntdll.dll+0x1010a>)
#10 USER32.dll!UnregisterClassW                +0xab7    (0x7723aa3c <USER32.dll+0x1aa3c>)
#11 USER32.dll!CreateWindowExA                 +0x32     (0x7723d261 <USER32.dll+0x1d261>)
Note: @0:02:56.099 in thread 5708

Error #8: WARNING: GDI usage error: DC created by one thread 2852 and used by another 5708
# 0 USER32.dll!UnregisterClassA                +0x90f    (0x7723e5fc <USER32.dll+0x1e5fc>)
# 1 USER32.dll!UnregisterClassA                +0x885    (0x7723e573 <USER32.dll+0x1e573>)
# 2 USER32.dll!GetWindowCompositionAttribute   +0x2f2    (0x7723f755 <USER32.dll+0x1f755>)
# 3 USER32.dll!UnregisterClassA                +0x657    (0x7723e345 <USER32.dll+0x1e345>)
# 4 USER32.dll!UnregisterClassA                +0x869    (0x7723e557 <USER32.dll+0x1e557>)
# 5 USER32.dll!UnregisterClassA                +0xb65    (0x7723e853 <USER32.dll+0x1e853>)
# 6 USER32.dll!UnregisterClassA                +0xa97    (0x7723e785 <USER32.dll+0x1e785>)
# 7 USER32.dll!RegisterHotKey                  +0x156    (0x7723f120 <USER32.dll+0x1f120>)
# 8 USER32.dll!UnregisterClassA                +0xbc5    (0x7723e8b3 <USER32.dll+0x1e8b3>)
# 9 ntdll.dll!KiUserCallbackDispatcher         +0x2d     (0x77bf010a <ntdll.dll+0x1010a>)
#10 USER32.dll!UnregisterClassW                +0xab7    (0x7723aa3c <USER32.dll+0x1aa3c>)
#11 USER32.dll!CreateWindowExA                 +0x32     (0x7723d261 <USER32.dll+0x1d261>)
Note: @0:02:56.099 in thread 5708

Error #9: LEAK 0 direct bytes 0x08034330-0x08034330 + 0 indirect bytes
# 0 operator new                            [f:\dd\vctools\crt_bld\self_x86\crt\src\new.cpp:59]
# 1 operator new[]                          [f:\dd\vctools\crt_bld\self_x86\crt\src\newaop.cpp:6]
# 2 image_reader_t::read_node               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\image_reader.cc:85]
# 3 obj_reader_t::read_nodes                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:270]
# 4 obj_reader_t::read_nodes                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:272]
# 5 obj_reader_t::read_nodes                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:272]
# 6 obj_reader_t::read_nodes                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:272]
# 7 obj_reader_t::read_nodes                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:272]
# 8 obj_reader_t::read_nodes                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:272]
# 9 obj_reader_t::read_nodes                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:272]
#10 obj_reader_t::read_file                 [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:228]
#11 obj_reader_t::load                      [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:175]

Error #10: LEAK 0 direct bytes 0x08034360-0x08034360 + 0 indirect bytes
# 0 operator new                                  [f:\dd\vctools\crt_bld\self_x86\crt\src\new.cpp:59]
# 1 operator new[]                                [f:\dd\vctools\crt_bld\self_x86\crt\src\newaop.cpp:6]
# 2 imagelist2d_reader_t::read_node               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\imagelist2d_reader.cc:15]
# 3 obj_reader_t::read_nodes                      [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:270]
# 4 obj_reader_t::read_nodes                      [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:272]
# 5 obj_reader_t::read_nodes                      [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:272]
# 6 obj_reader_t::read_nodes                      [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:272]
# 7 obj_reader_t::read_nodes                      [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:272]
# 8 obj_reader_t::read_file                       [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:228]
# 9 obj_reader_t::load                            [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:175]
#10 simu_main                                     [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simmain.cc:873]
#11 sysmain                                       [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simsys.cc:109]

Error #11: LEAK 0 direct bytes 0x08034570-0x08034570 + 0 indirect bytes
# 0 operator new                           [f:\dd\vctools\crt_bld\self_x86\crt\src\new.cpp:59]
# 1 operator new[]                         [f:\dd\vctools\crt_bld\self_x86\crt\src\newaop.cpp:6]
# 2 text_reader_t::read_node               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\text_reader.cc:13]
# 3 obj_reader_t::read_nodes               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:270]
# 4 obj_reader_t::read_nodes               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:272]
# 5 obj_reader_t::read_nodes               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:272]
# 6 obj_reader_t::read_nodes               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:272]
# 7 obj_reader_t::read_file                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:228]
# 8 obj_reader_t::load                     [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:175]
# 9 simu_main                              [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simmain.cc:873]
#10 sysmain                                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simsys.cc:109]
#11 WinMain                                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simsys_w.cc:703]

Error #12: LEAK 0 direct bytes 0x06060e68-0x06060e68 + 0 indirect bytes
# 0 operator new                            [f:\dd\vctools\crt_bld\self_x86\crt\src\new.cpp:59]
# 1 operator new[]                          [f:\dd\vctools\crt_bld\self_x86\crt\src\newaop.cpp:6]
# 2 image_reader_t::read_node               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\image_reader.cc:85]
# 3 obj_reader_t::read_nodes                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:270]
# 4 obj_reader_t::read_nodes                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:272]
# 5 obj_reader_t::read_nodes                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:272]
# 6 obj_reader_t::read_nodes                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:272]
# 7 obj_reader_t::read_file                 [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:228]
# 8 obj_reader_t::load                      [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:175]
# 9 simu_main                               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simmain.cc:873]
#10 sysmain                                 [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simsys.cc:109]
#11 WinMain                                 [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simsys_w.cc:703]

Error #13: LEAK 0 direct bytes 0x06060fe8-0x06060fe8 + 0 indirect bytes
# 0 operator new                            [f:\dd\vctools\crt_bld\self_x86\crt\src\new.cpp:59]
# 1 operator new[]                          [f:\dd\vctools\crt_bld\self_x86\crt\src\newaop.cpp:6]
# 2 image_reader_t::read_node               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\image_reader.cc:85]
# 3 obj_reader_t::read_nodes                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:270]
# 4 obj_reader_t::read_nodes                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:272]
# 5 obj_reader_t::read_nodes                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:272]
# 6 obj_reader_t::read_nodes                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:272]
# 7 obj_reader_t::read_nodes                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:272]
# 8 obj_reader_t::read_file                 [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:228]
# 9 obj_reader_t::load                      [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:175]
#10 simu_main                               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simmain.cc:873]
#11 sysmain                                 [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simsys.cc:109]

Error #14: LEAK 0 direct bytes 0x060613d8-0x060613d8 + 0 indirect bytes
# 0 operator new                           [f:\dd\vctools\crt_bld\self_x86\crt\src\new.cpp:59]
# 1 operator new[]                         [f:\dd\vctools\crt_bld\self_x86\crt\src\newaop.cpp:6]
# 2 text_reader_t::read_node               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\text_reader.cc:13]
# 3 obj_reader_t::read_nodes               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:270]
# 4 obj_reader_t::read_nodes               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:272]
# 5 obj_reader_t::read_nodes               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:272]
# 6 obj_reader_t::read_file                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:228]
# 7 obj_reader_t::load                     [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:175]
# 8 simu_main                              [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simmain.cc:873]
# 9 sysmain                                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simsys.cc:109]
#10 WinMain                                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simsys_w.cc:703]

Error #15: LEAK 0 direct bytes 0x060618e8-0x060618e8 + 0 indirect bytes
# 0 operator new                                  [f:\dd\vctools\crt_bld\self_x86\crt\src\new.cpp:59]
# 1 operator new[]                                [f:\dd\vctools\crt_bld\self_x86\crt\src\newaop.cpp:6]
# 2 imagelist2d_reader_t::read_node               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\imagelist2d_reader.cc:15]
# 3 obj_reader_t::read_nodes                      [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:270]
# 4 obj_reader_t::read_nodes                      [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:272]
# 5 obj_reader_t::read_nodes                      [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:272]
# 6 obj_reader_t::read_nodes                      [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:272]
# 7 obj_reader_t::read_file                       [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:228]
# 8 obj_reader_t::load                            [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:175]
# 9 simu_main                                     [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simmain.cc:873]
#10 sysmain                                       [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simsys.cc:109]
#11 WinMain                                       [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simsys_w.cc:703]

Error #16: LEAK 0 direct bytes 0x06065a88-0x06065a88 + 0 indirect bytes
# 0 operator new                                [f:\dd\vctools\crt_bld\self_x86\crt\src\new.cpp:59]
# 1 operator new[]                              [f:\dd\vctools\crt_bld\self_x86\crt\src\newaop.cpp:6]
# 2 imagelist_reader_t::read_node               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\imagelist_reader.cc:15]
# 3 obj_reader_t::read_nodes                    [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:270]
# 4 obj_reader_t::read_nodes                    [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:272]
# 5 obj_reader_t::read_nodes                    [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:272]
# 6 obj_reader_t::read_nodes                    [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:272]
# 7 obj_reader_t::read_file                     [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:228]
# 8 obj_reader_t::load                          [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:175]
# 9 simu_main                                   [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simmain.cc:873]
#10 sysmain                                     [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simsys.cc:109]
#11 WinMain                                     [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simsys_w.cc:703]

Error #17: LEAK 0 direct bytes 0x061554a8-0x061554a8 + 0 indirect bytes
# 0 operator new                            [f:\dd\vctools\crt_bld\self_x86\crt\src\new.cpp:59]
# 1 operator new[]                          [f:\dd\vctools\crt_bld\self_x86\crt\src\newaop.cpp:6]
# 2 image_reader_t::read_node               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\image_reader.cc:85]
# 3 obj_reader_t::read_nodes                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:270]
# 4 obj_reader_t::read_nodes                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:272]
# 5 obj_reader_t::read_nodes                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:272]
# 6 obj_reader_t::read_nodes                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:272]
# 7 obj_reader_t::read_nodes                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:272]
# 8 obj_reader_t::read_nodes                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:272]
# 9 obj_reader_t::read_file                 [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:228]
#10 obj_reader_t::load                      [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:175]
#11 simu_main                               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simmain.cc:873]

Error #18: LEAK 8 direct bytes 0x024a1fa8-0x024a1fb0 + 0 indirect bytes
# 0 operator new                                                               [f:\dd\vctools\crt_bld\self_x86\crt\src\new.cpp:59]
# 1 std::_Allocate<std::_Container_proxy>                                      [c:\program files (x86)\microsoft visual studio 10.0\vc\include\xmemory:36]
# 2 std::allocator<std::_Container_proxy>::allocate                            [c:\program files (x86)\microsoft visual studio 10.0\vc\include\xmemory:187]
# 3 std::_String_val<char,std::allocator<char> >::_String_val<char,std::allocator<char> > [c:\program files (x86)\microsoft visual studio 10.0\vc\include\xstring:469]
# 4 std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> > [c:\program files (x86)\microsoft visual studio 10.0\vc\include\xstring:550]
# 5 simu_main                                                                  [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simmain.cc:895]
# 6 sysmain                                                                    [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simsys.cc:109]
# 7 WinMain                                                                    [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simsys_w.cc:703]

Error #19: LEAK 16 direct bytes 0x024a4538-0x024a4548 + 0 indirect bytes
# 0 operator new                         [f:\dd\vctools\crt_bld\self_x86\crt\src\new.cpp:59]
# 1 loadsave_t::loadsave_t               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\dataobj\loadsave.cc:39]
# 2 simu_main                            [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simmain.cc:526]
# 3 sysmain                              [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simsys.cc:109]
# 4 WinMain                              [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simsys_w.cc:703]

Error #20: LEAK 32 direct bytes 0x024a68b8-0x024a68d8 + 0 indirect bytes
# 0 operator new                                                               [f:\dd\vctools\crt_bld\self_x86\crt\src\new.cpp:59]
# 1 std::_Allocate<char>                                                       [c:\program files (x86)\microsoft visual studio 10.0\vc\include\xmemory:36]
# 2 std::allocator<char>::allocate                                             [c:\program files (x86)\microsoft visual studio 10.0\vc\include\xmemory:187]
# 3 std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Copy [c:\program files (x86)\microsoft visual studio 10.0\vc\include\xstring:1932]
# 4 std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Grow [c:\program files (x86)\microsoft visual studio 10.0\vc\include\xstring:1962]
# 5 std::basic_string<char,std::char_traits<char>,std::allocator<char> >::assign [c:\program files (x86)\microsoft visual studio 10.0\vc\include\xstring:919]
# 6 std::basic_string<char,std::char_traits<char>,std::allocator<char> >::assign [c:\program files (x86)\microsoft visual studio 10.0\vc\include\xstring:930]
# 7 std::basic_string<char,std::char_traits<char>,std::allocator<char> >::operator= [c:\program files (x86)\microsoft visual studio 10.0\vc\include\xstring:768]
# 8 loadsave_t::rd_open                                                        [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\dataobj\loadsave.cc:162]
# 9 simu_main                                                                  [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simmain.cc:533]
#10 sysmain                                                                    [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simsys.cc:109]
#11 WinMain                                                                    [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simsys_w.cc:703]

Error #21: LEAK 12 direct bytes 0x024a7cb0-0x024a7cbc + 0 indirect bytes
# 0 operator new               [f:\dd\vctools\crt_bld\self_x86\crt\src\new.cpp:59]
# 1 init_logging               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simdebug.cc:24]
# 2 simu_main                  [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simmain.cc:521]
# 3 sysmain                    [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simsys.cc:109]
# 4 WinMain                    [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simsys_w.cc:703]

Error #22: LEAK 8 direct bytes 0x024a7ce8-0x024a7cf0 + 0 indirect bytes
# 0 operator new                                                               [f:\dd\vctools\crt_bld\self_x86\crt\src\new.cpp:59]
# 1 std::_Allocate<std::_Container_proxy>                                      [c:\program files (x86)\microsoft visual studio 10.0\vc\include\xmemory:36]
# 2 std::allocator<std::_Container_proxy>::allocate                            [c:\program files (x86)\microsoft visual studio 10.0\vc\include\xmemory:187]
# 3 std::_String_val<char,std::allocator<char> >::_String_val<char,std::allocator<char> > [c:\program files (x86)\microsoft visual studio 10.0\vc\include\xstring:469]
# 4 std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> > [c:\program files (x86)\microsoft visual studio 10.0\vc\include\xstring:550]
# 5 loadsave_t::loadsave_t                                                     [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\dataobj\loadsave.cc:36]
# 6 simu_main                                                                  [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simmain.cc:526]
# 7 sysmain                                                                    [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simsys.cc:109]
# 8 WinMain                                                                    [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simsys_w.cc:703]

Error #23: LEAK 3 direct bytes 0x024aa078-0x024aa07b + 0 indirect bytes
# 0 _strdup_dbg                        [f:\dd\vctools\crt_bld\self_x86\crt\src\strdup.c:75]
# 1 _strdup                            [f:\dd\vctools\crt_bld\self_x86\crt\src\strdup.c:48]
# 2 loadsave_t::rdwr_str               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\dataobj\loadsave.cc:709]
# 3 umgebung_t::rdwr                   [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\dataobj\umgebung.cc:291]
# 4 simu_main                          [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simmain.cc:560]
# 5 sysmain                            [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simsys.cc:109]
# 6 WinMain                            [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simsys_w.cc:703]

Error #24: LEAK 4 direct bytes 0x024bb208-0x024bb20c + 288 indirect bytes
# 0 operator new                            [f:\dd\vctools\crt_bld\self_x86\crt\src\new.cpp:59]
# 1 obj_besch_t::operator new               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\obj_besch.h:41]
# 2 obj_reader_t::read_node                 [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:295]
# 3 obj_reader_t::read_nodes                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:270]
# 4 obj_reader_t::read_nodes                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:272]
# 5 obj_reader_t::read_file                 [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:228]
# 6 obj_reader_t::load                      [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:175]
# 7 obj_reader_t::init                      [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:54]
# 8 simu_main                               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simmain.cc:667]
# 9 sysmain                                 [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simsys.cc:109]
#10 WinMain                                 [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simsys_w.cc:703]

Error #25: LEAK 0 direct bytes 0x024bb238-0x024bb238 + 0 indirect bytes
# 0 operator new                           [f:\dd\vctools\crt_bld\self_x86\crt\src\new.cpp:59]
# 1 operator new[]                         [f:\dd\vctools\crt_bld\self_x86\crt\src\newaop.cpp:6]
# 2 text_reader_t::read_node               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\text_reader.cc:13]
# 3 obj_reader_t::read_nodes               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:270]
# 4 obj_reader_t::read_nodes               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:272]
# 5 obj_reader_t::read_nodes               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:272]
# 6 obj_reader_t::read_file                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:228]
# 7 obj_reader_t::load                     [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:175]
# 8 obj_reader_t::init                     [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:54]
# 9 simu_main                              [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simmain.cc:667]
#10 sysmain                                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simsys.cc:109]
#11 WinMain                                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simsys_w.cc:703]

Error #26: LEAK 0 direct bytes 0x024bb298-0x024bb298 + 0 indirect bytes
# 0 operator new                            [f:\dd\vctools\crt_bld\self_x86\crt\src\new.cpp:59]
# 1 operator new[]                          [f:\dd\vctools\crt_bld\self_x86\crt\src\newaop.cpp:6]
# 2 image_reader_t::read_node               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\image_reader.cc:85]
# 3 obj_reader_t::read_nodes                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:270]
# 4 obj_reader_t::read_nodes                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:272]
# 5 obj_reader_t::read_nodes                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:272]
# 6 obj_reader_t::read_nodes                [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:272]
# 7 obj_reader_t::read_file                 [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:228]
# 8 obj_reader_t::load                      [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:175]
# 9 obj_reader_t::init                      [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\besch\reader\obj_reader.cc:54]
#10 simu_main                               [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simmain.cc:667]
#11 sysmain                                 [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simsys.cc:109]

Error #27: LEAK 8 direct bytes 0x024bb860-0x024bb868 + 0 indirect bytes
# 0 operator new                                                               [f:\dd\vctools\crt_bld\self_x86\crt\src\new.cpp:59]
# 1 std::_Allocate<std::_Container_proxy>                                      [c:\program files (x86)\microsoft visual studio 10.0\vc\include\xmemory:36]
# 2 std::allocator<std::_Container_proxy>::allocate                            [c:\program files (x86)\microsoft visual studio 10.0\vc\include\xmemory:187]
# 3 std::_String_val<char,std::allocator<char> >::_String_val<char,std::allocator<char> > [c:\program files (x86)\microsoft visual studio 10.0\vc\include\xstring:469]
# 4 std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> > [c:\program files (x86)\microsoft visual studio 10.0\vc\include\xstring:702]
# 5 std::operator+<char,std::char_traits<char>,std::allocator<char> >          [c:\program files (x86)\microsoft visual studio 10.0\vc\include\string:147]
# 6 simu_main                                                                  [c:\users\james\documents\development\simutrans\simutrans-experimental-sources\simmain.cc:581]
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

jamespetts

Hmm - I couldn't track down the actual problem, but I have found a workaround involving deleting in the sync_step rather than the step, which is probably less efficient, but seems to yield acceptable performance all the same.

Thank you all for your help!
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

prissi

Deleting stuff by returning false in sync_step is most effective, since it avoids searching the sync_lists for the object.

jamespetts

Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.