CleverRaven / Cataclysm-DDA

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

Tiny canine skull. Game crashes #76332

Open IdleSol opened 2 months ago

IdleSol commented 2 months ago

Describe the bug

Attempting to spawn will cause the game to quit. The moment this item is highlighted in the spawn menu.

1 2

crash.log debug.log

Attach save file

None. Test World at 1 minute.

Steps to reproduce

  1. Standard world and character
  2. Open the spawn menu
  3. Type tiny c
  4. Press enter (change focus from the search bar to the spawn window?). 3a. Type tiny 4a. Use the arrows to move to the tiny canine skull line.
  5. Get the game to crash.

Expected behavior

n/a

Screenshots

No response

Versions and configuration

Additional context

Possibly important: the game runs via portproton on archlinux.

Karol1223 commented 2 months ago

Could not reproduce on windows.

l29ah commented 2 months ago

/confirmed on 6dc777e2cd64204d94d4fb19557a6ff1b47694bb backtrace of the assertion failure:

#0  0x00007fea7bac42dc in __pthread_kill_implementation () from /lib64/libc.so.6
#1  0x00007fea7ba74346 in raise () from /lib64/libc.so.6
#2  0x00007fea7ba5c8f7 in abort () from /lib64/libc.so.6
#3  0x00007fea7ba5c81b in __assert_fail_base.cold () from /lib64/libc.so.6
#4  0x00007fea7ba6cb26 in __assert_fail () from /lib64/libc.so.6
#5  0x0000558914007daa in ImGui::EndFrame () at src/third-party/imgui/imgui.cpp:4928
#6  0x000055891400e0da in ImGui::Render () at src/third-party/imgui/imgui.cpp:5024
#7  0x00005589131a05e3 in cataimgui::client::end_frame (this=0x55894e2b3900) at src/cata_imgui.cpp:135
#8  0x00005589140b136b in ui_adaptor::redraw_invalidated () at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/unique_ptr.h:199
#9  0x00005589140b1571 in ui_adaptor::redraw () at src/ui_manager.cpp:353
#10 0x00005589140b15a4 in ui_manager::redraw () at src/ui_manager.cpp:516
#11 0x0000558913375dba in debug_error_prompt (filename=<optimized out>, filename@entry=0x558914333b4f "src/recipe_dictionary.cpp", line=<optimized out>, line@entry=0x558914288466 "66", funcname=<optimized out>, 
    funcname@entry=0x558914333b80 "const T& string_id<T>::obj() const [with T = recipe]", text=<optimized out>, force=force@entry=false) at src/debug.cpp:381
#12 0x00005589133762bc in realDebugmsg (filename=filename@entry=0x558914333b4f "src/recipe_dictionary.cpp", line=line@entry=0x558914288466 "66", 
    funcname=funcname@entry=0x558914333b80 "const T& string_id<T>::obj() const [with T = recipe]", text="invalid recipe id \"meal_bone_mill_2_1\"") at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/basic_string.h:222
#13 0x0000558913e5a30f in realDebugmsg<char const*> (mes=0x558914333b69 "invalid recipe id \"%s\"", funcname=0x558914333b80 "const T& string_id<T>::obj() const [with T = recipe]", line=0x558914288466 "66", 
    filename=0x558914333b4f "src/recipe_dictionary.cpp") at src/debug.h:75
#14 string_id<recipe>::obj (this=this@entry=0x5589566ce3e0) at src/recipe_dictionary.cpp:66
#15 0x00005589136ab143 in string_id<recipe>::operator* (this=0x5589566ce3e0) at src/string_id.h:287
#16 item::final_info (this=this@entry=0x7ffce9595d50, info=std::vector of length 15, capacity 16 = {...}, parts=parts@entry=0x558914a32b60 <iteminfo_query::all>, batch=batch@entry=1) at src/item.cpp:5819
#17 0x00005589136b9162 in item::get_info (this=this@entry=0x7ffce9595d50, parts=0x558914a32b60 <iteminfo_query::all>, batch=batch@entry=1) at src/item.cpp:6239
#18 0x00005589136b930f in item::get_info (this=this@entry=0x7ffce9595d50, showtext=showtext@entry=true, batch=batch@entry=1) at src/item.cpp:6138
#19 0x00005589136b9357 in item::get_info (this=this@entry=0x7ffce9595d50, showtext=showtext@entry=true) at src/item.cpp:6133
#20 0x00005589141d9a2f in wish_item_callback::refresh (this=0x7ffce9596710, menu=0x7ffce9596bf8) at src/wish.cpp:958
#21 0x00005589140aab74 in uilist_impl::draw_controls (this=0x55897ed9b780) at src/ui.cpp:160
#22 0x00005589131a032a in cataimgui::window::draw (this=0x55897ed9b780) at src/cata_imgui.cpp:708
#23 cataimgui::window::draw (this=0x55897ed9b780) at src/cata_imgui.cpp:677
#24 0x00005589140b142c in ui_adaptor::redraw_invalidated () at src/ui_manager.cpp:448
#25 0x00005589140b1571 in ui_adaptor::redraw () at src/ui_manager.cpp:353
#26 0x00005589140b15a4 in ui_manager::redraw () at src/ui_manager.cpp:516
#27 0x00005589140ac121 in uilist::query (this=this@entry=0x7ffce9596bf8, loop=loop@entry=true, timeout=timeout@entry=50, allow_unfiltered_hotkeys=allow_unfiltered_hotkeys@entry=false) at src/ui.cpp:898
#28 0x00005589141d3b89 in debug_menu::wishitem (you=you@entry=0x55894e507f50, pos=...) at src/wish.cpp:1053
#29 0x00005589141d43c1 in debug_menu::wishitem (you=you@entry=0x55894e507f50) at src/wish.cpp:982
#30 0x00005589133a5f69 in debug_menu::debug () at src/debug_menu.cpp:3712
#31 0x00005589135a5786 in game::do_regular_action (this=this@entry=0x55894e3071c0, act=@0x7ffce9597a44: ACTION_DEBUG, player_character=..., mouse_target=std::optional [no contained value]) at src/handle_action.cpp:2830
#32 0x00005589135a6ede in game::handle_action (this=0x55894e3071c0) at src/handle_action.cpp:3170
#33 0x00005589133f2563 in do_turn () at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/unique_ptr.h:199
#34 0x0000558912dfc644 in main (argc=<optimized out>, argv=<optimized out>) at src/main.cpp:873
CoroNaut commented 2 months ago

Couldn't help but notice this is similar to #76295 with Imgui and the assertion failure. Not saying its a duplicate, because the canine skull is not in my issue.

l29ah commented 2 months ago

Couldn't help but notice this is similar to #76295 with Imgui and the assertion failure. Not saying its a duplicate, because the canine skull is not in my issue.

Yes, it looks very similar, as both have some interaction between cdda internal error messages and imgui menus.

db48x commented 2 months ago

Yes, the bug is apparently an interaction between the debug message and the ui state. You can see ImGui’s assertion on line 4928 of imgui.cpp:

IM_ASSERT(g.WithinFrameScope && "Forgot to call ImGui::NewFrame()?");
db48x commented 2 months ago

And even if that were fixed, the debug ui just puts itself on the ui_adaptor stack and then calls redraw_invalidated, which will eventually redraw everything even though that means calling the very code that generated this error.