Closed MrLixm closed 1 year ago
Thanks for reporting this. This might be tricky for me to debug since I don't have a windows machine.
Is this with the prebuilt binaries provided on github, or did you compile from source?
Could you try earlier binary releases to if the issue is specific to 1.7.0, or already appeared earlier?
Thanks
Hey, yes it's the pre-built from GitHub.
This is a new bug as I have 1.6.1
working fine.
Ah, I see you already specified that in your original comment - sorry for overlooking that.
Any chance you could build from source and run in a debugger to track down where the crash is coming from?
Thanks
I wish I knew but that is not in my skill range unfortunately 😕
Ok, thanks for reporting anyway. Hopefully I can find someone to help me debug so windows users can get the UI improvements :-)
Alright, good luck finding that bug !
Hey @wkjarosz,
Distributor ID: Ubuntu Description: Ubuntu 22.04.1 LTS Release: 22.04 Codename: jammy
I am not using windows, but I am experiencing a similar issue with version 1.7.0 when building from source. I have tracked this down to the following line within hdrviewscreen.cpp
. It appears that when the marked line is commented out, there is no issue and the viewer launches. When present, however, the system segfaults. When digging deeper into the debugger I see that when i == 0
in the set_active
method, the tool object has no data in it when calling set_pushed
, so m_pushed
seems to just die.
void HDRViewScreen::set_tool(ETool t)
{
auto set_active = [this](int i, bool b)
{
auto tool = m_tools[i];
spdlog::trace("setting {} active: {}.", tool->name(), b);
if (tool->toolbutton())
tool->toolbutton()->set_pushed(b);
else
spdlog::error("Button for {} never created.", tool->name());
// ERROR STARTS HERE
if (tool->menuitem())
tool->menuitem()->set_pushed(b);
else
spdlog::error("Menu item for {} never created.", tool->name());
// ERROR ENDS HERE
if (tool->options_bar())
{
tool->options_bar()->set_visible(b);
request_layout_update();
}
else
spdlog::error("Options widget for {} never created.", tool->name());
};
m_tool = t;
for (int i = 0; i < (int)Tool_Num_Tools; ++i) set_active(i, false);
set_active(t, true);
}
When the line is not commented I get similar errors as above.
[info] Reading configuration from file /home/jp2844/.config/HDRView/settings.json
[info] Welcome to HDRView!
[info] Verbosity threshold set to level 2.
[info] Setting intensity scale to 1.000000
[info] Using sRGB response curve.
[info] Dithering
[info] Launching GUI with 8 bit color and LDR display support.
GLFW error 65545: GLX: Failed to find a suitable GLXFBConfig
Could not allocate floating point framebuffer, retrying without..
[info] Reading configuration from file /home/jp2844/.config/HDRView/settings.json
[warning] Error while reading settings file: Cannot open settings file: "/home/jp2844/.config/HDRView/settings.json".
[info] Using default settings.
[1] 1384135 segmentation fault (core dumped) ./HDRView
Let me know if I can provide more information.
Following up. 1.6.1 builds and runs no problem on ubuntu with no code modifications.
@jparr721 thank you. This is really helpful. I hope to look more deeply into it soon.
On Windows, the crash is because m_menuitem
is uninitialized. And the undef. content happens to never be zero, which triggers this if here: https://github.com/wkjarosz/hdrview/blob/0f82210797959cd70332e7879455a7fe757eb0b1/src/tool.cpp#L90
resulting in the menu item never being properly created. I guess this works on mac because the undef. content of this field happened to be zero always.
Initializing m_menuitem(nullptr)
in the constructor resolves the problem.
@pgrit :pray: FYI, we can also repro the issue on Linux with ASAN build(-DUSE_SANITIZER=Address
)
=================================================================
==13739==ERROR: AddressSanitizer: SEGV on unknown address (pc 0x556ecd7af77f bp 0x7ffd54497710 sp 0x7ffd544976f0 T0)
==13739==The signal is caused by a READ memory access.
==13739==Hint: this fault was caused by a dereference of a high value address (see register values below). Disassemble the provided pc to learn which register was used.
#0 0x556ecd7af77f in nanogui::Button::set_pushed(bool) /home/syoyo/work/hdrview/build/_deps/nanogui-src/include/nanogui/button.h:92:45
#1 0x556ecde3085c in HDRViewScreen::set_tool(ETool)::$_63::operator()(int, bool) const /home/syoyo/work/hdrview/src/hdrviewscreen.cpp:992:31
#2 0x556ecde2ac88 in HDRViewScreen::set_tool(ETool) /home/syoyo/work/hdrview/src/hdrviewscreen.cpp:1006:51
#3 0x556ecde20f5e in HDRViewScreen::HDRViewScreen(float, float, bool, bool, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >) /home/syoyo/work/hdrview/src/hdrviewscreen.cpp:829:5
#4 0x556ecdc9cdbf in main /home/syoyo/work/hdrview/src/hdrview.cpp:228:28
#5 0x7f42b0283d8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#6 0x7f42b0283e3f in __libc_start_main csu/../csu/libc-start.c:392:3
#7 0x556ecd487e94 in _start (/home/syoyo/work/hdrview/build/HDRView+0x163e94) (BuildId: 494b39362a76543f52ec62306e7c372191678c4c)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /home/syoyo/work/hdrview/build/_deps/nanogui-src/include/nanogui/button.h:92:45 in nanogui::Button::set_pushed(bool)
==13739==ABORTING
Confirming the crash is fixed in 1.7.1 on my side. Thanks !
Hello, had a quick look at the last update
1.7.0
on my windows machine. Unfortunately seems I cannot launch it, the terminal opens and then close briefly after. There's no error message whatsoever.Context
Logs
I tried to launch the app with a debug level but don't got anything more.
Here is the log from Git Bash that specifies that there is a seg fault. Also tried from the regular cmd.exe and got the same issue of course.
Tests
I also tried to delete the local preferences
C:\Users\lcoll\AppData\Roaming/HDRView/settings.json
but it didn't changed anything.Sorry I cannot provide any more info. Hope you can still find what's going on. Liam.