The International Simutrans Forum

 

Author Topic: [r8387] Map size 20480x32: OutOfMemory error when opening city window  (Read 632 times)

0 Members and 1 Guest are viewing this topic.

Offline Antarctica

  • *
  • Posts: 27
  • Languages: DE, EN
I generate map:


I click town hall:

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4564
  • Languages: EN, DE, AT
This bug should be fixed in r8455.

Offline Antarctica

  • *
  • Posts: 27
  • Languages: DE, EN
It is still/again there in 8460. The error message does not occur, but the game closes nevertheless.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4564
  • Languages: EN, DE, AT
Can you be more specific? What do you do to crash the program? The city window works for me.

Offline Antarctica

  • *
  • Posts: 27
  • Languages: DE, EN
I have found that city windows of cities below a certain coordinate work, above it, crash, I think it's the magic number 16384.

x = 3900 works
x = 7700 works
x = 11600 works
x = 14800 works
x = 16800 crashes

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4564
  • Languages: EN, DE, AT
I cannot reproduce this with the current version. Do you really have a current nightly running?

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2617
  • Languages: EN
How much RAM and what OS does your computer have? Out of Memory can be thrown if it really is out of memory.

Offline Antarctica

  • *
  • Posts: 27
  • Languages: DE, EN
My computer has 16 GB memory, of which Simutrans uses 71 MB (according to task manager) before closing unexpectedly.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5454
  • Languages: EN, NO
If memory consumption goes from 71 MB instantly to crashing, then Simutrans must be attempting one very large memory allocation.

I have a hard time figuring out what the values for space in city_info_t::resize can be in practice, but if there is no space, it appears that the values for minimaps_size will become bad (negative).

Offline Antarctica

  • *
  • Posts: 27
  • Languages: DE, EN
Fixed in r8461, maybe as a side effect of the fix of the other bug I reported the same day. ([r8460] Auto-names of stops with coordinate > 16384)
That would explain why dwachs couldn't reproduce - he already had r8461 on his machine.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5454
  • Languages: EN, NO
I missed the fact that the error message didn't happen after r8460. That makes it a different bug. Probably an access violation caused by the invalid coordinate calculation fixed in r8461.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4564
  • Languages: EN, DE, AT
Yes, there was indeed another bug, which was fixed in r8461: city->get_center() produced negative coordinates due to signed integer overflow: old code was (lo+ur)/2, changing this to lo/2 + ur/2 fixed it, as no overflow occurs anymore.