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 when deselecting readonly InputTextMultiline #6292

Closed
TheBlueBurger opened this issue Apr 1, 2023 · 1 comment
Closed

Crash when deselecting readonly InputTextMultiline #6292

TheBlueBurger opened this issue Apr 1, 2023 · 1 comment

Comments

@TheBlueBurger
Copy link

Version/Branch of Dear ImGui:

Version: 5a2b1e8
Branch: master
Back-end/Renderer/Compiler/OS

Back-ends: imgui_impl_glfw.cpp + imgui_impl_vulkan.cpp
Compiler: v12.2.1-gcc
Operating System: Arch Linux

My Issue/Question:

I get a segmentation fault whenever I select a readonly InputTextMultiline and then deselect it. I ran a git bisect and 5a2b1e8 is the first broken commit. I use imgui_stdlib but it seems to be broken without it too. This is a backtrace:

(gdb) bt
#0  __memcpy_evex_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:318
#1  0x0000555555643a77 in ImGui::InputTextDeactivateHook (id=2670150314) at /home/blueburgers/Documents/Dev/C++/thing/imgui/imgui_widgets.cpp:4039
#2  0x00005555555a00c7 in ImGui::SetActiveID (id=0, window=0x0) at /home/blueburgers/Documents/Dev/C++/thing/imgui/imgui.cpp:3781
#3  0x00005555555a02bf in ImGui::ClearActiveID () at /home/blueburgers/Documents/Dev/C++/thing/imgui/imgui.cpp:3822
#4  0x0000555555646f92 in ImGui::InputTextEx (label=0x55555568c15d "##itm", hint=0x0, buf=0x555555715090 <logs[abi:cxx11]+16> "", buf_size=16, size_arg=..., flags=67387392, 
    callback=0x555555666b87 <InputTextCallback(ImGuiInputTextCallbackData*)>, callback_user_data=0x7fffffffa780) at /home/blueburgers/Documents/Dev/C++/thing/imgui/imgui_widgets.cpp:4734
#5  0x000055555563fc8e in ImGui::InputTextMultiline (label=0x55555568c15d "##itm", buf=0x555555715090 <logs[abi:cxx11]+16> "", buf_size=16, size=..., flags=278528, 
    callback=0x555555666b87 <InputTextCallback(ImGuiInputTextCallbackData*)>, user_data=0x7fffffffa780) at /home/blueburgers/Documents/Dev/C++/thing/imgui/imgui_widgets.cpp:3613
#6  0x0000555555666e0a in ImGui::InputTextMultiline (label=0x55555568c15d "##itm", str=0x555555715080 <logs[abi:cxx11]>, size=..., flags=278528, callback=0x0, user_data=0x0)
    at /home/blueburgers/Documents/Dev/C++/thing/imgui/misc/cpp/imgui_stdlib.cpp:62
#7  0x00005555555637ea in main () at /home/blueburgers/Documents/Dev/C++/thing/src/main.cpp:671

Screenshots/Video

XXX (you can drag files here)

Standalone, minimal, complete and verifiable example: (see #2261)

std::string someString;
// Here's some code anyone can copy and paste to reproduce your issue
ImGui::Begin("Example Bug");
ImGui::InputTextMultiline("##itm", &someString, ImVec2(0, 0), ImGuiInputTextFlags_ReadOnly);
ImGui::End();
@ocornut
Copy link
Owner

ocornut commented Apr 2, 2023

Indeed this was caused by change made for #4714 two weeks ago.
Pushed a fix e8206db
Thanks a lot !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants