Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash bug (likely a side-effect of a nearby building burning) #23770

Closed
Maplevalley47 opened this issue May 19, 2018 · 46 comments

Comments

Projects
None yet
10 participants
@Maplevalley47
Copy link

commented May 19, 2018

Game version: cataclysmdda-0.C-7399
Operating system: Windows console
Tiles or curses:
Mods active: More Buildings

Expected behavior

Not crashing (window locks up indefinitely)

Actual behavior

After loading into the game, it will crash randomly after 0 to ~50 turns.

Steps to reproduce the behavior

Load game, and take any action that passes time, while keeping the raging fire to the north inside the reality bubble. Game will crash/lock up either immediately or very soon. Reproduced more than 5 times.

Save folder attached.
NewEngland2018.zip

@Dehaku

This comment has been minimized.

Copy link

commented May 25, 2018

I'm having the same issue, yeah. It makes "Very bad day" starts even harder due to burning building, and the random tank drones out in the field like to spread fire, they're a ticking timebomb.
Not to mention losing the ability to burn down buildings is a pain for survival.
Still happening in 7422 to myself, and my friend who's on another computer. Both windows, graphical.

@Parahacker

This comment has been minimized.

Copy link

commented May 26, 2018

I think this is what's happening to my games. Created a different issue thread before seeing this. I can confirm this is happening still in 7426

@Rob-King-of-the-Plants

This comment has been minimized.

Copy link

commented May 27, 2018

Same thing happend to me: Start very bad day, mods: Dark Day Ahead, Filthy Clothing, Disabled NPC needs, Simplified Nutrition, Makeshift item mod, more survival tools, Boats , Folding Parts pack, Disable Religious Texts and no flaming weapons. It occured in builds 7416, 7423, 7426, 7427 and 7433.

@budg3

This comment has been minimized.

Copy link
Contributor

commented May 27, 2018

Do you guys have NPCs enabled? I've had several crashes when NPCs burn to death and once it even happened when my own player character died in a fire. I can't get it to reproduce consistently though, sometimes it doesn't crash. I suspect it has to do with the buggy item dropping system, but I haven't been able to confirm.

@Rob-King-of-the-Plants

This comment has been minimized.

Copy link

commented May 27, 2018

no, i have no npcs enabled. neither static nor spwaning. and in no instances ofthe crashes did the player character die. in some of them its even questionable if the fire was still in the reality bubble

@budg3

This comment has been minimized.

Copy link
Contributor

commented May 27, 2018

@Rob-King-of-the-Plants
Alright thanks for that info. It seems that the burning crashing is not related to the item dropping crash then. Looking at the comments in #22555 it might be related to the code for destroying items in fires.

Edit:
Worth testing: Setting item, npc and monster spawns to 0 and seeing if the crashes still persist when burning stuff.

@Parahacker

This comment has been minimized.

Copy link

commented May 27, 2018

Hooray! This bug is being looked at!

Between this and the fullscreen crash I just posted, the game has been unplayable. I just picked up the experimental a few days ago, last time I played was about 6 months or so ago and I was worried I wouldn't be able to see what's new. Very glad to see someone picking this one up 🥇 👍

@Parahacker

This comment has been minimized.

Copy link

commented May 27, 2018

@budg3 - would setting item spawn to .01 work? It won't let me go lower than that. I assume you're talking about the worldbuilding settings?

@Rob-King-of-the-Plants

This comment has been minimized.

Copy link

commented May 27, 2018

i put everything regarding spawning to 0 in a fresh install of 7433. with everything else on presets i started a random scenario with an pc who has a matchbook....the rescue shelter still had stuff in it....i took all of it out and burned it down with no problem...then i went to another bulding with stuff in it....burned that down and it crashed

ps
i tought it was on 0 but items reset to 1

@budg3

This comment has been minimized.

Copy link
Contributor

commented May 27, 2018

Just setting it as low as possible so items don't spawn in buildings since it seems to be related to the crash.

@Rob-King-of-the-Plants

This comment has been minimized.

Copy link

commented May 27, 2018

repeated the process i mentioned above with item spawn on 0.1 with the same results : empty building fine, building with items -> crash

@Parahacker

This comment has been minimized.

Copy link

commented May 27, 2018

I tested a Very Bad Day start with lowest-settings spawn and it froze around turn 50... I can't guarantee there wasn't an item in that house though. There was also a Mi-Go that saw me trying to leave and chased me back inside, as well as a chicken walker heading my way from the other direction, so... yeah. Reaaly bad day.

I think Rob-King's tests are more likely useful, since he's controlling if there are items or not better than I am.

Whatever the code's doing that causes this freeze, it's breaking Windows 10 and not just CDDA. I have to CTRL-ALT-DEL, then sign out completely in order to get my desktop working again. It makes testing this a right pain.

@Rob-King-of-the-Plants

This comment has been minimized.

Copy link

commented May 27, 2018

i repeated the test...this time i took all items which were movable with the avanced inventory out of the house because i wanted to test if the items alone cause a crash....before burning the item stack in front of the house i set the house on fire. It crashed with no movable items inside...only furniture. my suspicion is that it crashed when it reached tha bathroom? the rescue shelter i succesfully burned in the previous tests has no toilett and no water in it

@Parahacker

This comment has been minimized.

Copy link

commented May 27, 2018

Hm, good catch. Can you try lighting the bathroom on fire near the toilet and see if it crashes when the toilet gets lit up?

@Parahacker

This comment has been minimized.

Copy link

commented May 27, 2018

I tried the survival shelter start, set a piece of wood on fire and dumped water on it - it didn't crash. Maybe it's specific to the toilet? Or it could be dirty water, I only had clean.

@Rob-King-of-the-Plants

This comment has been minimized.

Copy link

commented May 27, 2018

after i smashed out the toiletts and mopped the water it still crashed...after smashing fridge and oven and removing the parts from the house i could repeatedly burn the house and reload again....then i tried to burn the stack of all the stuff i removed from the house which got me an instant crash

@Parahacker

This comment has been minimized.

Copy link

commented May 27, 2018

Well then. So it's the stuff from the house getting set on fire that does it. That narrows things down.

Setting 2x4's on fire doesn't cause it. Ceramic shards? Faucets? Somewhere in that stack of stuff is the culprit(s).

@Rob-King-of-the-Plants

This comment has been minimized.

Copy link

commented May 27, 2018

positive on copper cables

i removed just copper cables and everything else from the house bruned without crash

@Parahacker

This comment has been minimized.

Copy link

commented May 27, 2018

@Rob-King-of-the-Plants is on the case, wow. @budg3 you getting this?

@Parahacker

This comment has been minimized.

Copy link

commented May 27, 2018

So we know that 2x4's don't crash when set on fire, and we know that copper cables do. I'm looking into the json files to see if I can spot the difference, but my code-fu is not brilliant so don't wait on me.

@budg3

This comment has been minimized.

Copy link
Contributor

commented May 27, 2018

Copper cables are defined as AMMO while 2x4 are defined as GENERIC. Does it have to do with ammo burning up?

@Night-Pryanik

This comment has been minimized.

Copy link
Member

commented May 27, 2018

Why do we consider copper wires as ammo, anyway? They can't be loaded into any tool AFAIK.

@Rob-King-of-the-Plants

This comment has been minimized.

Copy link

commented May 27, 2018

well i burned a grenade belt....it did not crash ...i lost my savegame in the process tho 🥇

ps
oh i could salvage the save....burned 3 weapon stores and accidently a radio station...no crash....i went back to my pile of stuff and burned the copper wire -> crash

@Parahacker

This comment has been minimized.

Copy link

commented May 27, 2018

Ammo, eh? No wonder I couldn't find copper wire in the items folder. I didn't even think to check ammo.json.

Apparently paper is defined as ammo too, so maybe try burning some paper?

Edit: even easier, burn batteries. Don't even need to debug those in, just roll a character with a flashlight and take them out.

@Parahacker

This comment has been minimized.

Copy link

commented May 27, 2018

Welp, batteries didn't trigger a crash. I'll try actual gun ammo next.

Edit: 9x32(?) JHP did not trigger a crash either. So it's not just 'ammo', there's something else about copper wire causing the crash. Ideas?

@Night-Pryanik

This comment has been minimized.

Copy link
Member

commented May 27, 2018

Could someone test if removing plastic material from copper wire (leaving only copper as material) still produces crash?

@Rob-King-of-the-Plants

This comment has been minimized.

Copy link

commented May 27, 2018

i burned copper tubing , scrap copper and copper without crash

edit: plastic chunks burned without a crash as well

@Night-Pryanik

This comment has been minimized.

Copy link
Member

commented May 27, 2018

I think the culprit is #23600. It tries to spawn burnproducts for copper wire materials, but there is no burnproducts for plastic.

@Parahacker

This comment has been minimized.

Copy link

commented May 27, 2018

plastic tends to go up in smoke IRL, with just stains as residue - or it melts if not completely burned, but a housefire or large fire wouldn't leave much of anything. Can like 1 ash or something be added as a burnproduct for it and see if that fixes this issue?

@Zireael07

This comment has been minimized.

Copy link
Contributor

commented May 27, 2018

I guess all it needs is handling for empty list?

@budg3

This comment has been minimized.

Copy link
Contributor

commented May 27, 2018

@Rob-King-of-the-Plants managed to burn plastic chunks so it might not be that. Copper wires are a multi material item though, it can be that the burnproducts code can't handle multi material items? Can someone test burning plutonium cells as they are "material" : ["steel", "plastic"], as well designated as AMMO.

@Rob-King-of-the-Plants

This comment has been minimized.

Copy link

commented May 27, 2018

are there easier multi material items to come by? or a way to cheat items in?

@budg3

This comment has been minimized.

Copy link
Contributor

commented May 27, 2018

Use the debug menu and wish for an item. http://cddawiki.chezzo.com/cdda_wiki/index.php?title=Debug_Menu

@Parahacker

This comment has been minimized.

Copy link

commented May 27, 2018

Tested plutonium cells, the game did not crash.

They didn't leave any residue either - I had plutonium cells (100), raised my strength to 25 to carry them, tossed them into a burning wall and when the fire went out there were no cells and no residue.

@Parahacker

This comment has been minimized.

Copy link

commented May 27, 2018

Just to test, I debugged in copper wire and threw that into the same wall. Game did not crash.

Is it possible that smashing or deconstructing an oven/fridge creates a different version of copper wire than would debug? Like, the deconstruct code creates a different object that doesn't behave right?

@Eaglewing89

This comment has been minimized.

Copy link

commented May 27, 2018

Stack size of copper wire seem to matter.
Stacks with less than 80 units of copper wire caused a crash 5/5 times (instantly).

I tried several times with larger stacks but it didn't cause any crashes. The stack needs around 300 units to leave residue of copper scrap if that's of any importance.

EDIT: Stacks with 80-94 doesn't crash all the time, but it is very likely.

@Parahacker

This comment has been minimized.

Copy link

commented May 27, 2018

Ok - I recreated @Rob-King-of-the-Plants' result by going to a cabin, smashing the oven, starting a fire and tossing in the copper wire(3). Instant freeze/crash.

@Parahacker

This comment has been minimized.

Copy link

commented May 27, 2018

When I tested copper wire from debug, it was a stack of 100... a wild clue has appeared. Thx @Eaglewing89, I can say your results match mine

@budg3

This comment has been minimized.

Copy link
Contributor

commented May 27, 2018

Could be the stack size causing the crashes and not the copper wire itself.

@Parahacker

This comment has been minimized.

Copy link

commented May 27, 2018

Tested stack of 1 plut. cell and 4 plut. cells, no crash.

@Parahacker

This comment has been minimized.

Copy link

commented May 27, 2018

Any ideas on where the bug might be in the code yet? We know:
Copper wires in small stacks will cause crash
Ammo (bullets) in small stacks, no crash
Plutonium cells in small or large stacks, no crash
Copper wire in large stack, no crash

...Ideas?

@Night-Pryanik

This comment has been minimized.

Copy link
Member

commented May 27, 2018

The only idea I have is:

int n = floor( eff * ( by_weight / item::find_type( id )->weight ) );

I suppose item::find_type( id )->weight ) can become zero in case of very small stacks (1 copper wire (I mean single charge of it) have 0.00 weight) . If so, this is division by zero error.

@BevapDin

This comment has been minimized.

Copy link
Contributor

commented May 27, 2018

Nice debugging.

The material "copper" burns to "scrap_copper" (with an efficiency of 1). And "scrap_copper" is made of - "copper". So it burns down as well. And efficiency 1 means 1g of "scrap_copper" burns down to 1g of "scrap_copper". So it never vanishes. And the code adds the product to the end of the item list, deletes the currently processed item, and continues with the next item in the list. So it's effectively burning one piece of "scrap_copper", adding one piece of it and continues to burn down that item as well.

So it's never done with processing the tile that contains the "scrap_copper" item and appears to be freezing.

I suggest changing the burn efficiency of the material copper to "scrap_copper" to something less than 1.

@kevingranade

This comment has been minimized.

Copy link
Member

commented May 27, 2018

I suggest changing the burn efficiency of the material copper to "scrap_copper" to something less than 1.

Perhaps add an assert that the burning item type is not the same as the byproduct item type?

@Parahacker

This comment has been minimized.

Copy link

commented May 28, 2018

If that's the case, why would the bug trigger on smaller stacks but not bigger ones? The same scrap copper -> 1/1 scrap copper calculation would happen on any size stack, wouldn't it? I'm missing something.

Also, why only copper wire? I'm assuming that @Rob-King-of-the-Plants tested smaller stacks of copper tubing and scrap copper, neither of which triggered a crash. It seems to be only copper wire and only in smaller stacks.

@Eaglewing89

This comment has been minimized.

Copy link

commented May 28, 2018

House fire test- Copper vs Copper Wire

300 units of either Copper(0,6kg) or Copper Wire(0,6kg) seem to always produce 1 unit of Burnt Copper Scrap(0,2kg).
250-280 units of either only has a chance to produce residue.

Smaller stacks (1-10 units) of Copper does not crash the game while put in the same burning building (also doesn't produce any residue), but Copper Wire always crashes with stacks of 1-10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.