Author Topic: [Bug] global-buffer-overflow in simgraph16.cc  (Read 1081 times)

0 Members and 1 Guest are viewing this topic.

Offline O01eg

[Bug] global-buffer-overflow in simgraph16.cc
« on: April 02, 2017, 05:09:11 PM »
Tested simutrans with AddressSanitizer and got error at startup:

Code: [Select]
==18168==ERROR: AddressSanitizer: global-buffer-overflow on address 0x55555868c99e at pc 0x5555566b79e2 bp 0x7fffffff9c90 sp 0x7fffffff9c80
READ of size 1 at 0x55555868c99e thread T0

Program received signal SIGSEGV, Segmentation fault.
0x00007fffffff9070 in ?? ()
(gdb) bt
#0  0x00007fffffff9070 in ?? ()
#1  0x00007ffff6f6b393 in ?? () from /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.4/libasan.so.1
#2  0x00007ffff6f69e8c in ?? () from /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.4/libasan.so.1
#3  0x00007ffff6f681d6 in ?? () from /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.4/libasan.so.1
#4  0x00007ffff6f5c591 in __asan_report_error () from /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.4/libasan.so.1
#5  0x00007ffff6f5d593 in __asan_report_load1 () from /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.4/libasan.so.1
#6  0x00005555566b79e2 in calc_base_pal_from_night_shift (night=0) at display/simgraph16.cc:1918
#7  0x00005555566b890c in display_day_night_shift (night=0) at display/simgraph16.cc:1974
#8  0x00005555566d2b19 in simgraph_init (width=704, height=560, full_screen=0) at display/simgraph16.cc:4998
#9  0x0000555556cd5c16 in simu_main (argc=1, argv=0x7fffffffd668) at simmain.cc:866
#10 0x0000555556d0cbdd in sysmain (argc=1, argv=0x7fffffffd668) at simsys.cc:825
#11 0x0000555556f0dbde in main (argc=1, argv=0x7fffffffd668) at simsys_s.cc:729
(gdb) f 6
#6  0x00005555566b79e2 in calc_base_pal_from_night_shift (night=0) at display/simgraph16.cc:1918
warning: Source file is more recent than executable.
1918 transparent_map_day_night[i] = (specialcolormap_day_night[player_offsets[player_day][0] + i] >> 2) & TWO_OUT_16;
(gdb) p player_day
$1 = 255 '\377'
(gdb) p player_offsets
$2 = {"\000\030", "\b ", "\020(", "\030\060", " 8", "(@", "0H", "8P", "@X", "H`", "Ph", "Xp", "`x", "h\200", "p\210", "x\220"}
(gdb) p &player_offsets
$4 = (unsigned char (*)[16][2]) 0x55555868c7a0 <player_offsets>
(gdb) p __asan_describe_address(0x55555868c99e)
0x55555868c99e is located 22 bytes to the right of global variable 'images' from 'display/simgraph16.cc' (0x55555868c980) of size 8
0x55555868c99e is located 34 bytes to the left of global variable 'anz_images' from 'display/simgraph16.cc' (0x55555868c9c0) of size 4

Looks like player_day initialized with start value when calc_base_pal_from_night_shift called before activate_player_color or display_set_player_color_scheme which sets player_day.
Rev: master - aa88e8679ef285c0ced5cb714070bd6812cdf272
OS: Gentoo Linux AMD64

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 15698
  • Total likes: 395
  • Helpful: 174
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [Bug] global-buffer-overflow in simgraph16.cc
« Reply #1 on: April 02, 2017, 05:28:21 PM »
That is extremely odd, since it works for me (albeit on Windows) and this is unchanged from Standard (I have recently updated to the latest version of simgraph16.cc from Standard). I have also been incorporating other changes from Standard this afternoon - can you re-test with the latest commit?
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.

Offline O01eg

Re: [Bug] global-buffer-overflow in simgraph16.cc
« Reply #2 on: April 02, 2017, 09:17:43 PM »
I update to c20716cafebb2d7f5974bec8051c3b62de544a87 but nothing changed. I suppose Standart affected so.

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 15698
  • Total likes: 395
  • Helpful: 174
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [Bug] global-buffer-overflow in simgraph16.cc
« Reply #3 on: April 02, 2017, 10:06:47 PM »
In what conditions do you get this error? I am not getting any crashes at startup.
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.

Offline O01eg

Re: [Bug] global-buffer-overflow in simgraph16.cc
« Reply #4 on: April 03, 2017, 04:09:33 AM »
It doesn't crash it just reads unknown data outside an array from the global memory what is a error for address sanitizer.

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 15698
  • Total likes: 395
  • Helpful: 174
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [Bug] global-buffer-overflow in simgraph16.cc
« Reply #5 on: April 03, 2017, 09:00:33 AM »
I do not understand that - the backtrace that you posted is of a segmentation fault, which is the name (in Linux) for a program trying to read memory outside the range of memory allocated to that program by the operating system. This will inevitably cause the program to terminate (which is what the SIGSEGV message denotes).

Are you able to test with Standard to see whether this error also occurs there?

Thank you for testing this.
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.

Offline A.Badger

Re: [Bug] global-buffer-overflow in simgraph16.cc
« Reply #6 on: April 03, 2017, 02:56:49 PM »
O01eg, since addresssanitizer isn't part of the default options, could you add step-by-step instructions on how you enabled that?

Offline O01eg

Re: [Bug] global-buffer-overflow in simgraph16.cc
« Reply #7 on: April 03, 2017, 07:02:01 PM »
I do not understand that - the backtrace that you posted is of a segmentation fault, which is the name (in Linux) for a program trying to read memory outside the range of memory allocated to that program by the operating system. This will inevitably cause the program to terminate (which is what the SIGSEGV message denotes).

Are you able to test with Standard to see whether this error also occurs there?

Thank you for testing this.
SIGSEGV happens inside sanitizer and doesn' t happen without it.

I'll try to build simutrans standart with sanitizers if it have same error.

O01eg, since addresssanitizer isn't part of the default options, could you add step-by-step instructions on how you enabled that?
I just add `-fsanitize=address -fsanitize=undefined -fPIC -fPIE` into environment variables CFLAGS and CXXFLAGS and `-fsanitize=address -fsanitize=undefined -pie -fPIE` into LDFLAGS.

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 15698
  • Total likes: 395
  • Helpful: 174
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [Bug] global-buffer-overflow in simgraph16.cc
« Reply #8 on: April 03, 2017, 07:05:25 PM »
SIGSEGV happens inside sanitizer and doesn' t happen without it.

I'll try to build simutrans standart with sanitizers if it have same error.
I just add `-fsanitize=address -fsanitize=undefined -fPIC -fPIE` into environment variables CFLAGS and CXXFLAGS and `-fsanitize=address -fsanitize=undefined -pie -fPIE` into LDFLAGS.

Thank you - that is very helpful. In the meantime, I will try to see whether I can reproduce this with Dr. Memory.

Edit: I cannot find anything significant running a Visual Studio debug build with Dr. Memory:

[code]
Dr. Memory version 1.11.0 build 2 built on Aug 29 2016 02:42:07
Dr. Memory results for pid 13776: "Simutrans-Extended-debug.exe"
Application cmdline: "C:\Users\James\Documents\Development\Simutrans\simutrans-extended-sources\simutrans\Simutrans-Extended-debug.exe"
Recorded 115 suppression(s) from default C:\Program Files (x86)\Dr. Memory\bin\suppress-default.txt

Error #1: POSSIBLE LEAK 11 direct bytes 0x02880768-0x02880773 + 0 indirect bytes
# 0 replace_malloc                              [d:\drmemory_package\common\alloc_replace.c:2576]
# 1 xmalloc                                     [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simmem.cc:156]
# 2 translator::init_custom_names               [c:\users\james\documents\development\simutrans\simutrans-extended-sources\dataobj\translator.cc:308]
# 3 translator::set_language                    [c:\users\james\documents\development\simutrans\simutrans-extended-sources\dataobj\translator.cc:629]
# 4 translator::set_language                    [c:\users\james\documents\development\simutrans\simutrans-extended-sources\dataobj\translator.cc:657]
# 5 simu_main                                   [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simmain.cc:1019]
# 6 sysmain                                     [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys.cc:825]
# 7 WinMain                                     [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys_w.cc:1022]

Error #2: LEAK 8 direct bytes 0x02880910-0x02880918 + 64 indirect bytes
# 0 replace_operator_new                                [d:\drmemory_package\common\alloc_replace.c:2899]
# 1 std::_Allocate                                      [c:\program files (x86)\microsoft visual studio 14.0\vc\include\xmemory0:83]
# 2 std::allocator<>::allocate                          [c:\program files (x86)\microsoft visual studio 14.0\vc\include\xmemory0:725]
# 3 std::_Wrap_alloc<>::allocate                        [c:\program files (x86)\microsoft visual studio 14.0\vc\include\xmemory0:976]
# 4 std::_String_alloc<>::_Alloc_proxy                  [c:\program files (x86)\microsoft visual studio 14.0\vc\include\xstring:649]
# 5 std::_String_alloc<>::_String_alloc<>               [c:\program files (x86)\microsoft visual studio 14.0\vc\include\xstring:614]
# 6 std::basic_string<>::basic_string<>                 [c:\program files (x86)\microsoft visual studio 14.0\vc\include\xstring:835]
# 7 sound_ids::sound_ids                                [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\sound_desc.cc:35]
# 8 sound_desc_t::get_sound_id                          [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\sound_desc.cc:107]
# 9 sound_desc_t::init                                  [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\sound_desc.cc:78]
#10 simu_main                                           [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simmain.cc:990]
#11 sysmain                                             [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys.cc:825]

Error #3: LEAK 8 direct bytes 0x028811e8-0x028811f0 + 0 indirect bytes
# 0 replace_malloc                              [d:\drmemory_package\common\alloc_replace.c:2576]
# 1 xmalloc                                     [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simmem.cc:156]
# 2 translator::init_custom_names               [c:\users\james\documents\development\simutrans\simutrans-extended-sources\dataobj\translator.cc:308]
# 3 translator::set_language                    [c:\users\james\documents\development\simutrans\simutrans-extended-sources\dataobj\translator.cc:629]
# 4 translator::set_language                    [c:\users\james\documents\development\simutrans\simutrans-extended-sources\dataobj\translator.cc:657]
# 5 simu_main                                   [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simmain.cc:1019]
# 6 sysmain                                     [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys.cc:825]
# 7 WinMain                                     [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys_w.cc:1022]

Error #4: LEAK 14 direct bytes 0x02881228-0x02881236 + 0 indirect bytes
# 0 replace_malloc                              [d:\drmemory_package\common\alloc_replace.c:2576]
# 1 xmalloc                                     [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simmem.cc:156]
# 2 translator::init_custom_names               [c:\users\james\documents\development\simutrans\simutrans-extended-sources\dataobj\translator.cc:393]
# 3 translator::set_language                    [c:\users\james\documents\development\simutrans\simutrans-extended-sources\dataobj\translator.cc:629]
# 4 translator::set_language                    [c:\users\james\documents\development\simutrans\simutrans-extended-sources\dataobj\translator.cc:657]
# 5 simu_main                                   [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simmain.cc:1019]
# 6 sysmain                                     [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys.cc:825]
# 7 WinMain                                     [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys_w.cc:1022]

Error #5: LEAK 28 direct bytes 0x0288b048-0x0288b064 + 13120 indirect bytes
# 0 replace_operator_new                              [d:\drmemory_package\common\alloc_replace.c:2899]
# 1 obj_desc_t::operator new                          [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\obj_desc.h:29]
# 2 image_t::copy_image                               [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\image.cc:307]
# 3 image_t::copy_rotate                              [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\image.cc:348]
# 4 create_alpha_tile                                 [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\ground_desc.cc:278]
# 5 ground_desc_t::init_ground_textures               [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\ground_desc.cc:982]
# 6 karte_t::karte_t                                  [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simworld.cc:2890]
# 7 simu_main                                         [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simmain.cc:1191]
# 8 sysmain                                           [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys.cc:825]
# 9 WinMain                                           [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys_w.cc:1022]

Error #6: POSSIBLE LEAK 32756 direct bytes 0x0288c0c8-0x028940bc + 126197 indirect bytes
# 0 replace_malloc                                                        [d:\drmemory_package\common\alloc_replace.c:2576]
# 1 xmalloc                                                               [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simmem.cc:156]
# 2 freelist_t::gimme_node                                                [c:\users\james\documents\development\simutrans\simutrans-extended-sources\dataobj\freelist.cc:106]
# 3 slist_tpl<>::node_t::operator new                                     [c:\users\james\documents\development\simutrans\simutrans-extended-sources\tpl\slist_tpl.h:42]
# 4 slist_tpl<>::insert                                                   [c:\users\james\documents\development\simutrans\simutrans-extended-sources\tpl\slist_tpl.h:165]
# 5 slist_tpl<>::append                                                   [c:\users\james\documents\development\simutrans\simutrans-extended-sources\tpl\slist_tpl.h:196]
# 6 hashtable_tpl<>::put                                                  [c:\users\james\documents\development\simutrans\simutrans-extended-sources\tpl\hashtable_tpl.h:270]
# 7 obj_reader_t::register_reader                                         [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\obj_reader.cc:43]
# 8 text_reader_t::text_reader_t                                          [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\text_reader.h:6]
# 9 `dynamic initializer for 'text_reader_t::the_instance''               [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\sim_reader.cc:35]
#10 _initterm                                                             [d:\th\minkernel\crts\ucrt\src\appcrt\startup\initterm.cpp:21]
#11 __scrt_common_main_seh                                                [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:221]

Error #7: LEAK 0 direct bytes 0x02894588-0x02894588 + 0 indirect bytes
# 0 replace_operator_new_array               [d:\drmemory_package\common\alloc_replace.c:2928]
# 1 image_t::alloc                           [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\image.h:64]
# 2 image_reader_t::read_node                [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\image_reader.cc:94]
# 3 obj_reader_t::read_nodes                 [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\obj_reader.cc:235]
# 4 obj_reader_t::read_nodes                 [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\obj_reader.cc:239]
# 5 obj_reader_t::read_nodes                 [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\obj_reader.cc:239]
# 6 obj_reader_t::read_nodes                 [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\obj_reader.cc:239]
# 7 obj_reader_t::read_nodes                 [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\obj_reader.cc:239]
# 8 obj_reader_t::read_nodes                 [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\obj_reader.cc:239]
# 9 obj_reader_t::read_nodes                 [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\obj_reader.cc:239]
#10 obj_reader_t::read_file                  [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\obj_reader.cc:195]
#11 obj_reader_t::load                       [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\obj_reader.cc:147]

Error #8: LEAK 28 direct bytes 0x02894738-0x02894754 + 13120 indirect bytes
# 0 replace_operator_new                              [d:\drmemory_package\common\alloc_replace.c:2899]
# 1 obj_desc_t::operator new                          [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\obj_desc.h:29]
# 2 image_t::copy_image                               [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\image.cc:307]
# 3 image_t::copy_rotate                              [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\image.cc:348]
# 4 create_alpha_tile                                 [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\ground_desc.cc:278]
# 5 ground_desc_t::init_ground_textures               [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\ground_desc.cc:987]
# 6 karte_t::karte_t                                  [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simworld.cc:2890]
# 7 simu_main                                         [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simmain.cc:1191]
# 8 sysmain                                           [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys.cc:825]
# 9 WinMain                                           [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys_w.cc:1022]

Error #9: POSSIBLE LEAK 32764 direct bytes 0x0289a308-0x028a2304 + 0 indirect bytes
# 0 replace_malloc                                  [d:\drmemory_package\common\alloc_replace.c:2576]
# 1 xmalloc                                         [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simmem.cc:156]
# 2 freelist_t::gimme_node                          [c:\users\james\documents\development\simutrans\simutrans-extended-sources\dataobj\freelist.cc:106]
# 3 slist_tpl<>::node_t::operator new               [c:\users\james\documents\development\simutrans\simutrans-extended-sources\tpl\slist_tpl.h:42]
# 4 slist_tpl<>::insert                             [c:\users\james\documents\development\simutrans\simutrans-extended-sources\tpl\slist_tpl.h:165]
# 5 slist_tpl<>::append                             [c:\users\james\documents\development\simutrans\simutrans-extended-sources\tpl\slist_tpl.h:196]
# 6 hashtable_tpl<>::put                            [c:\users\james\documents\development\simutrans\simutrans-extended-sources\tpl\hashtable_tpl.h:270]
# 7 tabfileobj_t::put                               [c:\users\james\documents\development\simutrans\simutrans-extended-sources\dataobj\tabfile.cc:73]
# 8 tabfile_t::read                                 [c:\users\james\documents\development\simutrans\simutrans-extended-sources\dataobj\tabfile.cc:403]
# 9 simu_main                                       [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simmain.cc:567]
#10 sysmain                                         [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys.cc:825]
#11 WinMain                                         [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys_w.cc:1022]

Error #10: LEAK 8 direct bytes 0x028a2478-0x028a2480 + 32 indirect bytes
# 0 replace_operator_new                                [d:\drmemory_package\common\alloc_replace.c:2899]
# 1 std::_Allocate                                      [c:\program files (x86)\microsoft visual studio 14.0\vc\include\xmemory0:83]
# 2 std::allocator<>::allocate                          [c:\program files (x86)\microsoft visual studio 14.0\vc\include\xmemory0:725]
# 3 std::_Wrap_alloc<>::allocate                        [c:\program files (x86)\microsoft visual studio 14.0\vc\include\xmemory0:976]
# 4 std::_String_alloc<>::_Alloc_proxy                  [c:\program files (x86)\microsoft visual studio 14.0\vc\include\xstring:649]
# 5 std::_String_alloc<>::_String_alloc<>               [c:\program files (x86)\microsoft visual studio 14.0\vc\include\xstring:614]
# 6 std::basic_string<>::basic_string<>                 [c:\program files (x86)\microsoft visual studio 14.0\vc\include\xstring:835]
# 7 sound_ids::sound_ids                                [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\sound_desc.cc:35]
# 8 sound_desc_t::get_sound_id                          [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\sound_desc.cc:107]
# 9 sound_desc_t::init                                  [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\sound_desc.cc:83]
#10 simu_main                                           [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simmain.cc:990]
#11 sysmain                                             [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys.cc:825]

Error #11: LEAK 8 direct bytes 0x028aac38-0x028aac40 + 32 indirect bytes
# 0 replace_operator_new                                [d:\drmemory_package\common\alloc_replace.c:2899]
# 1 std::_Allocate                                      [c:\program files (x86)\microsoft visual studio 14.0\vc\include\xmemory0:83]
# 2 std::allocator<>::allocate                          [c:\program files (x86)\microsoft visual studio 14.0\vc\include\xmemory0:725]
# 3 std::_Wrap_alloc<>::allocate                        [c:\program files (x86)\microsoft visual studio 14.0\vc\include\xmemory0:976]
# 4 std::_String_alloc<>::_Alloc_proxy                  [c:\program files (x86)\microsoft visual studio 14.0\vc\include\xstring:649]
# 5 std::_String_alloc<>::_String_alloc<>               [c:\program files (x86)\microsoft visual studio 14.0\vc\include\xstring:614]
# 6 std::basic_string<>::basic_string<>                 [c:\program files (x86)\microsoft visual studio 14.0\vc\include\xstring:835]
# 7 sound_ids::sound_ids                                [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\sound_desc.cc:35]
# 8 sound_desc_t::get_sound_id                          [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\sound_desc.cc:107]
# 9 sound_desc_t::init                                  [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\sound_desc.cc:84]
#10 simu_main                                           [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simmain.cc:990]
#11 sysmain                                             [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys.cc:825]

Error #12: LEAK 13 direct bytes 0x028ab5f0-0x028ab5fd + 0 indirect bytes
# 0 replace_malloc                              [d:\drmemory_package\common\alloc_replace.c:2576]
# 1 xmalloc                                     [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simmem.cc:156]
# 2 translator::init_custom_names               [c:\users\james\documents\development\simutrans\simutrans-extended-sources\dataobj\translator.cc:351]
# 3 translator::set_language                    [c:\users\james\documents\development\simutrans\simutrans-extended-sources\dataobj\translator.cc:629]
# 4 translator::set_language                    [c:\users\james\documents\development\simutrans\simutrans-extended-sources\dataobj\translator.cc:657]
# 5 simu_main                                   [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simmain.cc:1019]
# 6 sysmain                                     [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys.cc:825]
# 7 WinMain                                     [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys_w.cc:1022]

Error #13: POSSIBLE LEAK 25 direct bytes 0x028b3b88-0x028b3ba1 + 0 indirect bytes
# 0 replace_malloc                              [d:\drmemory_package\common\alloc_replace.c:2576]
# 1 xmalloc                                     [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simmem.cc:156]
# 2 translator::init_custom_names               [c:\users\james\documents\development\simutrans\simutrans-extended-sources\dataobj\translator.cc:351]
# 3 translator::set_language                    [c:\users\james\documents\development\simutrans\simutrans-extended-sources\dataobj\translator.cc:629]
# 4 translator::set_language                    [c:\users\james\documents\development\simutrans\simutrans-extended-sources\dataobj\translator.cc:657]
# 5 simu_main                                   [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simmain.cc:1019]
# 6 sysmain                                     [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys.cc:825]
# 7 WinMain                                     [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys_w.cc:1022]

Error #14: LEAK 3 direct bytes 0x028b5b88-0x028b5b8b + 0 indirect bytes
# 0 replace_malloc                     [d:\drmemory_package\common\alloc_replace.c:2576]
# 1 _strdup_dbg                        [d:\th\minkernel\crts\ucrt\src\appcrt\string\strdup.cpp:51]
# 2 _strdup                            [d:\th\minkernel\crts\ucrt\src\appcrt\string\strdup.cpp:23]
# 3 loadsave_t::rdwr_str               [c:\users\james\documents\development\simutrans\simutrans-extended-sources\dataobj\loadsave.cc:1111]
# 4 env_t::rdwr                        [c:\users\james\documents\development\simutrans\simutrans-extended-sources\dataobj\environment.cc:362]
# 5 simu_main                          [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simmain.cc:680]
# 6 sysmain                            [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys.cc:825]
# 7 WinMain                            [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys_w.cc:1022]

Error #15: LEAK 16 direct bytes 0x028bda78-0x028bda88 + 96 indirect bytes
# 0 replace_operator_new                  [d:\drmemory_package\common\alloc_replace.c:2899]
# 1 stadt_t::cityrules_init               [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simcity.cc:804]
# 2 simu_main                             [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simmain.cc:1028]
# 3 sysmain                               [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys.cc:825]
# 4 WinMain                               [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys_w.cc:1022]

Error #16: POSSIBLE LEAK 21 direct bytes 0x028bf490-0x028bf4a5 + 0 indirect bytes
# 0 replace_malloc                              [d:\drmemory_package\common\alloc_replace.c:2576]
# 1 xmalloc                                     [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simmem.cc:156]
# 2 translator::init_custom_names               [c:\users\james\documents\development\simutrans\simutrans-extended-sources\dataobj\translator.cc:393]
# 3 translator::set_language                    [c:\users\james\documents\development\simutrans\simutrans-extended-sources\dataobj\translator.cc:629]
# 4 translator::set_language                    [c:\users\james\documents\development\simutrans\simutrans-extended-sources\dataobj\translator.cc:657]
# 5 simu_main                                   [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simmain.cc:1019]
# 6 sysmain                                     [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys.cc:825]
# 7 WinMain                                     [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys_w.cc:1022]

Error #17: LEAK 0 direct bytes 0x028d0248-0x028d0248 + 0 indirect bytes
# 0 replace_operator_new_array               [d:\drmemory_package\common\alloc_replace.c:2928]
# 1 image_t::alloc                           [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\image.h:64]
# 2 image_reader_t::read_node                [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\image_reader.cc:94]
# 3 obj_reader_t::read_nodes                 [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\obj_reader.cc:235]
# 4 obj_reader_t::read_nodes                 [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\obj_reader.cc:239]
# 5 obj_reader_t::read_nodes                 [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\obj_reader.cc:239]
# 6 obj_reader_t::read_nodes                 [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\obj_reader.cc:239]
# 7 obj_reader_t::read_nodes                 [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\obj_reader.cc:239]
# 8 obj_reader_t::read_nodes                 [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\obj_reader.cc:239]
# 9 obj_reader_t::read_file                  [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\obj_reader.cc:195]
#10 obj_reader_t::load                       [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\obj_reader.cc:147]
#11 simu_main                                [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simmain.cc:1044]

Error #18: LEAK 78 direct bytes 0x028d86d0-0x028d871e + 0 indirect bytes
# 0 replace_malloc                               [d:\drmemory_package\common\alloc_replace.c:2576]
# 1 xmalloc                                      [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simmem.cc:156]
# 2 recode                                       [c:\users\james\documents\development\simutrans\simutrans-extended-sources\dataobj\translator.cc:142]
# 3 load_language_file_body                      [c:\users\james\documents\development\simutrans\simutrans-extended-sources\dataobj\translator.cc:428]
# 4 translator::load_language_file               [c:\users\james\documents\development\simutrans\simutrans-extended-sources\dataobj\translator.cc:473]
# 5 translator::load                             [c:\users\james\documents\development\simutrans\simutrans-extended-sources\dataobj\translator.cc:540]
# 6 simu_main                                    [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simmain.cc:997]
# 7 sysmain                                      [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys.cc:825]
# 8 WinMain                                      [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys_w.cc:1022]

Error #19: LEAK 0 direct bytes 0x028db5a8-0x028db5a8 + 0 indirect bytes
# 0 replace_operator_new_array               [d:\drmemory_package\common\alloc_replace.c:2928]
# 1 image_t::alloc                           [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\image.h:64]
# 2 image_reader_t::read_node                [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\image_reader.cc:94]
# 3 obj_reader_t::read_nodes                 [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\obj_reader.cc:235]
# 4 obj_reader_t::read_nodes                 [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\obj_reader.cc:239]
# 5 obj_reader_t::read_nodes                 [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\obj_reader.cc:239]
# 6 obj_reader_t::read_nodes                 [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\obj_reader.cc:239]
# 7 obj_reader_t::read_file                  [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\obj_reader.cc:195]
# 8 gui_theme_t::themes_init                 [c:\users\james\documents\development\simutrans\simutrans-extended-sources\gui\gui_theme.cc:390]
# 9 simu_main                                [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simmain.cc:787]
#10 sysmain                                  [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys.cc:825]
#11 WinMain                                  [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys_w.cc:1022]

Error #20: LEAK 132 direct bytes 0x028e90f8-0x028e917c + 0 indirect bytes
# 0 replace_malloc                               [d:\drmemory_package\common\alloc_replace.c:2576]
# 1 xmalloc                                      [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simmem.cc:156]
# 2 recode                                       [c:\users\james\documents\development\simutrans\simutrans-extended-sources\dataobj\translator.cc:139]
# 3 load_language_file_body                      [c:\users\james\documents\development\simutrans\simutrans-extended-sources\dataobj\translator.cc:429]
# 4 translator::load_language_file               [c:\users\james\documents\development\simutrans\simutrans-extended-sources\dataobj\translator.cc:473]
# 5 translator::load                             [c:\users\james\documents\development\simutrans\simutrans-extended-sources\dataobj\translator.cc:540]
# 6 simu_main                                    [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simmain.cc:997]
# 7 sysmain                                      [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys.cc:825]
# 8 WinMain                                      [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys_w.cc:1022]

Error #21: LEAK 16 direct bytes 0x028fc660-0x028fc670 + 1528 indirect bytes
# 0 replace_operator_new                   [d:\drmemory_package\common\alloc_replace.c:2899]
# 1 obj_desc_t::operator new               [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\obj_desc.h:29]
# 2 tile_reader_t::read_node               [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\building_reader.cc:28]
# 3 obj_reader_t::read_nodes               [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\obj_reader.cc:235]
# 4 obj_reader_t::read_nodes               [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\obj_reader.cc:239]
# 5 obj_reader_t::read_nodes               [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\obj_reader.cc:239]
# 6 obj_reader_t::read_file                [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\obj_reader.cc:195]
# 7 obj_reader_t::load                     [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\obj_reader.cc:147]
# 8 simu_main                              [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simmain.cc:1044]
# 9 sysmain                                [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys.cc:825]
#10 WinMain                                [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys_w.cc:1022]

Error #22: LEAK 8 direct bytes 0x028fd080-0x028fd088 + 4 indirect bytes
# 0 replace_operator_new                          [d:\drmemory_package\common\alloc_replace.c:2899]
# 1 obj_desc_t::operator new                      [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\obj_desc.h:29]
# 2 imagelist2d_reader_t::read_node               [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\imagelist2d_reader.cc:14]
# 3 obj_reader_t::read_nodes                      [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\obj_reader.cc:235]
# 4 obj_reader_t::read_nodes                      [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\obj_reader.cc:239]
# 5 obj_reader_t::read_nodes                      [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\obj_reader.cc:239]
# 6 obj_reader_t::read_nodes                      [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\obj_reader.cc:239]
# 7 obj_reader_t::read_file                       [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\obj_reader.cc:195]
# 8 obj_reader_t::load                            [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\obj_reader.cc:147]
# 9 simu_main                                     [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simmain.cc:1044]
#10 sysmain                                       [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys.cc:825]
#11 WinMain                                       [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys_w.cc:1022]

Error #23: POSSIBLE LEAK 28 direct bytes 0x0290aa70-0x0290aa8c + 6568 indirect bytes
# 0 replace_operator_new                              [d:\drmemory_package\common\alloc_replace.c:2899]
# 1 obj_desc_t::operator new                          [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\obj_desc.h:29]
# 2 image_t::copy_image                               [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\image.cc:307]
# 3 image_t::copy_rotate                              [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\image.cc:348]
# 4 create_alpha_tile                                 [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\ground_desc.cc:278]
# 5 ground_desc_t::init_ground_textures               [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\ground_desc.cc:982]
# 6 karte_t::karte_t                                  [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simworld.cc:2890]
# 7 simu_main                                         [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simmain.cc:1191]
# 8 sysmain                                           [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys.cc:825]
# 9 WinMain                                           [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys_w.cc:1022]

Error #24: LEAK 8 direct bytes 0x0290d340-0x0290d348 + 5172 indirect bytes
# 0 replace_operator_new                        [d:\drmemory_package\common\alloc_replace.c:2899]
# 1 obj_desc_t::operator new                    [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\obj_desc.h:29]
# 2 imagelist_reader_t::read_node               [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\imagelist_reader.cc:14]
# 3 obj_reader_t::read_nodes                    [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\obj_reader.cc:235]
# 4 obj_reader_t::read_nodes                    [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\obj_reader.cc:239]
# 5 obj_reader_t::read_nodes                    [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\obj_reader.cc:239]
# 6 obj_reader_t::read_nodes                    [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\obj_reader.cc:239]
# 7 obj_reader_t::read_file                     [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\obj_reader.cc:195]
# 8 obj_reader_t::load                          [c:\users\james\documents\development\simutrans\simutrans-extended-sources\descriptor\reader\obj_reader.cc:147]
# 9 simu_main                                   [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simmain.cc:1044]
#10 sysmain                                     [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys.cc:825]
#11 WinMain                                     [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys_w.cc:1022]

Error #25: POSSIBLE LEAK 52 direct bytes 0x029105b8-0x029105ec + 4128 indirect bytes
# 0 replace_RtlAllocateHeap                   [d:\drmemory_package\common\alloc_replace.c:3770]
# 1 KERNELBASE.dll!FindCloseChangeNotification+0x39     (0x7636a324 <KERNELBASE.dll+0x1a324>)
# 2 KERNELBASE.dll!FindFirstFileExW          +0x531    (0x7636ab95 <KERNELBASE.dll+0x1ab95>)
# 3 common_find_first_wide<>                  [d:\th\minkernel\crts\ucrt\src\appcrt\filesystem\findfile.cpp:128]
# 4 _wfindfirst64i32                          [d:\th\minkernel\crts\ucrt\src\appcrt\filesystem\findfile.cpp:229]
# 5 searchfolder_t::search_path               [c:\users\james\documents\development\simutrans\simutrans-extended-sources\utils\searchfolder.cc:105]
# 6 searchfolder_t::search                    [c:\users\james\documents\development\simutrans\simutrans-extended-sources\utils\searchfolder.cc:62]
# 7 savegame_frame_t::fill_list               [c:\users\james\documents\development\simutrans\simutrans-extended-sources\gui\savegame_frame.cc:262]
# 8 pakselector_t::fill_list                  [c:\users\james\documents\development\simutrans\simutrans-extended-sources\gui\pakselector.cc:111]
# 9 ask_objfilename                           [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simmain.cc:326]
#10 simu_main                                 [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simmain.cc:874]
#11 sysmain                                   [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys.cc:825]

Error #26: LEAK 32 direct bytes 0x02927e90-0x02927eb0 + 0 indirect bytes
# 0 replace_malloc                              [d:\drmemory_package\common\alloc_replace.c:2576]
# 1 xmalloc                                     [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simmem.cc:156]
# 2 recode                                      [c:\users\james\documents\development\simutrans\simutrans-extended-sources\dataobj\translator.cc:139]
# 3 translator::load_custom_list                [c:\users\james\documents\development\simutrans\simutrans-extended-sources\dataobj\translator.cc:256]
# 4 translator::init_custom_names               [c:\users\james\documents\development\simutrans\simutrans-extended-sources\dataobj\translator.cc:284]
# 5 translator::set_language                    [c:\users\james\documents\development\simutrans\simutrans-extended-sources\dataobj\translator.cc:629]
# 6 translator::set_language                    [c:\users\james\documents\development\simutrans\simutrans-extended-sources\dataobj\translator.cc:657]
# 7 simu_main                                   [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simmain.cc:1019]
# 8 sysmain                                     [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys.cc:825]
# 9 WinMain                                     [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys_w.cc:1022]

Error #27: LEAK 16 direct bytes 0x02928a38-0x02928a48 + 24 indirect bytes
# 0 replace_operator_new                  [d:\drmemory_package\common\alloc_replace.c:2899]
# 1 stadt_t::cityrules_init               [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simcity.cc:754]
# 2 simu_main                             [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simmain.cc:1028]
# 3 sysmain                               [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys.cc:825]
# 4 WinMain                               [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys_w.cc:1022]

Error #28: POSSIBLE LEAK 52 direct bytes 0x02929af0-0x02929b24 + 4128 indirect bytes
# 0 replace_RtlAllocateHeap                          [d:\drmemory_package\common\alloc_replace.c:3770]
# 1 KERNELBASE.dll!FindCloseChangeNotification      +0x39     (0x7636a324 <KERNELBASE.dll+0x1a324>)
# 2 KERNELBASE.dll!FindFirstFileExW                 +0x531    (0x7636ab95 <KERNELBASE.dll+0x1ab95>)
# 3 common_find_first_wide<>                         [d:\th\minkernel\crts\ucrt\src\appcrt\filesystem\findfile.cpp:128]
# 4 _wfindfirst64i32                                 [d:\th\minkernel\crts\ucrt\src\appcrt\filesystem\findfile.cpp:229]
# 5 searchfolder_t::search_path                      [c:\users\james\documents\development\simutrans\simutrans-extended-sources\utils\searchfolder.cc:105]
# 6 searchfolder_t::search                           [c:\users\james\documents\development\simutrans\simutrans-extended-sources\utils\searchfolder.cc:62]
# 7 translator::load_files_from_folder               [c:\users\james\documents\development\simutrans\simutrans-extended-sources\dataobj\translator.cc:491]
# 8 translator::load                                 [c:\users\james\documents\development\simutrans\simutrans-extended-sources\dataobj\translator.cc:559]
# 9 simu_main                                        [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simmain.cc:997]
#10 sysmain                                          [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys.cc:825]
#11 WinMain                                          [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simsys_w.cc:1022]

Error #29: LEAK 52 direct bytes 0x0292aa50-0x0292aa84 + 4128 indirect bytes
# 0 replace_RtlAllocateHeap                   [d:\drmemory_package\common\alloc_replace.c:3770]
# 1 KERNELBASE.dll!FindCloseChangeNotification+0x39     (0x7636a324 <KERNELBASE.dll+0x1a324>)
# 2 KERNELBASE.dll!FindFirstFileExW          +0x531    (0x7636ab95 <KERNELBASE.dll+0x1ab95>)
# 3 common_find_first_wide<>                  [d:\th\minkernel\crts\ucrt\src\appcrt\filesystem\findfile.cpp:128]
# 4 _wfindfirst64i32                          [d:\th\minkernel\crts\ucrt\src\appcrt\filesystem\findfile.cpp:229]
# 5 searchfolder_t::search_path               [c:\users\james\documents\development\simutrans\simutrans-extended-sources\utils\searchfolder.cc:105]
# 6 searchfolder_t::search                    [c:\users\james\documents\development\simutrans\simutrans-extended-sources\utils\searchfolder.cc:62]
# 7 translator::load                          [c:\users\james\documents\development\simutrans\simutrans-extended-sources\dataobj\translator.cc:529]
# 8 simu_main                                 [c:\users\james\documents\development\simutrans\simutrans-extended-sources\simmain.cc:997]
# 9 sysmain              &nb
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.

Offline O01eg

Re: [Bug] global-buffer-overflow in simgraph16.cc
« Reply #9 on: April 03, 2017, 07:16:03 PM »
I got the same error with Standard version rev d53a6714d3e163513af00505c8e5206f8ed2035a at master branch.

Offline O01eg

Re: [Bug] global-buffer-overflow in simgraph16.cc
« Reply #10 on: April 05, 2017, 05:18:38 AM »
Thank you - that is very helpful. In the meantime, I will try to see whether I can reproduce this with Dr. Memory.

Edit: I cannot find anything significant running a Visual Studio debug build with Dr. Memory:

I can suppose Dr. Memory cann't find UNADDRESSABLE ACCESS in global memory only stack or heap.

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 15698
  • Total likes: 395
  • Helpful: 174
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [Bug] global-buffer-overflow in simgraph16.cc
« Reply #11 on: April 05, 2017, 11:32:07 PM »
Thank you for checking that: that is most helpful. I will move this to the Standard bug reports section, since it can be reproduced in Standard and is not code that I have written or understand.
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.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4812
  • Total likes: 191
  • Helpful: 108
  • Languages: EN, NO
Re: [Bug] global-buffer-overflow in simgraph16.cc
« Reply #12 on: April 06, 2017, 05:27:13 AM »
simgraph16.cc line 1918 doesn't contain code that should be able to crash, unless it is a compiler bug. If you are running an older version that r8184, please state which version. Although it would be better if the error was reported on r8184 or newer.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4247
  • Total likes: 175
  • Helpful: 149
  • Languages: EN, DE, AT
Re: [Bug] global-buffer-overflow in simgraph16.cc
« Reply #13 on: April 06, 2017, 06:23:29 AM »
there was indeed an out-of bound read in line 1955 with player_day = 0xff. should be fixed in r8189.

thanks for the report
Parsley, sage, rosemary, and maggikraut.

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 15698
  • Total likes: 395
  • Helpful: 174
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [Bug] global-buffer-overflow in simgraph16.cc
« Reply #14 on: April 06, 2017, 11:55:49 AM »
Splendid - now also incorporated into Extended where this was originally 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.