2025-08-13 23:08 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002848Spring engineGeneralpublic2014-02-03 12:56
ReporterBeherith 
Assigned TojK 
PrioritynormalSeveritycrashReproducibilityalways
StatusclosedResolutionsuspended 
Product Version84.0 
Target VersionFixed in Version 
Summary0002848: Large maps (32x32) with many tiles crash with std::bad alloc()
DescriptionI'm testing a 32x32 map, that uses 0 tiling compression (kill me), and it crashes spring when I load it up, after the following place (this is not the last in the stack trace, after this it crashes in vector.resize() ):

spring.exe!IArchive::GetFile(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & name="maps/massive.smt", std::vector<unsigned char,std::allocator<unsigned char> > & buffer=[0]()) Line 60 + 0xf bytes C++

No stack trace is written to infolog, this is the stack from MSVC.

The .smt is 178 megabytes large, here is an upload of the map if needed for testing. (100 megs, im sorry :( )

http://beherith.eat-peet.net/stuff/massive.sd7

Thank you very much!
Additional InformationWin7 x64, 8gb ram (plenty free)
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files

-Relationships
has duplicate 0002869closed std::bad_alloc when loading large maps 
+Relationships

-Notes

~0007955

Kloot (developer)

Last edited: 2011-12-18 18:04

You need a 64-bit build of Spring to (safely) load such maps.

~0007970

hoijui (reporter)

could/should we add some checks in places where we allocate large amounts of memory, to see if the target platform would even be capable of doing it?
or .. i gess even better, catch failed-alloc-exceptions?

~0007973

Kloot (developer)

Last edited: 2011-12-19 21:54

We could, but what would be the point?

pros:
* instead of crashing with an uncaught exception, Spring terminates "cleanly" via log() + exit() (and perhaps a pretty popup)

cons:
* code gets littered with try { ... } catch { ... } constructs
* from a user perspective nothing changes (Spring still occasionally goes *poof* in the middle of loading)
* checks if an allocation could succeed are unreliable without a custom memory pool/manager, so add no protection

~0007974

jK (developer)

We already catch it. It's Beherith that had a MSVC debug build which intentionally don't catch them ...
+Notes

-Issue History
Date Modified Username Field Change
2011-12-18 17:21 Beherith New Issue
2011-12-18 18:04 Kloot Note Added: 0007955
2011-12-18 18:04 Kloot Note Edited: 0007955
2011-12-19 13:01 hoijui Note Added: 0007970
2011-12-19 21:50 Kloot Note Added: 0007973
2011-12-19 21:54 Kloot Note Edited: 0007973
2011-12-19 23:21 jK Note Added: 0007974
2012-01-31 16:08 Kloot Relationship added has duplicate 0002869
2014-02-03 12:56 jK Status new => closed
2014-02-03 12:56 jK Assigned To => jK
2014-02-03 12:56 jK Resolution open => suspended
+Issue History