Rawtherapee: Crash when starting RT/spot-removal branch

Created on 18 Mar 2019  路  10Comments  路  Source: Beep6581/RawTherapee

I did my best to merge dev into spot-removal ; it builds fine but crash when starting RT, with a clean build. [Win7/64-bit]

terminate called after throwing an instance of 'std::ios_base::failure[abi:cxx11]'
  what():  error while reading from input stream: iostream error

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

I added a breakpoint on exception (through Eclipse), but it didn't stopped.

I committed the patch nonetheless to get some help on this, if ever (ping @Floessie @heckflosse ?), I can't find anything valuable by googling.

bug

Most helpful comment

@Floessie @heckflosse I managed to track it down, sorry for the noise.

All 10 comments

PS : If anyone can fix the initial crash, don't expect this version to work fine since I couldn't have a chance to test it.

@Floessie @heckflosse I managed to track it down, sorry for the noise.

@Hombre57
New crash when starting

Version: 5.5-277-g5b136d664
Branch: spot-removal-tool
Commit: 5b136d664
Commit date: 2019-03-25
Compiler: gcc 8.3.0
Processor: generic x86
System: Windows
Bit depth: 64 bits
Gtkmm: V3.22.3
Lensfun: V0.3.2.0
Build type: release
Build flags:  -m64 -mwin32 -msse2 -mfpmath=sse -mthreads -Wno-aggressive-loop-optimizations -Wno-parentheses -std=c++11 -mtune=generic -Werror=unused-label -Wall -Wuninitialized -Wno-deprecated-declarations -Wno-unused-result -fopenmp -Werror=unknown-pragmas  -DNDEBUG  -O3 -ftree-vectorize
Link flags: -m64  -mthreads  -static-libgcc   -mtune=generic  -s  -O3  -fno-use-linker-plugin
OpenMP support: ON
MMAP support: ON
Thread 1 received signal SIGSEGV, Segmentation fault.
Cairo::RefPtr<Cairo::ImageSurface>::operator= (src=..., this=0x0)
    at C:/msys64/mingw64/include/cairomm-1.0/cairomm/refptr.h:366
366       this->swap(temp);
(gdb) bt full
#0  Cairo::RefPtr<Cairo::ImageSurface>::operator= (src=..., this=0x0)
    at C:/msys64/mingw64/include/cairomm-1.0/cairomm/refptr.h:366
        temp = <optimized out>
        temp = <optimized out>
#1  RTSurface::changeImage (this=this@entry=0x0, imageName=...)
    at D:/RAWTHERAPEE/RTSOURCE/rawtherapee/rtgui/rtsurface.cc:82
        iterator = {_M_node = 0xd28ce8 <_ZN12_GLOBAL__N_112surfaceCach
#2  0x00000000006b019a in RTSurface::setImage (this=this@entry=0x0,
    fileName=..., rtlFileName=...)
    at D:/RAWTHERAPEE/RTSOURCE/rawtherapee/rtgui/rtsurface.cc:63
        imageName = {static npos = 18446744073709551615, string_ = {
            static npos = 18446744073709551615,
            _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_ahar>> = {<No data fields>}, <No data fields>},
              _M_p = 0xc93e7e0 "spot-normal.png"}, _M_string_length =
              _M_local_buf = "spot-normal.png",
              _M_allocated_capacity = 8245930584244711539}}}
#3  0x00000000004ec253 in OPIcon::OPIcon (this=0x11fa34a0, normalImage
    activeImage=..., prelightImage=..., draggedImage=...,
    insensitiveImage=..., drivenPoint=Geometry::DP_CENTERCENTER)
    at C:/msys64/mingw64/include/cairomm-1.0/cairomm/refptr.h:202
No locals.
#4  0x00000000006dc684 in Spot::Spot (this=0x11fa33a0,
    __in_chrg=<optimized out>, __vtt_parm=<optimized out>)
    at C:/msys64/mingw64/include/c++/8.3.0/ext/new_allocator.h:79
No locals.
#5  0x000000000070570e in ToolPanelCoordinator::ToolPanelCoordinator (
    this=0x11dd9aa0, batch=<optimized out>)
    at D:/RAWTHERAPEE/RTSOURCE/rawtherapee/rtgui/toolpanelcoord.cc:47
        favoriteCount = <optimized out>
        favoriteCount = <optimized out>
        it = <optimized out>
        i = <optimized out>
        toolPanel = <optimized out>
        __for_range = <optimized out>
        __for_begin = <optimized out>
        __for_end = <optimized out>
#6  0x0000000000419262 in BatchToolPanelCoordinator::BatchToolPanelCoo
    (this=0x11dd9aa0, parent=0x11bc94b0)
    at D:/RAWTHERAPEE/RTSOURCE/rawtherapee/rtgui/batchtoolpanelcoord.c
        i = <optimized out>
#7  0x000000000053f379 in FilePanel::FilePanel (this=0x11bc94b0,
    __in_chrg=<optimized out>, __vtt_parm=<optimized out>)
    at D:/RAWTHERAPEE/RTSOURCE/rawtherapee/rtgui/filepanel.cc:55
        obox = <optimized out>
        devLab = <optimized out>
        exportLab = <optimized out>
        dirSelected = {<sigc::signal2<void, Glib::ustring const&, Glibconst&, sigc::nil>> = {<sigc::signal_base> = {<sigc::trackable> = {
                callback_list_ = 0xd600000},
              impl_ = 0x7ffec8569725 <ntdll!RtlAllocateHeap+1637>}, <Nlds>}, <No data fields>}
        sFilterPanel = <optimized out>
        sExportPanel = <optimized out>
        inspectLab = <optimized out>
        filtLab = <optimized out>
        obox = <optimized out>
        dirSelected = <optimized out>
        sFilterPanel = <optimized out>
        sExportPanel = <optimized out>
        devLab = <optimized out>
        inspectLab = <optimized out>
        filtLab = <optimized out>
        exportLab = <optimized out>
#8  0x00000000006b927f in RTWindow::RTWindow (this=0x11c30e20,
    __in_chrg=<optimized out>, __vtt_parm=<optimized out>)
    at D:/RAWTHERAPEE/RTSOURCE/rawtherapee/rtgui/rtwindow.cc:330
        lbq = <optimized out>
        actionGrid = <optimized out>
        fpanelLabelGrid = <optimized out>
        fpl = <optimized out>
        iccProfileCreator = <optimized out>
        preferences = <optimized out>
        screen = {pCppObject_ = 0x11c3e300}
        lMonitorRect = {gobject_ = {x = 0, y = 0, width = 1280,
            height = 1024}}
        screen = <optimized out>
        lMonitorRect = <optimized out>
        regex = <optimized out>
        filename = <optimized out>
        mInfo = <optimized out>
        match = <optimized out>
        css = <optimized out>
        initialTheme = <optimized out>
        pos = <optimized out>
        themeRootName = <optimized out>
        err = <optimized out>
        style = <optimized out>
        pfd = <optimized out>
        pt = <optimized out>
        fontSize = <optimized out>
        isPix = <optimized out>
        resolution = <optimized out>
        err = <optimized out>
        cm = <optimized out>
        thm = <optimized out>
        error = <optimized out>
        ii = <optimized out>
        fpanelLabelGrid = <optimized out>
        fpl = <optimized out>
        lbq = <optimized out>
        iccProfileCreator = <optimized out>
        preferences = <optimized out>
        actionGrid = <optimized out>
        folderIcon = <optimized out>
        folderIcon = <optimized out>
        thm = <optimized out>
#9  0x00000000005d0a13 in (anonymous namespace)::create_rt_window ()
    at D:/RAWTHERAPEE/RTSOURCE/rawtherapee/rtgui/main.cc:253
        icon_path = {static npos = 18446744073709551615, string_ = {
            static npos = 18446744073709551615,
            _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_ahar>> = {<No data fields>}, <No data fields>},
              _M_p = 0x1047a8d0 "D:\\rawtherapee\\rtinstall\\spot-remolease64\\.\\images"}, _M_string_length = 60, {
              _M_local_buf = "<", '\000' <repeats 14 times>,
              _M_allocated_capacity = 60}}}
        defaultIconTheme = {pCppObject_ = 0x11c63870}
        rtWindow = <optimized out>
#10 0x00000000005d23aa in main (argc=<optimized out>, argv=<optimized
    at D:/RAWTHERAPEE/RTSOURCE/rawtherapee/rtgui/main.cc:558
        m = <incomplete type>
        rtWindow = <optimized out>
        gscale = <optimized out>
        exname = "D:\\rawtherapee\\rtinstall\\spot-removal-toolreleaserapee-debug.exe", '\000' <repeats 438 times>
        exePath = {static npos = 18446744073709551615, string_ = {
            static npos = 18446744073709551615,
            _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_ahar>> = {<No data fields>}, <No data fields>},
              _M_p = 0xf50ea30 "D:\\rawtherapee\\rtinstall\\spot-removease64"}, _M_string_length = 51, {
              _M_local_buf = "3\000\000\000\000\000\000\000`\231\235鈻掆枓 _M_allocated_capacity = 51}}}
        exnameU = L"D:\\rawtherapee\\rtinstall\\spot-removal-toolreleaherapee-debug.exe", '\000' <repeats 438 times>
        consoleOpened = false
        fatalError = {static npos = 18446744073709551615, string_ = {
            static npos = 18446744073709551615,
            _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_ahar>> = {<No data fields>}, <No data fields>}, _M_p = 0xc93f7d0 ""},
            _M_string_length = 0, {
              _M_local_buf = "\000\000\000\000\000\000\000\000\000鈻掆枓\0\000", _M_allocated_capacity = 0}}}
        ret = 0
(gdb)

@Hombre57 @gaaned92 Here's a fix:

diff --git a/rtgui/editwidgets.cc b/rtgui/editwidgets.cc
index 667b8cb37..129d81bc7 100644
--- a/rtgui/editwidgets.cc
+++ b/rtgui/editwidgets.cc
@@ -731,23 +731,23 @@ OPIcon::OPIcon(Glib::ustring normalImage, Glib::ustring activeImage, Glib::ustri
                Glib::ustring  draggedImage, Glib::ustring insensitiveImage, DrivenPoint drivenPoint) : drivenPoint(drivenPoint)
 {
     if (!normalImage.empty()) {
-        normalImg->setImage(normalImage);
+        normalImg = Cairo::RefPtr<RTSurface>(new RTSurface(normalImage));
     }

     if (!prelightImage.empty()) {
-        prelightImg->setImage(prelightImage);
+        prelightImg = Cairo::RefPtr<RTSurface>(new RTSurface(prelightImage));
     }

     if (!activeImage.empty()) {
-        activeImg->setImage(activeImage);
+        activeImg = Cairo::RefPtr<RTSurface>(new RTSurface(activeImage));
     }

     if (!draggedImage.empty()) {
-        draggedImg->setImage(draggedImage);
+        draggedImg = Cairo::RefPtr<RTSurface>(new RTSurface(draggedImage));
     }

     if (!insensitiveImage.empty()) {
-        insensitiveImg->setImage(insensitiveImage);
+        insensitiveImg = Cairo::RefPtr<RTSurface>(new RTSurface(insensitiveImage));
     }
 }

@Hombre57 It's this branch that has the DOS line endings.

@Hombre57 @Desmis you might want to set

git config --global core.autocrlf input
git config --global core.whitespace blank-at-eol,blank-at-eof,space-before-tab,tab-in-indent

https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration#_formatting_and_whitespace

We should set this across the whole repository at some point.

@Floessie Thanks for the fix, it's committed (and forgot the credit :disappointed: )

For the line endings, I overlooked that Eclipse used Windows line endings for new files. It's solved now, I configured Eclipse to use Unix line endings for new files. Files committed.

@Floessie @Beep6581 Damned ! In fact I should have committed the line endings to dev. It's done now. Sorry for this mess.

You shouldn't need to worry about line endings when git is set up to take care of that, but as I wrote, this is something we should do on the repo and not leave it up to every contributor. I'll leave that for after 5.6.

@Floessie I also committed your patch to dev. OPIcons are not used there, but I don't know if @Pandagrapher use them. Anyway, it shouldn't harm to fix a bug.

@Hombre57

Thanks for the fix, it's committed (and forgot the credit)

De rien. :smiley:

Was this page helpful?
0 / 5 - 0 ratings