Skip to content

Segfault on window.GetKeyName() #87

@LemonHeadOnGit

Description

@LemonHeadOnGit

Title is pretty self explanatory. I looked into it and lldb reveals that window.GetKeyName() returns a null value on my system. This bug is really interesting since the same code seems to work perfectly fine outside of the ImGui::BulletText, but returns a null inside of the ImGui function (or maybe my different implementation of it does better but nothing seems to clue me in as to why). The following output from a little bit of debug code shows the return value of GetKeyName being 0x0000000000000000 (NULL)

* thread #1, name = 'RayTracerd', stop reason = breakpoint 1.1
    frame #0: 0x00005555556159a2 RayTracerd`UserInterface::DrawSettings(this=0x0000555556b24700) at UserInterface.cpp:172:16
   169          descriptorPool_->Device().Surface().Instance().Window();
   170 
   171      auto keyreturn = window.GetKeyName(GLFW_KEY_W, 0);
-> 172      std::printf("RETURN VALUE FOR KEY_W: %s", keyreturn);
   173 
   174      ImGui::Text("Help");
   175      ImGui::Separator();
(lldb) p keyreturn
(const char *) 0x0000000000000000
(lldb) 

I'm not sure why window.GetKeyName would return null in the first place as the lack of any issue being made points to this being an issue nobody else has experienced.

I have forked the project and I am already working on a fix as I type this. When this issue gets published I will likely be done with the fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions