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

Repeatable crash when interacting with an item #77500

Closed
Standing-Storm opened this issue Nov 1, 2024 · 1 comment · Fixed by #77551
Closed

Repeatable crash when interacting with an item #77500

Standing-Storm opened this issue Nov 1, 2024 · 1 comment · Fixed by #77551
Labels
[C++] Changes (can be) made in C++. Previously named `Code` <Crash / Freeze> Fatal bug that results in hangs or crashes. (S2 - Confirmed) Bug that's been confirmed to exist

Comments

@Standing-Storm
Copy link
Contributor

Standing-Storm commented Nov 1, 2024

Describe the bug

Some item in the pile directly north of the character causes a repeatable segfault when interacted with

Attach save file

Skyland - Copy-trimmed.tar.gz

Steps to reproduce

  1. attempt to pick up, examine, autohaul, use the item look around menu with, or use AIM on the pile of items directly north of the PC.
  2. segfault

Expected behavior

No segfault.

Screenshots

No response

Versions and configuration

  • OS: Windows
    • OS Version: 10.0.22631.4317 (23H2)
  • Game Version: cdda-experimental-2024-10-31-2132 f348de9 [64-bit]
  • Graphics Version: Tiles
  • Game Language: English [en]
  • Mods loaded: [
    Dark Days Ahead [dda],
    Disable NPC Needs [no_npc_food],
    Portal Storms Ignore NPCs [personal_portal_storms],
    Slowdown Fungal Growth [no_fungal_growth],
    Sky Island [skyisland],
    Xedra Evolved [xedra_evolved],
    Mind Over Matter [mindovermatter],
    Bionic Slots [cbm_slots],
    Railroads [railroads],
    Bombastic Perks [bombastic_perks]
    ]

Additional context

crash.log
debug.log

Mousing over the pile in debug map editor does not cause a segfault...unless you try to edit items, which does.

Using Telekinesis (the directed_push spell effect) does not cause a segfault. Throwing the pile of objects into a debugged-in lava tile does successfully delete them all.

@RenechCDDA
Copy link
Member

Right, looks like I forgot to check if the component is a comestible before calling its comestible values...

Cataclysm-DDA/src/item.cpp

Lines 8674 to 8676 in 1e022d2

for( const std::pair<itype_id, std::vector<item>> pair : components ) {
for( const item &it : pair.second ) {
nutrients &maybe_food = it.get_comestible()->default_nutrition;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` <Crash / Freeze> Fatal bug that results in hangs or crashes. (S2 - Confirmed) Bug that's been confirmed to exist
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants