The International Simutrans Forum

 

Author Topic: 120.2.2/r8163 Win8.1 pak128.DT 2.7 - Crash on using "map overview"  (Read 2481 times)

0 Members and 1 Guest are viewing this topic.

Offline Kobalt

  • *
  • Posts: 13
Hi there,

on using the "map overview" (not sure if correct term: German version: Reliefkarte), the game crashed (online game) on resizing [usually it doesn't]. see screenshot. The server is still running, seems the client crashed solely.

Best regards,
Kobalt


Offline TurfIt

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 1297
Re: 120.2.2/r8163 Win8.1 pak128.DT 2.7 - Crash on using "map overview"
« Reply #1 on: February 05, 2018, 08:41:34 PM »
Screenshot is truncated, but that looks like the out of memory error. How big is the map you're playing on?  Simutrans doesn't prevent you from playing on a 'too big' map, but will run out of memory if trying huge maps.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4460
  • Languages: EN, DE, AT
Re: 120.2.2/r8163 Win8.1 pak128.DT 2.7 - Crash on using "map overview"
« Reply #2 on: February 06, 2018, 12:32:30 PM »
What window did you resize?

What is the size of the game map in tiles?

Offline Kobalt

  • *
  • Posts: 13
Re: 120.2.2/r8163 Win8.1 pak128.DT 2.7 - Crash on using "map overview"
« Reply #3 on: February 06, 2018, 12:45:15 PM »
Screenshot is truncated, but that looks like the out of memory error. How big is the map you're playing on?  Simutrans doesn't prevent you from playing on a 'too big' map, but will run out of memory if trying huge maps.

The truncation of the screenshot was necessary because of 64kB file size limit of the forum. The truncation of the error msg. within the "map overview" window couldn't be prevented since the game window was frozen at that point.

The map size: 1024x1024.

What window did you resize?

What is the size of the game map in tiles?

The "map overview" window has been resized by me when this error occured.

The map size is: 1024x1024.

Offline TurfIt

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 1297
Re: 120.2.2/r8163 Win8.1 pak128.DT 2.7 - Crash on using "map overview"
« Reply #4 on: February 06, 2018, 09:30:42 PM »
1024x1024 isn't huge - should require ~600MB or so with pak128. As long as your computer has that (plus enough extra for win8 bloat)...

If the out of memory is repeatable, I suggest uploading the savegame, and pak128.DT since that doesn't appear to exist anywhere whatever it might be.

Offline Isaac.Eiland-Hall us

  • Benevolent Dictator
  • Administrator
  • *
  • Posts: 3576
  • PanamaCityPC.com/support/
    • Facebook Profile
  • Languages: EN
Re: 120.2.2/r8163 Win8.1 pak128.DT 2.7 - Crash on using "map overview"
« Reply #5 on: February 07, 2018, 02:57:18 AM »
If space is needed to upload somewhere via ftp, lemme know and I can create space. However, anything from Dropbox to Google Drive to OneDrive or others also exist, too, so whatever's easier.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2466
  • Languages: EN
Re: 120.2.2/r8163 Win8.1 pak128.DT 2.7 - Crash on using "map overview"
« Reply #6 on: February 07, 2018, 03:43:35 AM »
An infinite allocation loop can also cause an out of memory error because the application tries to allocate small amounts of space on the heap infinitely. If it tries to allocate small amounts of space infinitly on the stack that causes a stack overflow error.
« Last Edit: February 07, 2018, 04:01:21 AM by DrSuperGood »

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5275
  • Languages: EN, NO
Re: 120.2.2/r8163 Win8.1 pak128.DT 2.7 - Crash on using "map overview"
« Reply #7 on: February 07, 2018, 06:46:55 AM »
An infinite allocation loop can also cause an out of memory error because the application tries to allocate small amounts of space on the heap infinitely. If it tries to allocate small amounts of space infinitly on the stack that causes a stack overflow error.

I think the stack can be ruled out, because I don't think sim_new_handler, or new_handlers in general, deals with stack allocations.

For the former case, it should be possible to tell if it is a lot of small allocations in a loop or one big one by how long time it takes. When I've had runaway allocations, the application usually hangs for a while. A single massive allocation stops right away. However, there is a gray zone of lesser number of medium sized allocations between these extremes. So how quickly did the game die?

Although the failure seems GUI related, given that it apparently was triggered by a window resize, we have seen some out-of-memory errors due to corrupted save games misleading Simutrans to try to allocate an array for millions or even billions of whatever. Since this appears to be during a networked game, maybe some communication problem is incorrectly handled, leading to an attempt to interpret uninitialized data as a number of elements to allocate memory for. It just happened to coincide with something unrelated the user did.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4460
  • Languages: EN, DE, AT
Re: 120.2.2/r8163 Win8.1 pak128.DT 2.7 - Crash on using "map overview"
« Reply #8 on: February 07, 2018, 07:30:47 AM »
The map window may indeed be the problem here. It stores an array containing all visible pixels of the map, not one pixel per tile.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9200
  • Languages: De,EN,JP
Re: 120.2.2/r8163 Win8.1 pak128.DT 2.7 - Crash on using "map overview"
« Reply #9 on: February 07, 2018, 02:07:35 PM »
This very often happens if -1 is passed as new size ...

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2466
  • Languages: EN
Re: 120.2.2/r8163 Win8.1 pak128.DT 2.7 - Crash on using "map overview"
« Reply #10 on: February 07, 2018, 10:37:18 PM »
Quote
When I've had runaway allocations, the application usually hangs for a while.
In games like Warcraft III it will hang for ~1-2 seconds then crash with OOM. Modern processors are so fast that even allocating a few bytes at a time in a reasonably tight loop can cause application memory footprint to increase by gigabytes per second. How long it hangs really depends on how tight the allocation loop is.
Quote
It stores an array containing all visible pixels of the map, not one pixel per tile.
I am a bit confused by what you mean here. Are you trying to say it stores the entire mini-map in memory even if only a small part of it is visible?

The experimental server game is absolutely massive and I use the mini-map all the time. That said it was more prone for an OOM error when running the x86 build with the mini-map open but that is what happens when the server game takes >3GB in memory to run.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9200
  • Languages: De,EN,JP
Re: 120.2.2/r8163 Win8.1 pak128.DT 2.7 - Crash on using "map overview"
« Reply #11 on: February 07, 2018, 11:57:18 PM »
The minimap contains the entire map (when open).

I am a little surprised a 3 GB memory consumption works at all with a 32 bit build, since windows 32 bit cannot allocate more than 2 GB per program according to documentation ...

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5275
  • Languages: EN, NO
Re: 120.2.2/r8163 Win8.1 pak128.DT 2.7 - Crash on using "map overview"
« Reply #12 on: February 08, 2018, 06:20:29 AM »
In games like Warcraft III it will hang for ~1-2 seconds then crash with OOM.

That is "a while" in computer terms.

I am a little surprised a 3 GB memory consumption works at all with a 32 bit build, since windows 32 bit cannot allocate more than 2 GB per program according to documentation ...

We enabled large memory awareness to Simutrans a while back, remember. Revision 7425. Such 32-bit process can use (just under) 3 GiB of user-space memory on 32-bit Windows with large address support (I don't think home editions ever got that, but I'm not sure) and on 64-bit Windows.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9200
  • Languages: De,EN,JP
Re: 120.2.2/r8163 Win8.1 pak128.DT 2.7 - Crash on using "map overview"
« Reply #13 on: February 08, 2018, 12:50:06 PM »
Ok, thank you. Must have remember the home edition limit then.

Back to the problem at hand, I would suspect somewhat a negative uint is to blame there.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2466
  • Languages: EN
Re: 120.2.2/r8163 Win8.1 pak128.DT 2.7 - Crash on using "map overview"
« Reply #14 on: February 08, 2018, 09:20:30 PM »
Quote
I am a little surprised a 3 GB memory consumption works at all with a 32 bit build, since windows 32 bit cannot allocate more than 2 GB per program according to documentation ...
One can build applications in some kind of extra addressing mode. In such case it will not cap memory at 2GB but rather at whatever the OS allows. On actual x86 OSes it will limit to 2GB. However on modern (not XP) x86-64 OSes it can get up to like 3.5 GB as the OS only reserves 500 MB odd.

Still x86-64 is the way to go. A lot of game companies only target that now.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9200
  • Languages: De,EN,JP
Re: 120.2.2/r8163 Win8.1 pak128.DT 2.7 - Crash on using "map overview"
« Reply #15 on: February 09, 2018, 02:11:44 AM »
But a lot of servers and hardware are still running 32 bit OS. Especially lower end hardware though, but that is no problem for Simutrans.

These were still sold with WIndows 10 32 bit in 2016 (still own one such tablet). Also some search on the net suggest 10-15% still use 32 bit Windows systems.