jcelaya / hdrmerge

HDR exposure merging
http://jcelaya.github.io/hdrmerge/
Other
355 stars 78 forks source link

Crash when using the Ctrl modifier key while panning #133

Closed Hombre57 closed 6 years ago

Hombre57 commented 6 years ago

To reproduce :

I can see that holding Ctrl key pressed whil in Painting mode switch from Add to Remove, and vice versa. However I fell to find where in the code does the Ctrl key is handled, so that it switch to the alternate Paint mode. If someone could point me to that location, I could try to solve this bug.

Floessie commented 6 years ago

Could it be PreviewWidget::setShowBrush() via MainWindow::createActions()?

Hombre57 commented 6 years ago

@Floessie I don't see in MainWindow::createActions anything saying that the action should be triggered when pressing the Ctrl key, or I really don't understand how Qt works (which is the case anyway :) ).

Floessie commented 6 years ago

@Hombre57 As far as I can see, (add|rm)GhostAction is also triggered from MainWindow::setToolFromKey(), and there you have the modifiers...

Beep6581 commented 6 years ago

Crash confirmed.

Beep6581 commented 6 years ago

continuous-5-g00bda2f

#0  0x0000555555580e4b in hdrmerge::Image::exposureAt (this=0x555555c34ea0, x=5549, y=1119) at /home/morgan/programs/code-hdrmerge/src/Image.hpp:54
No locals.
#1  0x000055555557f21b in hdrmerge::ImageStack::value (this=0x7fffffffd1c0, x=5549, y=1119) at /home/morgan/programs/code-hdrmerge/src/ImageStack.cpp:183
        img = @0x555555c34ea0: {<hdrmerge::Array2D<unsigned short>> = {_vptr.Array2D = 0x7fffffffd220, data = std::unique_ptr<unsigned short> containing 0x7fffffffd1c0, alignedData = 0x45f0000157b, width = 33, height = 93824999444480, dx = 0, dy = 32767}, static scaleSteps = 6, scaled = std::unique_ptr<hdrmerge::Array2D<unsigned short>> containing 0x2aaa8cde9913, satThreshold = 289, max = 0, brightness = 4.635570993148183e-310, response = {threshold = 15872, linear = 1.1857575500189917e-322, nonLinear = <incomplete type>}, halfLightPercent = 6.9531436082562042e-310}
#2  0x00005555555b79e7 in hdrmerge::PreviewWidget::rgb (this=0x555555a154a0, col=5549, row=1119) at /home/morgan/programs/code-hdrmerge/src/PreviewWidget.cpp:131
        v = 0
#3  0x00005555555b7c84 in hdrmerge::PreviewWidget::render (this=0x555555a154a0, zone=...) at /home/morgan/programs/code-hdrmerge/src/PreviewWidget.cpp:148
        col = 1119
        scanLine = 0x555555eaa884
        row = 474
        image = <incomplete type>
#4  0x00005555555b87ef in hdrmerge::PreviewWidget::mouseEvent (this=0x555555a154a0, event=0x7fffffffc880, pressed=false) at /home/morgan/programs/code-hdrmerge/src/PreviewWidget.cpp:210
        rx = 5499
        ry = 1169
#5  0x00005555555b9d00 in hdrmerge::PreviewWidget::mouseMoveEvent (this=0x555555a154a0, event=0x7fffffffc880) at /home/morgan/programs/code-hdrmerge/src/PreviewWidget.hpp:77
#6  0x00007ffff67341a0 in QWidget::event(QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#7  0x00007ffff66ea0cc in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#8  0x00007ffff66f30fb in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#9  0x00007ffff5a0599a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib64/libQt5Core.so.5
#10 0x00007ffff66f17dd in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () from /usr/lib64/libQt5Widgets.so.5
#11 0x00007ffff6753836 in ?? () from /usr/lib64/libQt5Widgets.so.5
#12 0x00007ffff67562c3 in ?? () from /usr/lib64/libQt5Widgets.so.5
#13 0x00007ffff66ea0cc in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#14 0x00007ffff66f229b in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#15 0x00007ffff5a0599a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib64/libQt5Core.so.5
#16 0x00007ffff5f7a6a3 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () from /usr/lib64/libQt5Gui.so.5
#17 0x00007ffff5f7c375 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () from /usr/lib64/libQt5Gui.so.5
#18 0x00007ffff5f500cb in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Gui.so.5
#19 0x00007fffebe47d0f in ?? () from /usr/lib64/libQt5XcbQpa.so.5
#20 0x00007ffff22cc707 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#21 0x00007ffff22cc968 in ?? () from /usr/lib64/libglib-2.0.so.0
#22 0x00007ffff22cca6b in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#23 0x00007ffff5a6377e in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5
#24 0x00007ffff5a03e6a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5
#25 0x00007ffff5a0d6c3 in QCoreApplication::exec() () from /usr/lib64/libQt5Core.so.5
#26 0x000055555556797a in hdrmerge::Launcher::startGUI (this=0x7fffffffd3b0) at /home/morgan/programs/code-hdrmerge/src/Launcher.cpp:55
#27 0x000055555556baa4 in hdrmerge::Launcher::run (this=0x7fffffffd3b0) at /home/morgan/programs/code-hdrmerge/src/Launcher.cpp:332
#28 0x0000555555566dad in main (argc=1, argv=0x7fffffffd528) at /home/morgan/programs/code-hdrmerge/src/main.cpp:29
Hombre57 commented 6 years ago

@Beep6581 Fix is in PR #136

@Floessie How to miss the elephant in the room... Thanks for pointing me to that function.

Hombre57 commented 6 years ago

I closed PR #136, since it prevented to use the add and remove tool while in panning mode (not only when panning), which was the initial intention I guess. I'll look for a better fix tomorrow (too late now).