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

SIGABRT: Reading a scroll causes crash in spellbook_callback::refresh() -> ImGui:BeginChildEx #78476

Closed
ghiknt opened this issue Dec 10, 2024 · 6 comments · Fixed by #78487 or #78652
Closed
Labels
<Bug> This needs to be fixed ImGui Anything related to the new ImGui UI for SDL/tiles or ImTui for curses builds (S2 - Confirmed) Bug that's been confirmed to exist

Comments

@ghiknt
Copy link

ghiknt commented Dec 10, 2024

Describe the bug

Reading the the scroll in starting tower causes crash.

  • Tried with two different starts.
  • Appears to be regression between "cdda-experimental-2024-11-26-0822 1ecb260" where it worked and "cdda-experimental-2024-12-10-1632 ff1d0cd"

Attach save file

Grapevine-trimmed.tar.gz

Steps to reproduce

  1. Activate (or Read) the "Scroll of Stormfist" in inventory

Expected behavior

Bring up window showing scroll contents to allow learning if desired.

Screenshots

No response

Versions and configuration

  • OS: Linux
    • OS Version: Distributor ID: Debian; Description: Debian GNU/Linux 12 (bookworm); Release: 12; Codename: bookworm;
  • Game Version: cdda-experimental-2024-12-10-1632 ff1d0cd [64-bit]
  • Graphics Version: Tiles
  • Game Language: System language []
  • 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],
    Magiclysm [magiclysm],
    SpeedyDex [speedydex],
    Stats Through Skills [StatsThroughSkills]
    ]

Additional context

grapevine-crash-debug.zip

@ghiknt ghiknt added the (S1 - Need confirmation) Report waiting on confirmation of reproducibility label Dec 10, 2024
@ghiknt ghiknt closed this as completed Dec 10, 2024
@ghiknt
Copy link
Author

ghiknt commented Dec 10, 2024

Issue first appears in release Cataclysm-DDA experimental build 2024-11-28-1212 #78144 which included change of...

@ghiknt ghiknt reopened this Dec 10, 2024
@ZhilkinSerg
Copy link
Contributor

Doesn't crash for me on Windows MSVC build, so it could be Linux-specific (and because MSVC is less strict).

Crash is on the line 5955 of imgui.cpp which is:

IM_ASSERT((child_flags & ~ImGuiChildFlags_SupportedMask_) == 0 && "Illegal ImGuiChildFlags value. Did you pass ImGuiWindowFlags values instead of ImGuiChildFlags?");

Thus most probably following patch should help:

diff --git a/src/magic.cpp b/src/magic.cpp
index 96038ff396..a5e5915251 100644
--- a/src/magic.cpp
+++ b/src/magic.cpp
@@ -2529,7 +2529,7 @@ class spellcasting_callback : public uilist_callback
             ImGui::SameLine( 0.0, -1.0 );
             ImVec2 info_size = ImGui::GetContentRegionAvail();
             info_size.y -= ImGui::GetTextLineHeightWithSpacing();
-            if( ImGui::BeginChild( "spell info", info_size, false,
+            if( ImGui::BeginChild( "spell info", info_size, ImGuiChildFlags_None,
                                    ImGuiWindowFlags_AlwaysVerticalScrollbar ) ) {
                 if( menu->previewing >= 0 && static_cast<size_t>( menu->previewing ) < known_spells.size() ) {
                     display_spell_info( menu->previewing );
@@ -3194,7 +3194,7 @@ void spellbook_callback::refresh( uilist *menu )
 {
     ImGui::TableSetColumnIndex( 2 );
     ImVec2 info_size = ImGui::GetContentRegionAvail();
-    if( ImGui::BeginChild( "spellbook info", info_size, false,
+    if( ImGui::BeginChild( "spellbook info", info_size, ImGuiChildFlags_None,
                            ImGuiWindowFlags_AlwaysAutoResize ) ) {
         if( menu->selected >= 0 && static_cast<size_t>( menu->selected ) < spells.size() ) {
             draw_spellbook_info( spells[menu->selected] );

@ZhilkinSerg
Copy link
Contributor

Please confirm whether it helped or not.

@ZhilkinSerg ZhilkinSerg added <Bug> This needs to be fixed (S2 - Confirmed) Bug that's been confirmed to exist ImGui Anything related to the new ImGui UI for SDL/tiles or ImTui for curses builds and removed (S1 - Need confirmation) Report waiting on confirmation of reproducibility labels Dec 11, 2024
@Night-Pryanik
Copy link
Contributor

I didn't get the crash on Windows either.

@ghiknt
Copy link
Author

ghiknt commented Dec 11, 2024

Unfortunately it still crashed for me the same way using cdda-experimental-2024-12-11-0835 653a131 [64-bit] on linux.

Since it is not happening on windows if needed I can re-setup my build environment and run debug code for you if you want.

@ghiknt
Copy link
Author

ghiknt commented Dec 30, 2024

Confirmed this fixed my issue. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bug> This needs to be fixed ImGui Anything related to the new ImGui UI for SDL/tiles or ImTui for curses builds (S2 - Confirmed) Bug that's been confirmed to exist
Projects
None yet
4 participants