The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: Isaac Eiland-Hall on April 11, 2009, 05:19:00 am

Title: FATAL ERROR: sim_new_handler
Post by: Isaac Eiland-Hall on April 11, 2009, 05:19:00 am
Error:

Quote
FATAL ERROR: sim_new_handler
OUT OF MEMORY
PRESS ANY KEY

Steps:
1. 102.0 with pak128
2. Create 64x32766 game
3. Open map
4. Click to zoom
5. Receive error

:D

(I think it took something like 12-15 mins to generate the game; it took a full minute to save it...)
Title: Re: FATAL ERROR: sim_new_handler
Post by: jamespetts on April 11, 2009, 10:02:54 am
That is a somewhat misleading error message, in that it does not necessarily mean that the system is out of physical and/or virtual memory. That is one possible cause of the error, but the error will be thrown whenever the allocation of further memory via the "new" keyword fails. That can also happen as a result of a bug either in the code calling the new object, or in the constructor code for the object itself (or in code to which the constructor code refers, or in code to which that code refers, and so on).

However, in your case, since you created such an enormous map, it seems likely that the reason for the error is that you really were out of memory. If that is so, that would not be a bug in the code, but simply an expression of the hardware limitations of your computer. Out of interest, how much physical RAM do you have?
Title: Re: FATAL ERROR: sim_new_handler
Post by: Isaac Eiland-Hall on April 11, 2009, 04:51:11 pm
As it happens, I was curious to see what it was using. That installation uses about 50MB of RAM (102 + paak128 + few extra paks), and the map claimed to be iirc 198MB; sure enough, I checked and it was around 250MB after loading the map. :)

I have 2GB.

However, note that the map itself loaded - but here was have another problem like the word "pak", which can refer to a file.pak, one or more additional objects (q.v. addons.simutrans.com), or an entire playable set. In the same way, "map" can refer to a playable game, or a window with the locations of things. Just to make sure I'm clear, it is the latter that caused the problem. Opening the map with that 'game' loaded worked fine, and I could scroll around, but as soon as I clicked to zoom in, I got the crash.
Title: Re: FATAL ERROR: sim_new_handler
Post by: jamespetts on April 11, 2009, 05:20:25 pm
Hmm - odd.
Title: Re: FATAL ERROR: sim_new_handler
Post by: prissi on April 11, 2009, 07:52:14 pm
How do you create a 64x32767 game? The maximum number allowed (which will be enforced is 32766). And this does not crash.

EDIT: minimap zoom out. Well, this is not solvable, as the maximum coordinates are 16 Bit within the game ... But the map window should disallow zooming in then of course.
Title: Re: FATAL ERROR: sim_new_handler
Post by: Isaac Eiland-Hall on April 12, 2009, 05:39:10 am
typo, of course, sorry. 64x32766 :)

EDIT: Actually, I'd written "32667", which would be possible, but it was 32766 :) )