Game crashes at specific point - bad_alloc

So last night as I went to cont on a build. It is day 13 of Deepmun. and the Game crashes as my villagers go eat. I think that could be a coincidence. Anyway. I reload the game and continue on, and right at the same point the game crashes. Okay from this point im kinda frustrated. So I decided to reload today, and it did it again and the same point. Now I dont know why it is crashing. I have no mods on at this time.

So i went to check report, because it not telling me why I’m crashing. anyways here is the tail end of the report

2015-Mar-13 09:07:21.584550 | client | 1 | lua.code | call to __to_json failed: boost::interprocess::bad_alloc
2015-Mar-13 09:07:21.584550 | client | 1 | lua.code | generating traceback…
2015-Mar-13 09:07:21.584550 | client | 1 | lua.code | exception delivering lua trace: boost::interprocess::bad_alloc
2015-Mar-13 09:07:21.584550 | client | 1 | lua.code | exception delivering lua trace: boost::interprocess::bad_alloc
2015-Mar-13 09:07:21.584550 | client | 1 | lua.code | exception delivering lua trace: boost::interprocess::bad_alloc
2015-Mar-13 09:07:21.584550 | client | 1 | lua.code | exception delivering lua trace: boost::interprocess::bad_alloc
2015-Mar-13 09:07:21.584550 | client | 1 | lua.code | exception delivering lua trace: boost::interprocess::bad_alloc
2015-Mar-13 09:07:21.584550 | client | 1 | lua.code | exception delivering lua trace: boost::interprocess::bad_alloc
2015-Mar-13 09:07:21.584550 | client | 1 | lua.code | exception delivering lua trace: boost::interprocess::bad_alloc
2015-Mar-13 09:07:21.584550 | client | 1 | lua.code | exception delivering lua trace: boost::interprocess::bad_alloc
2015-Mar-13 09:07:21.584550 | client | 1 | lua.code | exception delivering lua trace: boost::interprocess::bad_alloc
2015-Mar-13 09:07:21.584550 | client | 1 | lua.code | exception delivering lua trace: boost::interprocess::bad_alloc
2015-Mar-13 09:07:21.584550 | client | 1 | lua.code | exception delivering lua trace: boost::interprocess::bad_alloc
2015-Mar-13 09:07:21.584550 | client | 1 | lua.code | exception delivering lua trace: boost::interprocess::bad_alloc
2015-Mar-13 09:07:21.584550 | client | 1 | lua.code | generating traceback…
2015-Mar-13 09:07:21.584550 | client | 0 | sysinfo | Memory Stats: Fatal Exception
2015-Mar-13 09:07:21.584550 | client | 0 | sysinfo | Total System Memory: 7.983 GB (8571527168 bytes)
2015-Mar-13 09:07:21.584550 | client | 0 | sysinfo | Current Memory Usage: 2.177 GB (2337935360 bytes)
2015-Mar-13 09:07:21.584550 | client | 0 | sysinfo | Total Address Space: 8.000 TB (8796092891136 bytes)
2015-Mar-13 09:07:21.584550 | client | 0 | sysinfo | Available Address Space: 7.997 TB (8792824606720 bytes)
2015-Mar-13 09:07:21.584550 | client | 0 | sysinfo | Used Address Space: 3.044 GB (3268284416 bytes)

Edit: I think, and this is just a theory, the Goblins are trying to show up and it is failing

A GAME THEORY! Thanks for watch-

Hmm, I think I just fainted. I didn’t say anything silly while I was out, did I?

You may have already tried this, but have you tried to go back two or three saves from the crash? Does it still crash at the same time?

Left the room for a min, letting the game just run while I was gone, and came back to this error. Thought I’d post it as I don’t see it shown.

System:
Windows 8.1 Pro
AMD Phenom II x4 965 @ 3.41ghz
16.0 GB DDR3 1600mhz
Dual Radeon 7770HD Graphics Cards
256 Western Digital SSD

thanks for the confirmation @SirAstrix … [tagged]

1 Like

Just got an allocation error on 223 x64bit Intel:

2015-Mar-18 09:26:49.278378 | server | 0 | lua.memory | error in lua allocator attempting to allocate 32 bytes (boost::interprocess::bad_alloc)
2015-Mar-18 09:26:49.278378 | server | 1 | lua.memory | lua shared heap size: 520.594 MB. freelist overhead: 148.530 MB (28.53%). total bytes allocated: 669.123 MB.
2015-Mar-18 09:26:49.278378 | server | 1 | lua.memory | o: outstanding allocs, fl: free list len
2015-Mar-18 09:26:49.278378 | server | 1 | lua.memory | 80 bytes (o:2528383 fl:1830004 72.38%) : ########################################
2015-Mar-18 09:26:49.278378 | server | 1 | lua.memory | 32 bytes (o:2114696 fl: 0 0.00%) : #################################
2015-Mar-18 09:26:49.278378 | server | 1 | lua.memory | 24 bytes (o:1324541 fl: 0 0.00%) : ####################
2015-Mar-18 09:26:49.278378 | server | 1 | lua.memory | 192 bytes (o: 572102 fl: 0 0.00%) : #########
2015-Mar-18 09:26:49.278378 | server | 1 | lua.memory | 20 bytes (o: 312033 fl: 0 0.00%) : ####
2015-Mar-18 09:26:49.278378 | server | 1 | lua.memory | … remaining allocs are each < 5% of the count

Game ran just fine up to this point.

Had 14 Hearthlings, was just gathering and moving stuff into cave system and this error and also the log:
stonehearth.log (307.7 KB)

Updated Steam V240 still crashing to windows with a ( error in lua allocator attempting to allocate 1536 bytes (boost::interprocess::bad_alloc)

Win7 x64
RAM: 16GB

Join the club.

1 Like

Seems to be carrying over from build to build.

Hi guys,

On 240 we added an option to disable the Lua JIT in Settings -> System. Turning OFF the JIT should stop the crashing (yay!), but may make the game slower (boo!). If you get a chance, please try it out. I’d love to hear how it goes for you.

Thanks!

4 Likes

I figured that out on my own last night and it does stop the game from crashing due to not being able to allocate new memory. The problem with this is once you get beyond about the 3 gig of ram that I was crashing at consistently with JIT on it just keeps rising very quickly. I believe at the pace it is accumulating memory you likely have a memory leak somewhere. There is just no reason this game should be using 7+ gig of ram.

I would of posted this sooner but I just was able to finally get my account confirmation email.

2 Likes

hey there @Sean61616 … welcome aboard! :smile:

thanks for registering to provide this feedback! :+1:

I love you TR! Thanks to this new setting I can finally play a load of my worlds that I couldn’t fully complete without crashing :smiley:.

But as stated above there is a big issue regarding the memory, My current world (one huge building) is using close to 3 GB, My other world with like 500 goblins is using almost 5 GB. 4.6 GB currently. So I would suspect either a memory leak or there needs to be major rendering.

But apart from that, This is epic! Finally can use more than 3.5GB (almost ordered more ram thinking I was using 5 GB somewhere) You guys are doing amazing! So glad I found this game. :heart_eyes_cat:

3 Likes

Changing the setting did indeed help and the crashing has stopped.

Edit: Before I changed the setting I was trying to build a custom building when I kept getting errors. After my workers are hard at work. Might it be possible there is a direct correlation between the memory leak and the building UI?

2 Likes

My thoughts as well (after just crashing at around 3.5 gigs). I run InDesign, Illustrator and Cinema 4D all at the same time all day with half a dozen files open and their total comes no where near half what this game is using. The CPU use is also way over the top. 40% is crazy when the above mentioned programs total only a fraction of that.

Probably goes without saying that these memory issues will be addressed as time goes by…

Personally, I’d like to see a setting where you can choose how much ram you can allocate to the program, as I have 16gb total personally, and barely use 3 when I’m idle. As for cpu though, I’ll agree that this is way too “hungry”.

1 Like

Agreed! Will investigate.

1 Like

CPU usage should probably go down once they find out what is allocating all this extra memory. Creating new memory all the time is an intensive operation. Aside from that objects that should of been destroyed (and were the memory leak for another game I’ve seen as well) might still be running like from a particle system. Just imagine the game thinking there are a million extra little firepit particles all trying to do their own little thing still :stuck_out_tongue:

Additonally, depending on how its been implemented you might be able to lower the ram usage by lowering the draw distance, but again I’m unsure how this is working in this game. If the game is streaming in information of the land based on draw distance then that would lower ram usage. Thankfully for this game using a BSP (Binary space partitioning) tree for exactly this is really easy to add given its grid structure.

1 Like

True. I have other problems unfortunately. I’m basically shut out of running the game because 64bit won’t run on my AMD rig and 32bit AMD is so unstable as to be unplayable. I run it very occasionally on another machine (the 64bit Intel), but for the most part I can no longer run the game at all. I suppose, for me, I’ll just have to come back in a few weeks (or months) and see if there’s been any progress on 64bit AMD.

I’m curious what you system specs are?