The International Simutrans Forum


Author Topic: r2020 - Crash when loading specific height map because of msvcrt.dll error  (Read 3406 times)

0 Members and 1 Guest are viewing this topic.

Offline z9999

  • Devotees (Inactive)
  • *
  • Posts: 848
simutrans r2020 GDI,SDL_Windows

When I loading specific height map, simutrans crash.
This problem happened with self compiled version, nighly SDL and nightly GDI.

This specific file is "" on .
But I don't know you can reproduce this problem or not.

Message: grund_besch_t::calc_water_level():   image_offset=5712
Message: karte_t::init():   init_felder
Message: simlinemgmt_t::init_line_ids():   done
Message: reliefkarte_t::setze_welt():   welt size 1496,1624
Message: karte_t::init():   setze_grid_hgt

simutrans-.exe caused an Access Violation at location 77bf7631 in module msvcrt.dll Writing to location 08b82000.

eax=00000000 ebx=05b2dd20 ecx=0000c798 edx=00000000 esi=00160000 edi=08b82000
eip=77bf7631 esp=0023f098 ebp=0023f298 iopl=0         nv up ei pl nz ac po nc
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00000216

Call stack:
77BF7631  msvcrt.dll:77BF7631  memset
0056D5C0  simutrans-.exe:0056D5C0  karte_t::load_heightfield(einstellungen_t*)
   // create map
>   init(sets,h_field);
   delete [] h_field;

005950D3  simutrans-.exe:005950D3  WinMain
00401247  simutrans-.exe:00401247
00401298  simutrans-.exe:00401298
7C817067  kernel32.dll:7C817067  RegisterWaitForInputIdle

Offline z9999

  • Devotees (Inactive)
  • *
  • Posts: 848
In r2022.
It still causes to crash at the same line.

When I change code like below, crash problem had been solved.
 (Strangely enough, linux versions of r2022 don't crash. )
   memset( grid_hgts, 0, sizeof(*grid_hgts)*(cached_groesse_gitter_y+1)*(cached_groesse_gitter_y+1) );
   memset( grid_hgts, 0, sizeof(*grid_hgts)*(cached_groesse_gitter_x+1)*(cached_groesse_gitter_y+1) );
« Last Edit: September 15, 2008, 06:36:43 AM by z9999 »

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10826
  • Languages: De,EN,JP
Thank you.

Offline z9999

  • Devotees (Inactive)
  • *
  • Posts: 848
Solved in r2029. Thank you.