jcelaya / hdrmerge

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

Segfault when erasing mask out of the window #43

Closed Beep6581 closed 10 years ago

Beep6581 commented 10 years ago

Steps to reproduce: 1- Open the source images 2- Maximize the window, scroll right to the bottom 3- Ctrl+mouse-drag to erase the layer, and make sure you keep the buttons pressed while dragging the brush right off the window's bottom edge. Segfault.

Today's commit a73aac740a03ff7c7ad57d8491b9da4b555b1a49

Program received signal SIGSEGV, Segmentation fault. 0x000000000047aa47 in hdrmerge::ImageStack::getImageAt (this=0x7fffffffd7f8, x=758, y=2617) at /home/drslony/programs/code-hdrmerge-develop/ImageStack.hpp:81 81 return mask(x, y); (gdb) bt full

0 0x000000000047aa47 in hdrmerge::ImageStack::getImageAt (this=0x7fffffffd7f8, x=758, y=2617) at /home/drslony/programs/code-hdrmerge-develop/ImageStack.hpp:81

No locals.

1 0x0000000000477d70 in hdrmerge::MainWindow::setPixelStatus (this=0x7fffffffd720, x=758, y=2617) at /home/drslony/programs/code-hdrmerge-develop/MainWindow.cpp:213

    l = 32767
    img = @0x484c82: {<hdrmerge::Array2D<unsigned short>> = {_vptr.Array2D = 0x74c0854828408b48, data = std::unique_ptr<unsigned short> containing 0xc08348f8458b4816, alignedData = 0x10de8c7894808, width = 1082869760, height = -1207571672, dx = 4807680, dy = 1213580233}, static scaleSteps = 6,
      scaled = std::unique_ptr<hdrmerge::Array2D<unsigned short>> containing 0x894810ec8348e589, satThreshold = 63613, brightness = 9.9970313556970935e-310, relExp = -6.6895117470447284e+232, halfLightPercent = -4.2005688851192053e+36}

2 0x0000000000484bfa in hdrmerge::MainWindow::qt_static_metacall (_o=0x7fffffffd720, _c=QMetaObject::InvokeMetaMethod, _id=2, _a=0x7fffffffcaf0) at /home/drslony/programs/code-hdrmerge-develop/build/moc_MainWindow.cxx:61

    _t = 0x7fffffffd720

3 0x00007ffff6df4c38 in QMetaObject::activate(QObject, QMetaObject const, int, void**) () from /usr/lib64/qt4/libQtCore.so.4

No symbol table info available.

4 0x0000000000485129 in hdrmerge::PreviewWidget::pixelUnderMouse (this=0xa47470, _t1=758, _t2=2617) at /home/drslony/programs/code-hdrmerge-develop/build/moc_PreviewWidget.cxx:132

    _a = {0x0, 0x7fffffffcae4, 0x7fffffffcae0}

5 0x000000000047e41b in hdrmerge::PreviewWidget::mouseEvent (this=0xa47470, event=0x7fffffffcfd0, pressed=false) at /home/drslony/programs/code-hdrmerge-develop/PreviewWidget.cpp:201

    rx = 758
    ry = 2617

6 0x000000000047f032 in hdrmerge::PreviewWidget::mouseMoveEvent (this=0xa47470, event=0x7fffffffcfd0) at /home/drslony/programs/code-hdrmerge-develop/PreviewWidget.hpp:75

No locals.

7 0x00007ffff73719e5 in QWidget::event(QEvent*) () from /usr/lib64/qt4/libQtGui.so.4

No symbol table info available.

8 0x00007ffff73223fc in QApplicationPrivate::notifyhelper(QObject, QEvent_) () from /usr/lib64/qt4/libQtGui.so.4

No symbol table info available.

9 0x00007ffff7328afd in QApplication::notify(QObject, QEvent) () from /usr/lib64/qt4/libQtGui.so.4

No symbol table info available.

10 0x00007ffff6de10dd in QCoreApplication::notifyInternal(QObject, QEvent) () from /usr/lib64/qt4/libQtCore.so.4

No symbol table info available.

11 0x00007ffff73282b3 in QApplicationPrivate::sendMouseEvent(QWidget, QMouseEvent, QWidget, QWidget, QWidget**, QPointer&, bool) () from /usr/lib64/qt4/libQtGui.so.4

No symbol table info available.

12 0x00007ffff7399b00 in ?? () from /usr/lib64/qt4/libQtGui.so.4

No symbol table info available.

13 0x00007ffff7397e9c in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib64/qt4/libQtGui.so.4

No symbol table info available.

14 0x00007ffff73be532 in ?? () from /usr/lib64/qt4/libQtGui.so.4

No symbol table info available.

15 0x00007ffff5014a96 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0

No symbol table info available.

16 0x00007ffff5014de8 in ?? () from /usr/lib64/libglib-2.0.so.0

No symbol table info available.

17 0x00007ffff5014e8c in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0

No symbol table info available.

18 0x00007ffff6e0dc15 in QEventDispatcherGlib::processEvents(QFlagsQEventLoop::ProcessEventsFlag) () from /usr/lib64/qt4/libQtCore.so.4

No symbol table info available.

19 0x00007ffff73be5d6 in ?? () from /usr/lib64/qt4/libQtGui.so.4

No symbol table info available.

20 0x00007ffff6ddfd3f in QEventLoop::processEvents(QFlagsQEventLoop::ProcessEventsFlag) () from /usr/lib64/qt4/libQtCore.so.4

No symbol table info available.

21 0x00007ffff6de0035 in QEventLoop::exec(QFlagsQEventLoop::ProcessEventsFlag) () from /usr/lib64/qt4/libQtCore.so.4

No symbol table info available.

22 0x00007ffff6de514b in QCoreApplication::exec() () from /usr/lib64/qt4/libQtCore.so.4

No symbol table info available.

23 0x000000000044e731 in hdrmerge::Launcher::startGUI (this=0x7fffffffd9c0) at /home/drslony/programs/code-hdrmerge-develop/Launcher.cpp:53

    mw = {<QMainWindow> = {<No data fields>}, static staticMetaObject = {d = {superdata = 0x6ae320 <QMainWindow::staticMetaObject>, stringdata = 0x495d40 <qt_meta_stringdata_hdrmerge__MainWindow> "hdrmerge::MainWindow", data = 0x495c60 <qt_meta_data_hdrmerge__MainWindow>,
          extradata = 0x495bf0 <hdrmerge::MainWindow::staticMetaObjectExtraData>}}, static staticMetaObjectExtraData = {objects = 0x0, static_metacall = 0x484b24 <hdrmerge::MainWindow::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>}, loadImagesAction = 0x904040, quitAction = 0x7be050,
      undoAction = 0x8a9290, redoAction = 0x9140b0, aboutAction = 0x72e480, mergeAction = 0x8a54b0, dragToolAction = 0x9215d0, addGhostAction = 0x845ba0, rmGhostAction = 0x912e00, lastTool = 0x9215d0, fileMenu = 0x883510, editMenu = 0x912680, helpMenu = 0x8d1480, previewArea = 0x8ae430, preview = 0xa47470,
      radiusBox = 0x8d9670, radiusSlider = 0x7a9580, layerSelectorGroup = 0x8ce900, layerSelector = 0x91c0b0, exposureSlider = 0x8b4460, statusBar = 0x7a9eb0, statusLabel = 0x732bb0, io = {stack = {images = std::vector of length 3, capacity 4 = {{<hdrmerge::Array2D<unsigned short>> = {
                _vptr.Array2D = 0x4866f0 <vtable for hdrmerge::Image+16>, data = std::unique_ptr<unsigned short> containing 0x7fffcf19c010, alignedData = 0x7fffcf19c010, width = 3896, height = 2616, dx = 0, dy = 0}, static scaleSteps = 6,
              scaled = std::unique_ptr<hdrmerge::Array2D<unsigned short>> containing 0x0, satThreshold = 3683, brightness = 2059.2375361266004, relExp = 1.1200813156988874, halfLightPercent = 0}, {<hdrmerge::Array2D<unsigned short>> = {_vptr.Array2D = 0x4866f0 <vtable for hdrmerge::Image+16>,
                data = std::unique_ptr<unsigned short> containing 0x7fffd050d010, alignedData = 0x7fffd050d010, width = 3896, height = 2616, dx = 0, dy = 0}, static scaleSteps = 6, scaled = std::unique_ptr<hdrmerge::Array2D<unsigned short>> containing 0x0, satThreshold = 3683, brightness = 825.63567677426545,
              relExp = 4.3150505846078397, halfLightPercent = 0}, {<hdrmerge::Array2D<unsigned short>> = {_vptr.Array2D = 0x4866f0 <vtable for hdrmerge::Image+16>, data = std::unique_ptr<unsigned short> containing 0x7fffcde2b010, alignedData = 0x7fffcde2b010, width = 3896, height = 2616, dx = 0, dy = 0},
              static scaleSteps = 6, scaled = std::unique_ptr<hdrmerge::Array2D<unsigned short>> containing 0x0, satThreshold = 3683, brightness = 238.51318895644556, relExp = 16.003663003663004, halfLightPercent = 9.3872472709836843e-323}},
          mask = {<hdrmerge::EditableMask> = {<hdrmerge::Array2D<unsigned char>> = {_vptr.Array2D = 0x486370 <vtable for hdrmerge::ImageStack::EditableMaskImpl+16>, data = std::unique_ptr<unsigned char> containing 0x7fffd804b590 '\001' <repeats 200 times>...,
                alignedData = 0x7fffd804b590 '\001' <repeats 200 times>..., width = 3896, height = 2616, dx = 0, Python Exception <type 'exceptions.ValueError'> Cannot find type std::list<hdrmerge::EditableMask::EditAction, std::allocator<hdrmerge::EditableMask::EditAction> >::_Node:

Python Exception <type 'exceptions.ValueError'> Cannot find type std::list<hdrmerge::EditableMask::EditAction, std::allocator >::iterator::_Node: dy = 0}, editActions = std::list, nextAction = }, stack = 0x7fffffffd7f8}, width = 3896, height = 2616, flip = 0, satThreshold = 3683}, rawParameters = std::vector of length 3, capacity 4 = { std::unique_ptrhdrmerge::RawParameters containing 0x7fffe0002e90, std::unique_ptrhdrmerge::RawParameters containing 0x7fffd4000da0, std::unique_ptrhdrmerge::RawParameters containing 0x7fffd8003c00}}, preloadFiles = std::vector of length 0, capacity 0}

24 0x0000000000451cb5 in hdrmerge::Launcher::run (this=0x7fffffffd9c0) at /home/drslony/programs/code-hdrmerge-develop/Launcher.cpp:311

    useGUI = true
    app = <incomplete type>
    qtTranslator = <incomplete type>
    appTranslator = <incomplete type>

25 0x000000000044e3aa in main (argc=1, argv=0x7fffffffdb28) at /home/drslony/programs/code-hdrmerge-develop/main.cpp:29

    launcher = {argc = 1, argv = 0x7fffffffdb28, generalOptions = {fileNames = std::vector of length 0, capacity 0, align = true, crop = true, batch = false, batchGap = 2}, saveOptions = {bps = 16, previewSize = 2, fileName = "", saveMask = false, maskFileName = "", featherRadius = 3}, help = false}
jcelaya commented 10 years ago

Thanks, fixed. You are a good beta-tester :)

Beep6581 commented 10 years ago

You are a good coder :) :+1:

Beep6581 commented 10 years ago

Fix confirmed.