CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.61k stars 4.17k forks source link

O.H RC: SIGSEGV segfault when escaping prompt: reloaded tool no longer fits in your inventory #77284

Open ninersheep opened 6 days ago

ninersheep commented 6 days ago

Describe the bug

Game crashes when player clicks ESC or drops the wielded item. Look at video. Possibly related to vehicle tiles with storage capacity.

The prompt is "The acetylene torch no longer fits in your inventory."

Attach save file

Rosenberg-trimmed.tar.gz

Steps to reproduce

Proven to not work 1. Fill your characters inventory volume somehow 2. Spawn acetylene torch and welding tank 3. Attempt to reload empty acetylene torch with a welding tank 4. When prompted "the acetylene torch no longer fits in your inventory", click ESC 5. Crash

  1. Load up the save
  2. Attempt to reload empty acetylene torch with 1400/1400 welding tank
  3. Crash

Expected behavior

Default to drop, don't crash.

Screenshots

obraz

https://github.com/user-attachments/assets/26c11cea-e5e0-4a7f-a5bc-2d7652b08047

Versions and configuration

Additional context

crash.log

RenechCDDA commented 6 days ago

If it crashes on 0.H it likely crashes on experimental too.

https://github.com/CleverRaven/Cataclysm-DDA/blob/3edfea11c7f1cb319c4587691900d28c9472e111/src/activity_actor.cpp#L4983-L4985

Night-Pryanik commented 5 days ago

Though I can confirm the crash in your save game, I can't confirm it in a fresh world.

My character doesn't have any free space in his inventory: изображение

I spawned acetylene torch and a welding tank. When I pressed r to reload the torch, it was successfully reloaded with the tank, no crash.

Furthermore, I got no crash on your save if I:

Having this in mind, I suppose it has something to do with the vehicle tile you're standing on?

ninersheep commented 4 days ago

Good pointer about full vs empty welding tank. They're the same volume and weight. Speculation:

I thought it would be down to amount of crap in car, but the north tile is 250.37/300l so tank / welder could drop there. Also it should drop on the ground if it fails to fill the vehicle tile anyway... So i moved to northern tile, reloaded, message about full inv pops up and it crashes on escape.


It is odd that reloading on non-storage tile seems to fix this issue. So is reloading non-full tank.

I've tried reloading full tank on N tile and NW (seat facing backward) and it crashes on either clicking drop or ESC-aping. I've had to move the full welding tank to the tile NPC is sleeping on.

The popup only triggers when the welding tank is in storage tiles ie if im holding full welding tank it reloads successfully.

clicking "wield acetylene torch" also avoids the crash.


I've moved the welding tank to the aisle tile, myself to the seat, tried reloading, popup appears. If i move both, no popup appears and the result is one item on dead grass tile as expected. If i only do NW move then reload torch with 23/1400 tank, no popup.

In conclusion, player character needs to be on storage tile of some sort to trigger this bug.

My assumption about ESC making game crash was incorrect, its the act of autodropping the item somewhere.

maniak1349 commented 4 days ago

While you guys at torches crashing on reloads - #76679 is kind of related. Just checked - happens in recent 0.H RC build too.