Bug 257255 - graphics/rawtherapee: Crashes in rtengine::Color::rgb2lab01 when editing a picture; nullptr dereference related to color profile
Summary: graphics/rawtherapee: Crashes in rtengine::Color::rgb2lab01 when editing a pi...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: Matthias Andree
URL:
Keywords: crash
Depends on:
Blocks:
 
Reported: 2021-07-18 18:35 UTC by M. Draney
Modified: 2024-02-23 17:40 UTC (History)
6 users (show)

See Also:
mandree: maintainer-feedback+
mandree: merge-quarterly-


Attachments
Rawtherapee gdb crash log (419.30 KB, text/plain)
2021-09-10 21:36 UTC, M. Draney
no flags Details
screenshot from maintainer's RawTherapee (72.02 KB, image/png)
2021-09-13 14:24 UTC, Matthias Andree
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description M. Draney 2021-07-18 18:35:03 UTC
I start it up and it loads fine.  When I to edit a picture it loads the picture and then shortly crashes.  When starting up it gives me this error

Gtk-Message: 14:09:25.848: Failed to load module "colorreload-gtk-module"

I am running an up to date 13.0 and just updated packages.  There seems to be a regression somewhere because it used to work.  

I rebuilt it in ports to see if it would make and difference.  It did not.  I then rebuilt in and included Make_Debug=Yes in make.conf and ran it through gdb like the rawtherapee site mentions.  When it crashes it gives me this message.

Thread 1 received signal SIGSEGV, Segmentation fault.
0x0000000000ddb930 in rtengine::Color::rgb2lab01 (profile=..., profileW=..., 
    r=1, g=1, b=0, LAB_l=@0x7fffffffbc78: -nan(0x7fc900), 
    LAB_a=@0x7fffffffbc80: -nan(0x7fc900), 
    LAB_b=@0x7fffffffbc7c: 4.59163468e-41, workingSpace=false)
    at /usr/ports/graphics/rawtherapee/work/rawtherapee-5.8/rtengine/color.cc:483
483     /usr/ports/graphics/rawtherapee/work/rawtherapee-5.8/rtengine/color.cc: No such file or directory.

I searched for it and didn't find the file either.  The color does load horribly right before it crashes.  

Thanks!
Comment 1 Alexey Dokuchaev freebsd_committer freebsd_triage 2021-07-19 02:29:40 UTC
Over to maintainer.
Comment 2 Kubilay Kocak freebsd_committer freebsd_triage 2021-07-19 03:52:14 UTC
Seeing a Ports WRKDIR at runtime is seems odd
Comment 3 Matthias Andree freebsd_committer freebsd_triage 2021-07-19 14:22:06 UTC
@Kubilay, the WRKDIR is an artifact of WITH_DEBUG=yes that adds debug information. I don't see references to work or wrk in my build.

@M. Draney, I cannot reproduce this on my 13.0-RELEASE-p3 amd64.

Please make sure that all ports that rawtherapee depends on are fully updated, too, with consistent settings in make.conf, do not try to use nondefault compilers.  In doubt, check if you have nondefault settings somewhere (perhaps create a new user, copy over only your image and .pp3 file and retry) - just in case there is some stray configuration lingering.

rawtherapee is sensitive against mixing and match compiler versions or libc++/libstdc++, you may see failures.  

For better debugging, please leave the source in place after installing the port under "WITH_DEBUG=YES" in make.conf and installation, meaning, after "make install", do _not_ invoke "make clean".

If it continues to fail, please attach to this BR the following information:
- output of: ldd /usr/local/bin/rawtherapee
- output of (this goes on one line): sh -c 'ldd /usr/local/bin/rawtherapee | awk "/=>/{print \$3}" | xargs pkg which -q |sort -u' 
- after crash, in gdb, the output of these two commands:
-- bt full
-- thread apply all bt

the colorreload-gtk-module appears to be some leftover KDE/Plasma desktop configuration that requires the colorreload-gtk-module, you may be able to fix that warning by installing the x11-themes/plasma5-kde-gtk-config port or package.
Comment 4 Matthias Andree freebsd_committer freebsd_triage 2021-07-19 14:25:12 UTC
(In reply to Matthias Andree from comment #3)
you may need to start rawtherapee as:

gdb /usr/local/bin/rawtherapee

and once gdb has started up, type just one letter r and press the enter key to really launch RT.
Comment 5 Matthias Andree freebsd_committer freebsd_triage 2021-07-20 16:24:18 UTC
feel free to reopen if you can fill in missing information.
Comment 6 M. Draney 2021-08-27 20:01:43 UTC
I reinstall every package and rebuilt rawtherapee, and it still crashes when I go into the editor, open up a picture, and start to edit.  Strangely it seems to be associated when I use my mouse wheel.  Especially overtop the picture in an effort to zoom in and out.  The same error is produced.  Very strange.  Installing the plasma port did get rid of the other error.  I hope this helps.

ldd /usr/local/bin/rawtherapee
/usr/local/bin/rawtherapee:
	libc.so.7 => /lib/libc.so.7 (0x8017b4000)
	libcanberra-gtk3.so.0 => /usr/local/lib/libcanberra-gtk3.so.0 (0x801bc5000)
	libcanberra.so.0 => /usr/local/lib/libcanberra.so.0 (0x801bcc000)
	libgtk-3.so.0 => /usr/local/lib/libgtk-3.so.0 (0x801c00000)
	libgdk-3.so.0 => /usr/local/lib/libgdk-3.so.0 (0x8023bc000)
	libgobject-2.0.so.0 => /usr/local/lib/libgobject-2.0.so.0 (0x8024c1000)
	libglib-2.0.so.0 => /usr/local/lib/libglib-2.0.so.0 (0x802518000)
	libexpat.so.1 => /usr/local/lib/libexpat.so.1 (0x80264e000)
	libfftw3f.so.3 => /usr/local/lib/libfftw3f.so.3 (0x80267f000)
	libgiomm-2.4.so.1 => /usr/local/lib/libgiomm-2.4.so.1 (0x8027fe000)
	libglibmm-2.4.so.1 => /usr/local/lib/libglibmm-2.4.so.1 (0x802a03000)
	libsigc-2.0.so.0 => /usr/local/lib/libsigc-2.0.so.0 (0x801bde000)
	libgtkmm-3.0.so.1 => /usr/local/lib/libgtkmm-3.0.so.1 (0x802c00000)
	libatkmm-1.6.so.1 => /usr/local/lib/libatkmm-1.6.so.1 (0x802a98000)
	libgdkmm-3.0.so.1 => /usr/local/lib/libgdkmm-3.0.so.1 (0x802af0000)
	libpangomm-1.4.so.1 => /usr/local/lib/libpangomm-1.4.so.1 (0x802b54000)
	libcairomm-1.0.so.1 => /usr/local/lib/libcairomm-1.0.so.1 (0x802b89000)
	libiptcdata.so.0 => /usr/local/lib/libiptcdata.so.0 (0x801be7000)
	libjpeg.so.8 => /usr/local/lib/libjpeg.so.8 (0x80323e000)
	liblcms2.so.2 => /usr/local/lib/liblcms2.so.2 (0x8032d3000)
	libpng16.so.16 => /usr/local/lib/libpng16.so.16 (0x802bb5000)
	libz.so.6 => /lib/libz.so.6 (0x80333e000)
	libtiff.so.5 => /usr/local/lib/libtiff.so.5 (0x80335a000)
	liblensfun.so.2 => /usr/local/lib/liblensfun.so.2 (0x8033df000)
	librsvg-2.so.2 => /usr/local/lib/librsvg-2.so.2 (0x803600000)
	libm.so.5 => /lib/libm.so.5 (0x80342c000)
	libc++.so.1 => /usr/lib/libc++.so.1 (0x80345f000)
	libcxxrt.so.1 => /lib/libcxxrt.so.1 (0x803531000)
	libgomp.so.1 => /usr/local/lib/gcc10/libgomp.so.1 (0x804000000)
	libgcc_s.so.1 => /usr/local/lib/gcc10/libgcc_s.so.1 (0x80423d000)
	libatk-1.0.so.0 => /usr/local/lib/libatk-1.0.so.0 (0x803554000)
	libgio-2.0.so.0 => /usr/local/lib/libgio-2.0.so.0 (0x804455000)
	libgthread-2.0.so.0 => /usr/local/lib/libgthread-2.0.so.0 (0x801bf5000)
	libpangocairo-1.0.so.0 => /usr/local/lib/libpangocairo-1.0.so.0 (0x803584000)
	libpango-1.0.so.0 => /usr/local/lib/libpango-1.0.so.0 (0x803595000)
	libharfbuzz.so.0 => /usr/local/lib/libharfbuzz.so.0 (0x804624000)
	libgdk_pixbuf-2.0.so.0 => /usr/local/lib/libgdk_pixbuf-2.0.so.0 (0x804712000)
	libcairo-gobject.so.2 => /usr/local/lib/libcairo-gobject.so.2 (0x802bf4000)
	libcairo.so.2 => /usr/local/lib/libcairo.so.2 (0x804739000)
	libthr.so.3 => /lib/libthr.so.3 (0x804874000)
	libintl.so.8 => /usr/local/lib/libintl.so.8 (0x8035ed000)
	libX11.so.6 => /usr/local/lib/libX11.so.6 (0x8048a1000)
	libvorbisfile.so.3 => /usr/local/lib/libvorbisfile.so.3 (0x8049ec000)
	libltdl.so.7 => /usr/local/lib/libltdl.so.7 (0x8049f8000)
	libXinerama.so.1 => /usr/local/lib/libXinerama.so.1 (0x801bf9000)
	libXrandr.so.2 => /usr/local/lib/libXrandr.so.2 (0x804a05000)
	libXcursor.so.1 => /usr/local/lib/libXcursor.so.1 (0x804a12000)
	libXext.so.6 => /usr/local/lib/libXext.so.6 (0x804a20000)
	librt.so.1 => /usr/lib/librt.so.1 (0x804a35000)
	libgmodule-2.0.so.0 => /usr/local/lib/libgmodule-2.0.so.0 (0x804a3e000)
	libXi.so.6 => /usr/local/lib/libXi.so.6 (0x804a44000)
	libXcomposite.so.1 => /usr/local/lib/libXcomposite.so.1 (0x804a56000)
	libXdamage.so.1 => /usr/local/lib/libXdamage.so.1 (0x804a5b000)
	libXfixes.so.3 => /usr/local/lib/libXfixes.so.3 (0x804a60000)
	libatk-bridge-2.0.so.0 => /usr/local/lib/libatk-bridge-2.0.so.0 (0x804a68000)
	libxkbcommon.so.0 => /usr/local/lib/libxkbcommon.so.0 (0x804a9e000)
	libwayland-cursor.so.0 => /usr/local/lib/libwayland-cursor.so.0 (0x804ae4000)
	libwayland-egl.so.1 => /usr/local/lib/libwayland-egl.so.1 (0x8035fc000)
	libwayland-client.so.0 => /usr/local/lib/libwayland-client.so.0 (0x804aee000)
	libepoxy.so.0 => /usr/local/lib/libepoxy.so.0 (0x804b00000)
	libfribidi.so.0 => /usr/local/lib/libfribidi.so.0 (0x804c18000)
	libpangoft2-1.0.so.0 => /usr/local/lib/libpangoft2-1.0.so.0 (0x804c37000)
	libfontconfig.so.1 => /usr/local/lib/libfontconfig.so.1 (0x804c51000)
	libfreetype.so.6 => /usr/local/lib/libfreetype.so.6 (0x804c9e000)
	libffi.so.7 => /usr/local/lib/libffi.so.7 (0x804d62000)
	libpcre.so.1 => /usr/local/lib/libpcre.so.1 (0x804d6d000)
	libiconv.so.2 => /usr/local/lib/libiconv.so.2 (0x804e11000)
	libutil.so.9 => /lib/libutil.so.9 (0x804f10000)
	libXrender.so.1 => /usr/local/lib/libXrender.so.1 (0x804f28000)
	liblzma.so.5 => /usr/lib/liblzma.so.5 (0x804f34000)
	libjbig.so.2 => /usr/local/lib/libjbig.so.2 (0x804f60000)
	libxml2.so.2 => /usr/local/lib/libxml2.so.2 (0x804f70000)
	libdl.so.1 => /usr/lib/libdl.so.1 (0x80510b000)
	libgraphite2.so.3 => /usr/local/lib/libgraphite2.so.3 (0x80510f000)
	libpixman-1.so.0 => /usr/local/lib/libpixman-1.so.0 (0x80513b000)
	libEGL.so.1 => /usr/local/lib/libEGL.so.1 (0x805228000)
	libxcb-shm.so.0 => /usr/local/lib/libxcb-shm.so.0 (0x80523f000)
	libxcb.so.1 => /usr/local/lib/libxcb.so.1 (0x805245000)
	libxcb-render.so.0 => /usr/local/lib/libxcb-render.so.0 (0x805272000)
	libGL.so.1 => /usr/local/lib/libGL.so.1 (0x805283000)
	libvorbis.so.0 => /usr/local/lib/libvorbis.so.0 (0x80530f000)
	libogg.so.0 => /usr/local/lib/libogg.so.0 (0x805346000)
	libdbus-1.so.3 => /usr/local/lib/libdbus-1.so.3 (0x805351000)
	libatspi.so.0 => /usr/local/lib/libatspi.so.0 (0x8053a9000)
	libepoll-shim.so.0 => /usr/local/lib/libepoll-shim.so.0 (0x8053e1000)
	libbz2.so.4 => /usr/lib/libbz2.so.4 (0x8053ef000)
	libmd.so.6 => /lib/libmd.so.6 (0x805405000)
	libGLdispatch.so.0 => /usr/local/lib/libGLdispatch.so.0 (0x805423000)
	libXau.so.6 => /usr/local/lib/libXau.so.6 (0x8054db000)
	libXdmcp.so.6 => /usr/local/lib/libXdmcp.so.6 (0x8054e1000)
	libGLX.so.0 => /usr/local/lib/libGLX.so.0 (0x8054e9000)
	libexecinfo.so.1 => /usr/lib/libexecinfo.so.1 (0x80551e000)
	libelf.so.2 => /lib/libelf.so.2 (0x805524000)

sh -c 'ldd /usr/local/bin/rawtherapee | awk "/=>/{print \$3}" | xargs pkg which -q |sort -u'
at-spi2-atk-2.34.2
at-spi2-core-2.36.0
atk-2.36.0
atkmm-2.28.0
cairo-1.17.4,3
cairomm-1.12.2_4
dbus-1.12.20_5
expat-2.4.1
fftw3-float-3.3.9
fontconfig-2.13.93_1,1
freetype2-2.10.4
fribidi-1.0.10
gcc10-10.3.0
gdk-pixbuf2-2.40.0
gettext-runtime-0.21
glib-2.66.8,2
glibmm-2.64.2,1
graphite2-1.3.14
gtk3-3.24.29_1
gtkmm30-3.24.2
harfbuzz-2.8.1
jbigkit-2.1_1
jpeg-turbo-2.0.6
lcms2-2.12
lensfun-0.3.95_1
libX11-1.7.2,1
libXau-1.0.9
libXcomposite-0.4.5,1
libXcursor-1.2.0
libXdamage-1.1.5
libXdmcp-1.1.3
libXext-1.3.4,1
libXfixes-5.0.3_2
libXi-1.7.10,1
libXinerama-1.1.4_2,1
libXrandr-1.5.2
libXrender-0.9.10_2
libcanberra-0.30_5
libcanberra-gtk3-0.30_5
libepoll-shim-0.0.20210418
libepoxy-1.5.8_1
libffi-3.3_1
libglvnd-1.3.3
libiconv-1.16
libiptcdata-1.0.4_2
libltdl-2.4.6
libogg-1.3.5,4
librsvg2-rust-2.50.3_4
libsigc++-2.10.4
libvorbis-1.3.7_2,3
libxcb-1.14_1
libxkbcommon-1.3.0
libxml2-2.9.12
pango-1.48.4_1
pangomm-2.40.1_4
pcre-8.44
pixman-0.40.0_1
png-1.6.37_1
tiff-4.3.0
wayland-1.19.0_1
(gdb) bt full
#0  0x0000000000ddb930 in rtengine::Color::rgb2lab01(Glib::ustring const&, Glib::ustring const&, float, float, float, float&, float&, float&, bool)
    (profile=..., profileW=..., r=1, g=1, b=0, LAB_l=@0x7fffffffbe28: -nan(0x7fcab0), LAB_a=@0x7fffffffbe30: -nan(0x7fcab0), LAB_b=@0x7fffffffbe2c: 4.59163468e-41, workingSpace=false)
    at /usr/ports/graphics/rawtherapee/work/rawtherapee-5.8/rtengine/color.cc:483
        profileCalc = {static npos = 18446744073709551615, string_ = "sRGB"}
        wprof = 0x0
        xyz_rgb = 
            {{-nan(0x7fbde0), 4.59163468e-41, 1.52135275e-37}, {1.12103877e-44, -1.06849469e-12, -1.78599382e+37}, {3.93009116e-29, 1.12103877e-44, 1.40129846e-45}}
        var_X = 3.98482128e-29
        var_Y = 1.12103877e-44
        var_Z = 3.98482609e-29
        varxx = 1.12103877e-44
        varyy = -nan(0x7fbd90)
        varzz = 4.59163468e-41
#1  0x0000000000656649 in Navigator::pointerMoved(bool, Glib::ustring const&, Glib::ustring const&, int, int, int, int, int, bool)
    (this=0x80f29d900, validPos=true, profile=..., profileW=..., x=5150, y=1949, r=255, g=255, b=0, isRaw=false)
--Type <RET> for more, q to quit, c to continue without paging--
    at /usr/ports/graphics/rawtherapee/work/rawtherapee-5.8/rtgui/navigator.cc:309
        s = 1
        LAB_a = -nan(0x7fcab0)
        h = 0.166666672
        v = 1
        LAB_b = 4.59163468e-41
        LAB_l = -nan(0x7fcab0)
        s1 = {static npos = 18446744073709551615, string_ = "60.0°"}
        s2 = {static npos = 18446744073709551615, string_ = "100.0%"}
        s3 = {static npos = 18446744073709551615, string_ = "100.0%"}
#2  0x00000000008d3e26 in CropWindow::pointerMoved(int, int, int)
    (this=0x80ccb8000, bstate=0, x=532, y=348)
    at /usr/ports/graphics/rawtherapee/work/rawtherapee-5.8/rtgui/cropwindow.cc:1134
        pix = 0x837668025 "\377\377"
        gval = 255
        rval = 255
        bval = 0
        isRaw = false
        ipc = 0x80767a800
        vx = 531
        vy = 201
--Type <RET> for more, q to quit, c to continue without paging--
        imwidth = 537
        imheight = 400
        mx = 5150
        my = 1949
        lock = 
          {<rtengine::NonCopyable> = {<No data fields>}, mutex = @0x80ccb81e8, locked = true}
        editSubscriber = 0x0
        oRA = false
#3  0x0000000000acff58 in ImageArea::on_motion_notify_event(_GdkEventMotion*)
    (this=0x80ca08600, event=0x80cd49040)
    at /usr/ports/graphics/rawtherapee/work/rawtherapee-5.8/rtgui/imagearea.cc:277
        cw = 0x80ccb8000
#4  0x000000080311c72a in Gtk::Widget_Class::motion_notify_event_callback(_GtkWidget*, _GdkEventMotion*) () at /usr/local/lib/libgtkmm-3.0.so.1
#5  0x000000080238c741 in  () at /usr/local/lib/libgtk-3.so.0
#6  0x00000008024ec426 in  () at /usr/local/lib/libgobject-2.0.so.0
#7  0x00000008025023e1 in g_signal_emit_valist ()
    at /usr/local/lib/libgobject-2.0.so.0
#8  0x0000000802502e36 in g_signal_emit ()
    at /usr/local/lib/libgobject-2.0.so.0
#9  0x00000008023396d9 in  () at /usr/local/lib/libgtk-3.so.0
--Type <RET> for more, q to quit, c to continue without paging--
#10 0x00000008021d4f83 in gtk_propagate_event ()
    at /usr/local/lib/libgtk-3.so.0
#11 0x00000008021d4b0f in gtk_main_do_event () at /usr/local/lib/libgtk-3.so.0
#12 0x000000080243f091 in  () at /usr/local/lib/libgdk-3.so.0
#13 0x0000000802474587 in  () at /usr/local/lib/libgdk-3.so.0
#14 0x00000008025f412e in g_main_context_dispatch ()
    at /usr/local/lib/libglib-2.0.so.0
#15 0x00000008025f44d4 in  () at /usr/local/lib/libglib-2.0.so.0
#16 0x00000008025f481a in g_main_loop_run () at /usr/local/lib/libglib-2.0.so.0
#17 0x00000008021d443b in gtk_main () at /usr/local/lib/libgtk-3.so.0
#18 0x000000080309f1df in Gtk::Main::run(Gtk::Window&) ()
    at /usr/local/lib/libgtkmm-3.0.so.1
#19 0x0000000000b2fbc3 in main(int, char**) (argc=1, argv=0x7fffffffe898)
    at /usr/ports/graphics/rawtherapee/work/rawtherapee-5.8/rtgui/main.cc:568
        m = <incomplete type>
        rtWindow = std::unique_ptr<RTWindow> = 0x805ad6440
        fatalError = {static npos = 18446744073709551615, string_ = ""}
        ret = 0

(gdb) thread apply all bt

Thread 329 (LWP 105085 of process 14702):
#0  0x00000008018ee52a in _umtx_op () at /lib/libc.so.7
#1  0x000000080186cb18 in sem_clockwait_np () at /lib/libc.so.7
#2  0x000000080401dce4 in  () at /usr/local/lib/gcc10/libgomp.so.1
#3  0x000000080401de1f in  () at /usr/local/lib/gcc10/libgomp.so.1
#4  0x000000080401b7b8 in  () at /usr/local/lib/gcc10/libgomp.so.1
#5  0x000000080488482b in  () at /lib/libthr.so.3
#6  0x0000000000000000 in  ()

Thread 328 (LWP 105083 of process 14702):
#0  0x00000008018ee52a in _umtx_op () at /lib/libc.so.7
#1  0x000000080186cb18 in sem_clockwait_np () at /lib/libc.so.7
#2  0x000000080401dce4 in  () at /usr/local/lib/gcc10/libgomp.so.1
#3  0x000000080401de1f in  () at /usr/local/lib/gcc10/libgomp.so.1
#4  0x000000080401b7b8 in  () at /usr/local/lib/gcc10/libgomp.so.1
#5  0x000000080488482b in  () at /lib/libthr.so.3
#6  0x0000000000000000 in  ()

Thread 327 (LWP 105084 of process 14702):
#0  0x00000008018ee52a in _umtx_op () at /lib/libc.so.7
#1  0x000000080186cb18 in sem_clockwait_np () at /lib/libc.so.7
#2  0x000000080401dce4 in  () at /usr/local/lib/gcc10/libgomp.so.1
--Type <RET> for more, q to quit, c to continue without paging--
#3  0x000000080401de1f in  () at /usr/local/lib/gcc10/libgomp.so.1
#4  0x000000080401b7b8 in  () at /usr/local/lib/gcc10/libgomp.so.1
#5  0x000000080488482b in  () at /lib/libthr.so.3
#6  0x0000000000000000 in  ()

Thread 326 (LWP 105082 of process 14702 "pool-rawtherape"):
#0  0x0000000804881b3c in  () at /lib/libthr.so.3
#1  0x0000000804891660 in  () at /lib/libthr.so.3
#2  0x00000008048835f6 in  () at /lib/libthr.so.3
#3  0x0000000802648337 in g_cond_wait_until () at /usr/local/lib/libglib-2.0.so.0
#4  0x00000008025bfc56 in  () at /usr/local/lib/libglib-2.0.so.0
#5  0x00000008025bfdb8 in g_async_queue_timeout_pop () at /usr/local/lib/libglib-2.0.so.0
#6  0x000000080261ff6b in  () at /usr/local/lib/libglib-2.0.so.0
#7  0x000000080261ebf2 in  () at /usr/local/lib/libglib-2.0.so.0
#8  0x000000080488482b in  () at /lib/libthr.so.3
#9  0x0000000000000000 in  ()

Thread 105 (LWP 104838 of process 14702 "dconf worker"):
#0  0x00000008018ef56a in _poll () at /lib/libc.so.7
#1  0x000000080488ff56 in  () at /lib/libthr.so.3
#2  0x00000008025f4471 in  () at /usr/local/lib/libglib-2.0.so.0
--Type <RET> for more, q to quit, c to continue without paging--
#3  0x00000008025f4596 in g_main_context_iteration () at /usr/local/lib/libglib-2.0.so.0
#4  0x00000008077f946d in  () at /usr/local/lib/gio/modules/libdconfsettings.so
#5  0x000000080261ebf2 in  () at /usr/local/lib/libglib-2.0.so.0
#6  0x000000080488482b in  () at /lib/libthr.so.3
#7  0x0000000000000000 in  ()

Thread 7 (LWP 104694 of process 14702 "gdbus"):
#0  0x00000008018ef56a in _poll () at /lib/libc.so.7
#1  0x000000080488ff56 in  () at /lib/libthr.so.3
#2  0x00000008025f4471 in  () at /usr/local/lib/libglib-2.0.so.0
#3  0x00000008025f481a in g_main_loop_run () at /usr/local/lib/libglib-2.0.so.0
#4  0x00000008045ec0db in  () at /usr/local/lib/libgio-2.0.so.0
#5  0x000000080261ebf2 in  () at /usr/local/lib/libglib-2.0.so.0
#6  0x000000080488482b in  () at /lib/libthr.so.3
#7  0x0000000000000000 in  ()

Thread 6 (LWP 104693 of process 14702 "gmain"):
#0  0x00000008018ef56a in _poll () at /lib/libc.so.7
#1  0x000000080488ff56 in  () at /lib/libthr.so.3
#2  0x00000008025f4471 in  () at /usr/local/lib/libglib-2.0.so.0
#3  0x00000008025f4596 in g_main_context_iteration () at /usr/local/lib/libglib-2.0.so.0
--Type <RET> for more, q to quit, c to continue without paging--
#4  0x00000008025f65d1 in  () at /usr/local/lib/libglib-2.0.so.0
#5  0x000000080261ebf2 in  () at /usr/local/lib/libglib-2.0.so.0
#6  0x000000080488482b in  () at /lib/libthr.so.3
#7  0x0000000000000000 in  ()

Thread 5 (LWP 104692 of process 14702 "pool-spawner"):
#0  0x0000000804881b3c in  () at /lib/libthr.so.3
#1  0x0000000804891660 in  () at /lib/libthr.so.3
#2  0x000000080488369f in  () at /lib/libthr.so.3
#3  0x0000000802648185 in g_cond_wait () at /usr/local/lib/libglib-2.0.so.0
#4  0x00000008025bfc35 in  () at /usr/local/lib/libglib-2.0.so.0
#5  0x000000080261f1f8 in  () at /usr/local/lib/libglib-2.0.so.0
#6  0x000000080261ebf2 in  () at /usr/local/lib/libglib-2.0.so.0
#7  0x000000080488482b in  () at /lib/libthr.so.3
#8  0x0000000000000000 in  ()

Thread 4 (LWP 104691 of process 14702):
#0  0x00000008018ee52a in _umtx_op () at /lib/libc.so.7
#1  0x000000080186cb18 in sem_clockwait_np () at /lib/libc.so.7
#2  0x000000080401dce4 in  () at /usr/local/lib/gcc10/libgomp.so.1
#3  0x000000080401de1f in  () at /usr/local/lib/gcc10/libgomp.so.1
#4  0x000000080401b7b8 in  () at /usr/local/lib/gcc10/libgomp.so.1
#5  0x000000080488482b in  () at /lib/libthr.so.3
--Type <RET> for more, q to quit, c to continue without paging--
#6  0x0000000000000000 in  ()

Thread 3 (LWP 104690 of process 14702):
#0  0x00000008018ee52a in _umtx_op () at /lib/libc.so.7
#1  0x000000080186cb18 in sem_clockwait_np () at /lib/libc.so.7
#2  0x000000080401dce4 in  () at /usr/local/lib/gcc10/libgomp.so.1
#3  0x000000080401de1f in  () at /usr/local/lib/gcc10/libgomp.so.1
#4  0x000000080401b7b8 in  () at /usr/local/lib/gcc10/libgomp.so.1
#5  0x000000080488482b in  () at /lib/libthr.so.3
#6  0x0000000000000000 in  ()

Thread 2 (LWP 104689 of process 14702):
#0  0x00000008018ee52a in _umtx_op () at /lib/libc.so.7
#1  0x000000080186cb18 in sem_clockwait_np () at /lib/libc.so.7
#2  0x000000080401dce4 in  () at /usr/local/lib/gcc10/libgomp.so.1
#3  0x000000080401de1f in  () at /usr/local/lib/gcc10/libgomp.so.1
#4  0x000000080401b7b8 in  () at /usr/local/lib/gcc10/libgomp.so.1
#5  0x000000080488482b in  () at /lib/libthr.so.3
#6  0x0000000000000000 in  ()

Thread 1 (LWP 103441 of process 14702):
#0  0x0000000000ddb930 in rtengine::Color::rgb2lab01(Glib::ustring const&, Glib::ustring const&, float, float, float, float&, float&, float&, bool) (profile=...--Type <RET> for more, q to quit, c to continue without paging--
, profileW=..., r=1, g=1, b=0, LAB_l=@0x7fffffffbe28: -nan(0x7fcab0), LAB_a=@0x7fffffffbe30: -nan(0x7fcab0), LAB_b=@0x7fffffffbe2c: 4.59163468e-41, workingSpace=false) at /usr/ports/graphics/rawtherapee/work/rawtherapee-5.8/rtengine/color.cc:483
#1  0x0000000000656649 in Navigator::pointerMoved(bool, Glib::ustring const&, Glib::ustring const&, int, int, int, int, int, bool) (this=0x80f29d900, validPos=true, profile=..., profileW=..., x=5150, y=1949, r=255, g=255, b=0, isRaw=false) at /usr/ports/graphics/rawtherapee/work/rawtherapee-5.8/rtgui/navigator.cc:309
#2  0x00000000008d3e26 in CropWindow::pointerMoved(int, int, int) (this=0x80ccb8000, bstate=0, x=532, y=348) at /usr/ports/graphics/rawtherapee/work/rawtherapee-5.8/rtgui/cropwindow.cc:1134
#3  0x0000000000acff58 in ImageArea::on_motion_notify_event(_GdkEventMotion*) (this=0x80ca08600, event=0x80cd49040) at /usr/ports/graphics/rawtherapee/work/rawtherapee-5.8/rtgui/imagearea.cc:277
#4  0x000000080311c72a in Gtk::Widget_Class::motion_notify_event_callback(_GtkWidget*, _GdkEventMotion*) () at /usr/local/lib/libgtkmm-3.0.so.1
#5  0x000000080238c741 in  () at /usr/local/lib/libgtk-3.so.0
#6  0x00000008024ec426 in  () at /usr/local/lib/libgobject-2.0.so.0
#7  0x00000008025023e1 in g_signal_emit_valist () at /usr/local/lib/libgobject-2.0.so.0
#8  0x0000000802502e36 in g_signal_emit () at /usr/local/lib/libgobject-2.0.so.0
#9  0x00000008023396d9 in  () at /usr/local/lib/libgtk-3.so.0
--Type <RET> for more, q to quit, c to continue without paging--
#10 0x00000008021d4f83 in gtk_propagate_event () at /usr/local/lib/libgtk-3.so.0
#11 0x00000008021d4b0f in gtk_main_do_event () at /usr/local/lib/libgtk-3.so.0
#12 0x000000080243f091 in  () at /usr/local/lib/libgdk-3.so.0
#13 0x0000000802474587 in  () at /usr/local/lib/libgdk-3.so.0
#14 0x00000008025f412e in g_main_context_dispatch () at /usr/local/lib/libglib-2.0.so.0
#15 0x00000008025f44d4 in  () at /usr/local/lib/libglib-2.0.so.0
#16 0x00000008025f481a in g_main_loop_run () at /usr/local/lib/libglib-2.0.so.0
#17 0x00000008021d443b in gtk_main () at /usr/local/lib/libgtk-3.so.0
#18 0x000000080309f1df in Gtk::Main::run(Gtk::Window&) () at /usr/local/lib/libgtkmm-3.0.so.1
#19 0x0000000000b2fbc3 in main(int, char**) (argc=1, argv=0x7fffffffe898) at /usr/ports/graphics/rawtherapee/work/rawtherapee-5.8/rtgui/main.cc:568
Comment 7 M. Draney 2021-09-10 21:36:43 UTC
Created attachment 227815 [details]
Rawtherapee gdb crash log

I attached the log file.  I completed the actions as described on Rawtherapee's site.  Thanks for the help so far.  Maybe a fix will be found.
Comment 8 Matthias Andree freebsd_committer freebsd_triage 2021-09-11 08:12:23 UTC
so, can you share your .pp3 file and possibly the image and upload it somewhere, and describe the steps to trigger this?

Does the crash happen if you use different processing and/or display profiles or proofing options?


The crash location in the code is the xyz_rgb matrix element assignment here, when prof comes up as empty. These are lines 481ff, the crash is on 483 when wprof == 0x0 (nullptr) is dereferenced.

    const TMatrix wprof = rtengine::ICCStore::getInstance()->workingSpaceMatrix(profileCalc);

    const float xyz_rgb[3][3] = { {static_cast<float>(wprof[0][0]), static_cast<float>(wprof[0][1]), static_cast<float>(wprof[0][2])},
                                  {static_cast<float>(wprof[1][0]), static_cast<float>(wprof[1][1]), static_cast<float>(wprof[1][2])},
                                  {static_cast<float>(wprof[2][0]), static_cast<float>(wprof[2][1]), static_cast<float>(wprof[2][2])}
                                };
Comment 9 Matthias Andree freebsd_committer freebsd_triage 2021-09-11 08:26:58 UTC
Filed report upstream. https://github.com/Beep6581/RawTherapee/issues/6357
Comment 10 Matthias Andree freebsd_committer freebsd_triage 2021-09-11 08:31:36 UTC
For further debugging, I checked rtengine/iccstore.cc as well, and it would appear at first glance that for the wProfiles, the "second" member of the sRGB profile is zero because that's both used as first try and if not found, also as fallback. This is iccstore.cc code:

    using ProfileMap = std::map<Glib::ustring, cmsHPROFILE>;
...
    MatrixMap wMatrices;
...
    TMatrix workingSpaceMatrix(const Glib::ustring& name) const
    {
        const MatrixMap::const_iterator r = wMatrices.find(name);

        return
            r != wMatrices.end()
            ? r->second
            : wMatrices.find("sRGB")->second;
    }
Comment 11 M. Draney 2021-09-11 19:10:56 UTC
I forwarded you a location where an example Olympus raw file is included along with its pp3 file.  I also tried a Sony raw file with the same results.  I have some Nikon ones around here too but I haven't tried them.

To reproduce it is pretty simple.  Open up rawtherapee and use its file browser to navigate to the folder with the files, which works file.  Then I enter the editor.  As long as I don't click on any files, it loads all of the pictures in the folder fine.  When I click on a file, it loads its properties, sharpening, etc. seemingly fine in the little loader at the bottom.  Here is where it gets strange and seems to correlate with what you are seeing in the code if I am understanding it correctly.  It initially seems to load it either totally black or extremely dull and muted.  In this case, I was able to set the profile to neutral before it crashed which helped.  Then I started to adjust a couple properties, and it died.  It does seem to be related to clicking into the image part of the window.  I was able to adjust things before I did that.  I tried it again and it seems to be consistent if I open rawtherapee first.  If I open a file directly with rawtherapee straight from a file manager it dies immediately when it opens and loads without any interaction.

It is in the default configuration because I deleted all of the settings, cache, etc. before submitting this to try to fix it.
Comment 12 Matthias Andree freebsd_committer freebsd_triage 2021-09-13 14:24:00 UTC
Created attachment 227875 [details]
screenshot from maintainer's RawTherapee

I have downloaded the .ORF and .pp3 files and put them in a separate folder, and am sorry to say that I cannot reproduce the crash.  

Zooming, shifting, changing color profiles, RT works.  Upstream has asked whether I can reproduce this with a development version from Git, or else can provide the files - but I wonder if it's a matter of the files, or of your setup.

What I am currently thinking is if you are having any color profile issues with the graphics driver, monitors, desktop or something.  
Are you using Gnome? Plasma? Some other session/window managers? 

I am attaching a screenshot from the colors tab in RawTherapee and am wondering if you are getting that far at all to compare it.

Can you install darktable and run darktable-cmstest in a terminal running in your graphical session?
Comment 13 Matthias Andree freebsd_committer freebsd_triage 2021-09-13 14:25:32 UTC
Also, can you run:

colormgr get-devices

colormgr get-profiles

and show their respective output? You may want to remove serial numbers of monitors, if present.
Comment 14 M. Draney 2021-11-07 22:25:38 UTC
I figured out the likely culprit though I don't have a true solution but have some workarounds.  It appears to be related to the drm-kmod amdgpu driver.  I switched to vesa, and it worked.  I put in an older nvidia card, and it worked.  Generally I just use openbox and xfce, but I installed gnome and gdm and gnome would only come up as a blank gray screen where you couldn't do anything.  I had not been using a display manager before this.  I found bug #255049 and that lead me to the vesa resolution.  Gnome and gdm also work when I switched to vesa and the nvidia driver.  I don't know if it is completely related, but it is suspicious. 

Here is what you requested.  colormgr get-devices didn't provide anything.

darktable-cmstest version 3.6.1
this executable was built with colord support enabled
darktable itself was built with colord support enabled

couldn't locate primary CRTC!
CRTC for screen 0 CRTC 1 has no mode or no output, skipping
CRTC for screen 0 CRTC 2 has no mode or no output, skipping
CRTC for screen 0 CRTC 3 has no mode or no output, skipping
CRTC for screen 0 CRTC 4 has no mode or no output, skipping
CRTC for screen 0 CRTC 5 has no mode or no output, skipping

DVI-I-1 the X atom and colord returned different profiles
        X atom: _ICC_PROFILE (0 bytes)
                description: (none)
        colord: "/usr/local/etc/gdm/home/.local/share/icc/edid-e457da63e7c1ee2b2f35eaf330fbd2be.icc"
                description: SyncMaster

Better check your system setup
 - some monitors reported different profiles
You may experience inconsistent color rendition between color managed applications

Object Path:   /org/freedesktop/ColorManager/profiles/icc_3d74acf8aeed88a831c179883b278819
Owner:         root
Format:        ColorSpace..
Title:         Compatible with Adobe RGB (1998)
Qualifier:     RGB..
Type:          display-device
Colorspace:    rgb
Gamma Table:   No
System Wide:   Yes
Filename:      /usr/local/share/color/icc/colord/AdobeRGB1998.icc
Profile ID:    icc-3d74acf8aeed88a831c179883b278819
Metadata:      FILE_checksum=3d74acf8aeed88a831c179883b278819

Object Path:   /org/freedesktop/ColorManager/profiles/icc_df3b46e0a74248c864e3de56f7369925
Owner:         root
Format:        ColorSpace..
Title:         Apple RGB
Qualifier:     RGB..
Type:          display-device
Colorspace:    rgb
Gamma Table:   No
System Wide:   Yes
Filename:      /usr/local/share/color/icc/colord/AppleRGB.icc
Profile ID:    icc-df3b46e0a74248c864e3de56f7369925
Metadata:      FILE_checksum=df3b46e0a74248c864e3de56f7369925

Object Path:   /org/freedesktop/ColorManager/profiles/icc_a285de0b2c739ccf57977b381b9154b3
Owner:         root
Format:        ColorSpace..
Title:         Best RGB
Qualifier:     RGB..
Type:          display-device
Colorspace:    rgb
Gamma Table:   No
System Wide:   Yes
Filename:      /usr/local/share/color/icc/colord/BestRGB.icc
Profile ID:    icc-a285de0b2c739ccf57977b381b9154b3
Metadata:      FILE_checksum=a285de0b2c739ccf57977b381b9154b3

Object Path:   /org/freedesktop/ColorManager/profiles/icc_875ad1a813eee25eecaad5a4c3572881
Owner:         root
Format:        ColorSpace..
Title:         Beta RGB
Qualifier:     RGB..
Type:          display-device
Colorspace:    rgb
Gamma Table:   No
System Wide:   Yes
Filename:      /usr/local/share/color/icc/colord/BetaRGB.icc
Profile ID:    icc-875ad1a813eee25eecaad5a4c3572881
Metadata:      FILE_checksum=875ad1a813eee25eecaad5a4c3572881

Object Path:   /org/freedesktop/ColorManager/profiles/icc_b140ae6eefdfa34aebb2a6ec091797b5
Owner:         root
Format:        ColorSpace..
Title:         Blue
Qualifier:     RGB..
Type:          display-device
Colorspace:    rgb
Gamma Table:   Yes
System Wide:   Yes
Filename:      /usr/local/share/color/icc/colord/Bluish.icc
Profile ID:    icc-b140ae6eefdfa34aebb2a6ec091797b5
Metadata:      FILE_checksum=b140ae6eefdfa34aebb2a6ec091797b5

Object Path:   /org/freedesktop/ColorManager/profiles/icc_79adadd2eb07684bf916168e327dec5a
Owner:         root
Format:        ColorSpace..
Title:         Bruce RGB
Qualifier:     RGB..
Type:          display-device
Colorspace:    rgb
Gamma Table:   No
System Wide:   Yes
Filename:      /usr/local/share/color/icc/colord/BruceRGB.icc
Profile ID:    icc-79adadd2eb07684bf916168e327dec5a
Metadata:      FILE_checksum=79adadd2eb07684bf916168e327dec5a

Object Path:   /org/freedesktop/ColorManager/profiles/icc_5d37a46695af7b7831aec25c6671f162
Owner:         root
Format:        ColorSpace..
Title:         CIE RGB
Qualifier:     RGB..
Type:          display-device
Colorspace:    rgb
Gamma Table:   No
System Wide:   Yes
Filename:      /usr/local/share/color/icc/colord/CIE-RGB.icc
Profile ID:    icc-5d37a46695af7b7831aec25c6671f162
Metadata:      FILE_checksum=5d37a46695af7b7831aec25c6671f162

Object Path:   /org/freedesktop/ColorManager/profiles/icc_07ca886b282c945eacc63861a4cc472b
Owner:         root
Format:        ColorSpace..
Title:         ColorMatch RGB
Qualifier:     RGB..
Type:          display-device
Colorspace:    rgb
Gamma Table:   No
System Wide:   Yes
Filename:      /usr/local/share/color/icc/colord/ColorMatchRGB.icc
Profile ID:    icc-07ca886b282c945eacc63861a4cc472b
Metadata:      FILE_checksum=07ca886b282c945eacc63861a4cc472b

Object Path:   /org/freedesktop/ColorManager/profiles/icc_5b78f9ee1385dff4edd6bbeefb1201e1
Owner:         root
Title:         Crayon Colors
Type:          named-color
Colorspace:    lab
Gamma Table:   No
System Wide:   Yes
Filename:      /usr/local/share/color/icc/colord/Crayons.icc
Profile ID:    icc-5b78f9ee1385dff4edd6bbeefb1201e1
Metadata:      FILE_checksum=5b78f9ee1385dff4edd6bbeefb1201e1

Object Path:   /org/freedesktop/ColorManager/profiles/icc_fb349611c3283aa1f7cd51b5bc53a1da
Owner:         root
Format:        ColorSpace..
Title:         Don RGB 4
Qualifier:     RGB..
Type:          display-device
Colorspace:    rgb
Gamma Table:   No
System Wide:   Yes
Filename:      /usr/local/share/color/icc/colord/DonRGB4.icc
Profile ID:    icc-fb349611c3283aa1f7cd51b5bc53a1da
Metadata:      FILE_checksum=fb349611c3283aa1f7cd51b5bc53a1da

Object Path:   /org/freedesktop/ColorManager/profiles/icc_b5004b8c55021c5c67553b1231a2c0c7
Owner:         root
Format:        ColorSpace..
Title:         eciRGB v1
Qualifier:     RGB..
Type:          display-device
Colorspace:    rgb
Gamma Table:   No
System Wide:   Yes
Filename:      /usr/local/share/color/icc/colord/ECI-RGBv1.icc
Profile ID:    icc-b5004b8c55021c5c67553b1231a2c0c7
Metadata:      FILE_checksum=b5004b8c55021c5c67553b1231a2c0c7

Object Path:   /org/freedesktop/ColorManager/profiles/icc_455903f8ea72da3f22cae736a425dbdb
Owner:         root
Format:        ColorSpace..
Title:         eciRGB v2
Qualifier:     RGB..
Type:          display-device
Colorspace:    rgb
Gamma Table:   No
System Wide:   Yes
Filename:      /usr/local/share/color/icc/colord/ECI-RGBv2.icc
Profile ID:    icc-455903f8ea72da3f22cae736a425dbdb
Metadata:      FILE_checksum=455903f8ea72da3f22cae736a425dbdb

Object Path:   /org/freedesktop/ColorManager/profiles/icc_de37f7f5846b2b38eee8aada580e970c
Owner:         root
Format:        ColorSpace..
Title:         Ekta Space PS5
Qualifier:     RGB..
Type:          display-device
Colorspace:    rgb
Gamma Table:   No
System Wide:   Yes
Filename:      /usr/local/share/color/icc/colord/EktaSpacePS5.icc
Profile ID:    icc-de37f7f5846b2b38eee8aada580e970c
Metadata:      FILE_checksum=de37f7f5846b2b38eee8aada580e970c

Object Path:   /org/freedesktop/ColorManager/profiles/icc_4f474d10c8bab91e7e0fb2fd60075ea6
Owner:         root
Format:        ColorSpace..
Title:         D50
Qualifier:     RGB..
Type:          display-device
Colorspace:    rgb
Gamma Table:   Yes
System Wide:   Yes
Filename:      /usr/local/share/color/icc/colord/Gamma5000K.icc
Profile ID:    icc-4f474d10c8bab91e7e0fb2fd60075ea6
Metadata:      FILE_checksum=4f474d10c8bab91e7e0fb2fd60075ea6

Object Path:   /org/freedesktop/ColorManager/profiles/icc_0acc37dcba8d538ab57e85a2223464dd
Owner:         root
Format:        ColorSpace..
Title:         D55
Qualifier:     RGB..
Type:          display-device
Colorspace:    rgb
Gamma Table:   Yes
System Wide:   Yes
Filename:      /usr/local/share/color/icc/colord/Gamma5500K.icc
Profile ID:    icc-0acc37dcba8d538ab57e85a2223464dd
Metadata:      FILE_checksum=0acc37dcba8d538ab57e85a2223464dd

Object Path:   /org/freedesktop/ColorManager/profiles/icc_195874ee3aa96736c57d194f938f5d8e
Owner:         root
Format:        ColorSpace..
Title:         D65
Qualifier:     RGB..
Type:          display-device
Colorspace:    rgb
Gamma Table:   Yes
System Wide:   Yes
Filename:      /usr/local/share/color/icc/colord/Gamma6500K.icc
Profile ID:    icc-195874ee3aa96736c57d194f938f5d8e
Metadata:      FILE_checksum=195874ee3aa96736c57d194f938f5d8e

Object Path:   /org/freedesktop/ColorManager/profiles/icc_997dbe17fd0bfb8690965bb49d0746b6
Owner:         root
Format:        ColorSpace..
Title:         NTSC RGB
Qualifier:     RGB..
Type:          display-device
Colorspace:    rgb
Gamma Table:   No
System Wide:   Yes
Filename:      /usr/local/share/color/icc/colord/NTSC-RGB.icc
Profile ID:    icc-997dbe17fd0bfb8690965bb49d0746b6
Metadata:      FILE_checksum=997dbe17fd0bfb8690965bb49d0746b6

Object Path:   /org/freedesktop/ColorManager/profiles/icc_9d157488c0a52557655a75bdf8ba4f89
Owner:         root
Format:        ColorSpace..
Title:         PAL/SECAM RGB
Qualifier:     RGB..
Type:          display-device
Colorspace:    rgb
Gamma Table:   No
System Wide:   Yes
Filename:      /usr/local/share/color/icc/colord/PAL-RGB.icc
Profile ID:    icc-9d157488c0a52557655a75bdf8ba4f89
Metadata:      FILE_checksum=9d157488c0a52557655a75bdf8ba4f89

Object Path:   /org/freedesktop/ColorManager/profiles/icc_f5fa250d22d93a4bec396b7c9cefbfe3
Owner:         root
Format:        ColorSpace..
Title:         ProPhoto RGB
Qualifier:     RGB..
Type:          display-device
Colorspace:    rgb
Gamma Table:   No
System Wide:   Yes
Filename:      /usr/local/share/color/icc/colord/ProPhotoRGB.icc
Profile ID:    icc-f5fa250d22d93a4bec396b7c9cefbfe3
Metadata:      FILE_checksum=f5fa250d22d93a4bec396b7c9cefbfe3

Object Path:   /org/freedesktop/ColorManager/profiles/icc_1b68e6f31ffddcf303dc416ceedce045
Owner:         root
Format:        ColorSpace..
Title:         SMPTE-C RGB
Qualifier:     RGB..
Type:          display-device
Colorspace:    rgb
Gamma Table:   No
System Wide:   Yes
Filename:      /usr/local/share/color/icc/colord/SMPTE-C-RGB.icc
Profile ID:    icc-1b68e6f31ffddcf303dc416ceedce045
Metadata:      FILE_checksum=1b68e6f31ffddcf303dc416ceedce045

Object Path:   /org/freedesktop/ColorManager/profiles/icc_e5ad615cc8e4068dcb07c52c340c1e3d
Owner:         root
Format:        ColorSpace..
Title:         Swapped Red and Green
Qualifier:     RGB..
Type:          display-device
Colorspace:    rgb
Gamma Table:   No
System Wide:   Yes
Filename:      /usr/local/share/color/icc/colord/SwappedRedAndGreen.icc
Profile ID:    icc-e5ad615cc8e4068dcb07c52c340c1e3d
Metadata:      FILE_checksum=e5ad615cc8e4068dcb07c52c340c1e3d

Object Path:   /org/freedesktop/ColorManager/profiles/icc_ae4f500774ceb46e61da718631778bb3
Owner:         root
Format:        ColorSpace..
Title:         Wide Gamut RGB
Qualifier:     RGB..
Type:          display-device
Colorspace:    rgb
Gamma Table:   No
System Wide:   Yes
Filename:      /usr/local/share/color/icc/colord/WideGamutRGB.icc
Profile ID:    icc-ae4f500774ceb46e61da718631778bb3
Metadata:      FILE_checksum=ae4f500774ceb46e61da718631778bb3

Object Path:   /org/freedesktop/ColorManager/profiles/icc_8c0c6e8a6fa92663143e8bbe73349e40
Owner:         root
Format:        ColorSpace..
Title:         sRGB
Qualifier:     RGB..
Type:          display-device
Colorspace:    rgb
Gamma Table:   No
System Wide:   Yes
Filename:      /usr/local/share/color/icc/colord/sRGB.icc
Profile ID:    icc-8c0c6e8a6fa92663143e8bbe73349e40
Metadata:      FILE_checksum=8c0c6e8a6fa92663143e8bbe73349e40

Object Path:   /org/freedesktop/ColorManager/profiles/icc_692dc9d3c01d7c947fdea574ea6cf171
Owner:         root
Title:         X11 Colors
Type:          named-color
Colorspace:    lab
Gamma Table:   No
System Wide:   Yes
Filename:      /usr/local/share/color/icc/colord/x11-colors.icc
Profile ID:    icc-692dc9d3c01d7c947fdea574ea6cf171
Metadata:      FILE_checksum=692dc9d3c01d7c947fdea574ea6cf171

Object Path:   /org/freedesktop/ColorManager/profiles/icc_8f19264a111b4ca605923c3190cf266b
Owner:         root
Format:        ColorSpace..
Title:         Artifex Software A98 ICC Profile 
Qualifier:     RGB..
Type:          display-device
Colorspace:    rgb
Gamma Table:   No
System Wide:   Yes
Filename:      /usr/local/share/color/icc/ghostscript/a98.icc
Profile ID:    icc-8f19264a111b4ca605923c3190cf266b
Metadata:      FILE_checksum=8f19264a111b4ca605923c3190cf266b

Object Path:   /org/freedesktop/ColorManager/profiles/icc_fd199526f0a7e0bceb294a777cd84252
Owner:         root
Title:         Artifex CMYK SWOP Profile
Type:          output-device
Colorspace:    cmyk
Gamma Table:   No
System Wide:   Yes
Filename:      /usr/local/share/color/icc/ghostscript/default_cmyk.icc
Profile ID:    icc-fd199526f0a7e0bceb294a777cd84252
Metadata:      FILE_checksum=fd199526f0a7e0bceb294a777cd84252

Object Path:   /org/freedesktop/ColorManager/profiles/icc_315828f0f85f79b8d835fd6150d72e62
Owner:         root
Title:         Artifex Software sGray ICC Profile
Type:          display-device
Colorspace:    gray
Gamma Table:   No
System Wide:   Yes
Filename:      /usr/local/share/color/icc/ghostscript/default_gray.icc
Profile ID:    icc-315828f0f85f79b8d835fd6150d72e62
Metadata:      FILE_checksum=315828f0f85f79b8d835fd6150d72e62

Object Path:   /org/freedesktop/ColorManager/profiles/icc_27d2435a749ae91e9974bf7a109a03e5
Owner:         root
Format:        ColorSpace..
Title:         Artifex Software sRGB ICC Profile
Qualifier:     RGB..
Type:          display-device
Colorspace:    rgb
Gamma Table:   No
System Wide:   Yes
Filename:      /usr/local/share/color/icc/ghostscript/default_rgb.icc
Profile ID:    icc-27d2435a749ae91e9974bf7a109a03e5
Metadata:      FILE_checksum=27d2435a749ae91e9974bf7a109a03e5

Object Path:   /org/freedesktop/ColorManager/profiles/icc_b1e523da41112d37077271b1d6fd306e
Owner:         root
Format:        ColorSpace..
Title:         Artifex Software esRGB ICCProfile
Qualifier:     RGB..
Type:          display-device
Colorspace:    rgb
Gamma Table:   No
System Wide:   Yes
Filename:      /usr/local/share/color/icc/ghostscript/esrgb.icc
Profile ID:    icc-b1e523da41112d37077271b1d6fd306e
Metadata:      FILE_checksum=b1e523da41112d37077271b1d6fd306e
Warning:       scum-dot

Object Path:   /org/freedesktop/ColorManager/profiles/icc_89c593b4fb2720684236dd2a686244c5
Owner:         root
Title:         Artifex PS CMYK Profile
Type:          output-device
Colorspace:    cmyk
Gamma Table:   No
System Wide:   Yes
Filename:      /usr/local/share/color/icc/ghostscript/gray_to_k.icc
Profile ID:    icc-89c593b4fb2720684236dd2a686244c5
Metadata:      FILE_checksum=89c593b4fb2720684236dd2a686244c5

Object Path:   /org/freedesktop/ColorManager/profiles/icc_6fd0ff6e45f84366f3579ef26f8db20e
Owner:         root
Title:         Lab2Lab
Type:          colorspace-conversion
Colorspace:    lab
Gamma Table:   No
System Wide:   Yes
Filename:      /usr/local/share/color/icc/ghostscript/lab.icc
Profile ID:    icc-6fd0ff6e45f84366f3579ef26f8db20e
Metadata:      FILE_checksum=6fd0ff6e45f84366f3579ef26f8db20e

Object Path:   /org/freedesktop/ColorManager/profiles/icc_3d97795cda5f4f357a6871ee44c572bd
Owner:         root
Title:         Artifex PS CMYK Profile
Type:          output-device
Colorspace:    cmyk
Gamma Table:   No
System Wide:   Yes
Filename:      /usr/local/share/color/icc/ghostscript/ps_cmyk.icc
Profile ID:    icc-3d97795cda5f4f357a6871ee44c572bd
Metadata:      FILE_checksum=3d97795cda5f4f357a6871ee44c572bd

Object Path:   /org/freedesktop/ColorManager/profiles/icc_11eed05cd827981c9687c4a22007aeb5
Owner:         root
Title:         Artifex PS Gray Profile
Type:          display-device
Colorspace:    gray
Gamma Table:   No
System Wide:   Yes
Filename:      /usr/local/share/color/icc/ghostscript/ps_gray.icc
Profile ID:    icc-11eed05cd827981c9687c4a22007aeb5
Metadata:      FILE_checksum=11eed05cd827981c9687c4a22007aeb5

Object Path:   /org/freedesktop/ColorManager/profiles/icc_33bd357516893cf318114255eb4dcf5f
Owner:         root
Format:        ColorSpace..
Title:         Artifex PS RGB Profile
Qualifier:     RGB..
Type:          display-device
Colorspace:    rgb
Gamma Table:   No
System Wide:   Yes
Filename:      /usr/local/share/color/icc/ghostscript/ps_rgb.icc
Profile ID:    icc-33bd357516893cf318114255eb4dcf5f
Metadata:      FILE_checksum=33bd357516893cf318114255eb4dcf5f

Object Path:   /org/freedesktop/ColorManager/profiles/icc_8f652ab6bae9a3a5bfdaa74b3a2dc24b
Owner:         root
Format:        ColorSpace..
Title:         Artifex Software ROMMRGB ICC     
Qualifier:     RGB..
Type:          display-device
Colorspace:    rgb
Gamma Table:   No
System Wide:   Yes
Filename:      /usr/local/share/color/icc/ghostscript/rommrgb.icc
Profile ID:    icc-8f652ab6bae9a3a5bfdaa74b3a2dc24b
Metadata:      FILE_checksum=8f652ab6bae9a3a5bfdaa74b3a2dc24b

Object Path:   /org/freedesktop/ColorManager/profiles/icc_b70d32fbbc782deaf46e49175e2a3cd5
Owner:         root
Format:        ColorSpace..
Title:         Artifex Software scRGB ICCProfile
Qualifier:     RGB..
Type:          display-device
Colorspace:    rgb
Gamma Table:   No
System Wide:   Yes
Filename:      /usr/local/share/color/icc/ghostscript/scrgb.icc
Profile ID:    icc-b70d32fbbc782deaf46e49175e2a3cd5
Metadata:      FILE_checksum=b70d32fbbc782deaf46e49175e2a3cd5

Object Path:   /org/freedesktop/ColorManager/profiles/icc_79e8621d62557a547d591527405a388a
Owner:         root
Title:         Artifex Software sGray ICC Profile
Type:          display-device
Colorspace:    gray
Gamma Table:   No
System Wide:   Yes
Filename:      /usr/local/share/color/icc/ghostscript/sgray.icc
Profile ID:    icc-79e8621d62557a547d591527405a388a
Metadata:      FILE_checksum=79e8621d62557a547d591527405a388a

Object Path:   /org/freedesktop/ColorManager/profiles/icc_5b70f5fc262db101943802c49da590b7_gdm_92
Owner:         gdm
Format:        ColorSpace..
Title:         SyncMaster
Qualifier:     RGB..
Type:          display-device
Colorspace:    rgb
Scope:         temp
Gamma Table:   No
System Wide:   No
Filename:      /usr/local/etc/gdm/home/.local/share/icc/edid-e457da63e7c1ee2b2f35eaf330fbd2be.icc
Profile ID:    icc-5b70f5fc262db101943802c49da590b7
Metadata:      CMF_product=gnome-settings-daemon
Metadata:      EDID_model=SyncMaster
Metadata:      DATA_source=edid
Metadata:      EDID_serial=
Metadata:      CMF_version=3.38.2
Metadata:      EDID_manufacturer=Undefined
Metadata:      FILE_checksum=5b70f5fc262db101943802c49da590b7
Metadata:      CMF_binary=gnome-settings-daemon
Metadata:      EDID_mnft=SAM
Metadata:      EDID_md5=e457da63e7c1ee2b2f35eaf330fbd2be
Metadata:      MAPPING_device_id=xrandr-Undefined-SyncMaster-H4JX800367
Comment 15 Matthias Andree freebsd_committer freebsd_triage 2021-11-13 08:32:35 UTC
(In reply to M. Draney from comment #14)
I would like to close this bug. I suggest that you try to debug this drm-kmod + amdgpu setup (check version matching and such) and possibly DRI3 or disabling of it, and ask you to search for and subscribe to an existing, or file a new Bugzilla, report for amdgpu and/or the kmod.  Thanks, and thanks for sharing your finding the crash appears driver-specific.

This finding notwithstanding, I have asked in the upstream ticket whether there are nullptr safeguards added, or could be added, such that we can backport them to 5.8 possibly.  Not sure what we'll get.
Comment 16 Matthias Andree freebsd_committer freebsd_triage 2023-04-19 06:59:58 UTC
Reopening PR. 

Reason is I received a personal message from A. Terekhov who reported - with configuration information - that he also received a crash with relevant backtrace, and he writes that this resolved for him depending on which desktop he uses.  

The crash is observable for him apparently with lightdm and launching startxfce4 through the .x*/.X* startup files, and the crash seems to go away if he configures gdm and then starts rawtherapee from GNOME, Cinnamon, or XFCE4 as set up by gdm.

So we now have a starting point to see what resources or rather services might be set up differently, and my hope is that we can identify a service whose existence and/or process ID can be ensured before launching rawtherapee.
Comment 17 Andrew Terekhov 2023-04-25 19:52:53 UTC
Here are some experiments on FreeBSD 13.2 with lightdm+XFCE and gdm+Gnome installed.

If I use gdm to log in then Rawtherapee works fine. If I use lightdm then RT crashes.


Here are sorted results from ps x under gdm which runs Gnome:


PID TT  STAT    TIME COMMAND
1320  -  S    0:00.02 /usr/local/bin/gnome-keyring-daemon --daemonize --login (gnome-keyring-daemo)
1327  -  Is   0:00.11 /usr/local/libexec/gnome-session-binary (gnome-session-binar)
1336  -  Ss   0:00.00 /usr/bin/ssh-agent -- /usr/local/bin/gnome-session
1340  -  I    0:00.00 dbus-launch --exit-with-session /usr/local/libexec/gnome-session-binary
1341  -  Ss   0:00.16 /usr/local/bin/dbus-daemon --syslog --fork --print-pid 6 --print-address 8 --session
1344  -  I    0:00.02 /usr/local/libexec/gvfsd
1346  -  I    0:00.01 /usr/local/libexec/at-spi-bus-launcher
1347  -  I    0:00.18 /usr/local/bin/dbus-daemon --config-file=/usr/local/share/defaults/at-spi2/accessibility.conf --nofork --print-address 11 --address=unix:path=/
1349  -  S    0:00.02 /usr/local/libexec/gvfs-udisks2-volume-monitor (gvfs-udisks2-volume)
1351  -  I    0:00.01 /usr/local/libexec/gvfs-mtp-volume-monitor (gvfs-mtp-volume-mon)
1353  -  I    0:00.01 /usr/local/libexec/gvfs-gphoto2-volume-monitor (gvfs-gphoto2-volume)
1360  -  D    0:01.91 /usr/local/bin/gnome-shell
1362  -  I    0:00.04 /usr/local/libexec/gnome-shell-calendar-server (gnome-shell-calenda)
1365  -  I    0:00.06 /usr/local/libexec/evolution-source-registry (evolution-source-re)
1368  -  I    0:00.07 /usr/local/libexec/goa-daemon
1370  -  I    0:00.07 /usr/local/libexec/evolution-calendar-factory (evolution-calendar-)
1372  -  I    0:00.06 /usr/local/libexec/evolution-addressbook-factory (evolution-addressbo)
1374  -  I    0:00.11 /usr/local/bin/pulseaudio --start --log-target=syslog
1377  -  S    0:00.02 /usr/local/libexec/gvfsd-trash --spawner :1.1 /org/gtk/gvfs/exec_spaw/0
1379  -  S    0:00.04 /usr/local/bin/gjs /usr/local/share/gnome-shell/org.gnome.Shell.Notifications (gjs-console)
1381  -  S    0:00.01 /usr/local/libexec/at-spi2-registryd --use-gnome-session
1383  -  I    0:00.01 /usr/local/libexec/gsd-usb-protection
1384  -  S    0:00.20 /usr/local/libexec/gsd-media-keys
1386  -  I    0:00.01 /usr/local/libexec/gsd-a11y-settings
1387  -  S    0:00.18 /usr/local/libexec/gsd-power
1388  -  I    0:00.01 /usr/local/libexec/gsd-screensaver-proxy (gsd-screensaver-pro)
1389  -  S    0:00.20 /usr/local/libexec/gsd-xsettings
1390  -  I    0:00.01 /usr/local/libexec/gsd-print-notifications (gsd-print-notificat)
1391  -  I    0:00.01 /usr/local/libexec/gsd-sharing
1392  -  I    0:00.01 /usr/local/libexec/gsd-datetime
1393  -  I    0:00.08 ibus-daemon --panel disable --xim
1394  -  I    0:00.01 /usr/local/libexec/gsd-smartcard
1395  -  S    0:00.02 /usr/local/libexec/gsd-housekeeping
1397  -  I    0:00.02 /usr/local/libexec/gsd-sound
1400  -  S    0:00.18 /usr/local/libexec/gsd-keyboard
1402  -  I    0:00.03 /usr/local/libexec/gsd-printer
1404  -  S    0:00.07 /usr/local/bin/gjs /usr/local/share/gnome-shell/org.gnome.ScreenSaver (gjs-console)
1407  -  I    0:00.01 /usr/local/libexec/ibus-dconf
1408  -  S    0:00.25 /usr/local/libexec/ibus-extension-gtk3
1410  -  S    0:00.18 /usr/local/libexec/ibus-x11 --kill-daemon
1412  -  S    0:00.02 /usr/local/libexec/ibus-portal
1415  -  I    0:00.08 /usr/local/bin/zeitgeist-datahub
1416  -  S    0:00.46 /usr/local/libexec/evolution-data-server/evolution-alarm-notify (evolution-alarm-not)
1423  -  S    0:00.02 /usr/local/bin/zeitgeist-daemon
1427  -  I    0:00.01 /usr/local/libexec/ibus-engine-simple
1435  -  I    0:00.01 /usr/local/libexec/gvfsd-burn --spawner :1.1 /org/gtk/gvfs/exec_spaw/1
1439  -  S    0:00.22 /usr/local/libexec/gnome-terminal-server (gnome-terminal-serv)
1440  0  Ss   0:00.01 bash
1457  0  R+   0:00.00 ps x
1458  0  S+   0:00.00 sort


The same under lighdm which runs XFCE:


 PID TT  STAT    TIME COMMAND
1542  -  Ss   0:00.18 xfce4-session
1559  -  S    0:00.00 /usr/local/bin/dbus-launch --sh-syntax --exit-with-session xfce4-session
1560  -  Ss   0:00.07 /usr/local/bin/dbus-daemon --syslog --fork --print-pid 5 --print-address 7 --session
1562  -  S    0:00.01 /usr/local/libexec/gvfsd
1564  -  S    0:00.00 /usr/local/libexec/at-spi-bus-launcher
1565  -  S    0:00.18 /usr/local/bin/dbus-daemon --config-file=/usr/local/share/defaults/at-spi2/accessibility.conf --nofork --print-address 11 --address=unix:path=/var/run/user/1001/at-s
1567  -  S    0:00.05 /usr/local/lib/xfce4/xfconf/xfconfd
1569  -  S    0:00.01 /usr/local/libexec/at-spi2-registryd --use-gnome-session
1571  -  S    0:00.12 /usr/local/bin/xfce4-screensaver
1574  -  Ss   0:00.00 /usr/bin/ssh-agent -s
1579  -  Ss   0:00.00 /usr/local/bin/gpg-agent --sh --daemon
1580  -  S    0:00.14 xfwm4
1581  -  S    0:00.15 xfsettingsd
1585  -  S    0:01.24 xfce4-panel
1586  -  S    0:00.07 Thunar --daemon (thunar)
1587  -  S    0:01.54 xfdesktop
1589  -  S    0:00.01 /usr/local/libexec/gvfs-udisks2-volume-monitor (gvfs-udisks2-volume)
1591  -  S    0:00.01 /usr/local/libexec/gvfs-mtp-volume-monitor (gvfs-mtp-volume-mon)
1593  -  S    0:00.01 /usr/local/libexec/gvfs-gphoto2-volume-monitor (gvfs-gphoto2-volume)
1596  -  S    0:00.05 xfce4-power-manager
1600  -  SN   0:00.11 /usr/local/lib/tumbler-1/tumblerd
1601  -  S    0:00.03 /usr/local/lib/xfce4/notifyd/xfce4-notifyd
1603  -  S    0:00.18 /usr/local/lib/xfce4/panel/wrapper-2.0 /usr/local/lib/xfce4/panel/plugins/libsystray.so 6 33554444 systray Status Tray Plugin Provides status notifier items (applica
1604  -  S    0:00.19 /usr/local/lib/xfce4/panel/wrapper-2.0 /usr/local/lib/xfce4/panel/plugins/libpulseaudio-plugin.so 8 33554445 pulseaudio PulseAudio Plugin Adjust the audio volume of 
1605  -  S    0:00.19 /usr/local/lib/xfce4/panel/wrapper-2.0 /usr/local/lib/xfce4/panel/plugins/libxfce4powermanager.so 9 33554446 power-manager-plugin Power Manager Plugin Display the ba
1606  -  S    0:00.21 /usr/local/lib/xfce4/panel/wrapper-2.0 /usr/local/lib/xfce4/panel/plugins/libnotification-plugin.so 10 33554447 notification-plugin Notification Plugin Notification 
1607  -  S    0:00.01 /usr/local/libexec/gvfsd-trash --spawner :1.1 /org/gtk/gvfs/exec_spaw/0
1609  -  S    0:00.00 /usr/local/libexec/gvfsd-metadata
1610  -  S    0:00.17 /usr/local/lib/xfce4/panel/wrapper-2.0 /usr/local/lib/xfce4/panel/plugins/libactions.so 14 33554448 actions Action Buttons Log out, lock or other system actions
1611  -  S    0:00.24 /usr/local/lib/xfce4/panel/wrapper-2.0 /usr/local/lib/xfce4/panel/plugins/libxkb.so 19 33554449 xkb Keyboard Layouts Keyboard layouts setup and switch plugin
1616  -  S    0:00.11 /usr/local/bin/pulseaudio --start --log-target=syslog
1619  -  S    0:00.02 /usr/local/bin/xfce4-mime-helper --launch TerminalEmulator
1620  -  S    0:00.11 /usr/local/bin/xfce4-terminal
1621  0  Ss   0:00.01 bash
1631  0  R+   0:00.00 ps x
1632  0  S+   0:00.00 sort


If I run RT from terminal this is what I got under gdm:

$ rawtherapee

(rawtherapee:1463): GLib-GObject-CRITICAL **: 15:43:50.774: g_object_unref: assertion 'old_ref > 0' failed

(rawtherapee:1463): GLib-GObject-CRITICAL **: 15:43:50.775: g_object_unref: assertion 'old_ref > 0' failed

(rawtherapee:1463): GLib-GObject-CRITICAL **: 15:43:50.775: g_object_unref: assertion 'old_ref > 0' failed

(rawtherapee:1463): GLib-GObject-CRITICAL **: 15:43:50.775: g_object_unref: assertion 'old_ref > 0' failed

(rawtherapee:1463): GLib-GObject-CRITICAL **: 15:43:50.775: g_object_unref: assertion 'old_ref > 0' failed

(rawtherapee:1463): GLib-GObject-CRITICAL **: 15:43:50.775: g_object_unref: assertion 'old_ref > 0' failed

(rawtherapee:1463): GLib-GObject-CRITICAL **: 15:43:50.775: g_object_unref: assertion 'old_ref > 0' failed


The same under lightdm:

$ rawtherapee
Gtk-Message: 15:35:53.272: Failed to load module "colorreload-gtk-module"

(rawtherapee:1481): GLib-GObject-CRITICAL **: 15:35:58.682: g_object_unref: assertion 'old_ref > 0' failed

(rawtherapee:1481): GLib-GObject-CRITICAL **: 15:35:58.682: g_object_unref: assertion 'old_ref > 0' failed

(rawtherapee:1481): GLib-GObject-CRITICAL **: 15:35:58.682: g_object_unref: assertion 'old_ref > 0' failed

(rawtherapee:1481): GLib-GObject-CRITICAL **: 15:35:58.682: g_object_unref: assertion 'old_ref > 0' failed

(rawtherapee:1481): GLib-GObject-CRITICAL **: 15:35:58.683: g_object_unref: assertion 'old_ref > 0' failed

(rawtherapee:1481): GLib-GObject-CRITICAL **: 15:35:58.683: g_object_unref: assertion 'old_ref > 0' failed
Segmentation fault


This line looks suspicious:

Failed to load module "colorreload-gtk-module"
Comment 18 Matthias Andree freebsd_committer freebsd_triage 2023-04-25 21:08:55 UTC
colorreload-gtk-module for some reason hints to gnome-settings-daemon because if  I kill gsd-xsettings, then I can trigger this warning on GNOME on Linux (Fedora 37 FWIW). But still rawtherapee starts.  

I believe this isn't exactly a red herring, but a correlated issue that isn't the cause, and it's some gnome-settings-daemon thingy that rawtherapee requires. gnome-settings-daemon, to me, is dark magic, and FreeBSD does not install documentation, neither does Linux.  /usr/local/share/gnome-session/sessions/gnome.session contains, in RequiredComponents, org.gnome.SettingsDaemon.Color - not sure what provides it, because there is no such executable on my FreeBSD (but there is, and a process, on Fedora Linux 37). On FreeBSD, /usr/local/etc/xdg/autostart/org.gnome.SettingsDaemon.Color.desktop is a stub, Exec=false, on Fedora Linux, it lists .../libexec/gsd-color (which FreeBSD does not have).

This is the list of your processes compared, GNOME from gdm on the left, XFCE4 from lightdm on the right.

dbus-launch						      <
ibus-daemon						      <
							      >	Thunar
/usr/bin/ssh-agent						/usr/bin/ssh-agent
/usr/local/bin/dbus-daemon					/usr/local/bin/dbus-daemon
/usr/local/bin/dbus-daemon				      |	/usr/local/bin/dbus-launch
/usr/local/bin/gjs					      |	/usr/local/bin/gpg-agent
/usr/local/bin/gnome-keyring-daemon			      <
/usr/local/bin/gnome-shell				      <
/usr/local/bin/pulseaudio					/usr/local/bin/pulseaudio
/usr/local/bin/zeitgeist-daemon				      |	/usr/local/bin/xfce4-mime-helper
/usr/local/bin/zeitgeist-datahub			      |	/usr/local/bin/xfce4-screensaver
							      >	/usr/local/bin/xfce4-terminal
/usr/local/libexec/at-spi2-registryd				/usr/local/libexec/at-spi2-registryd
/usr/local/libexec/at-spi-bus-launcher				/usr/local/libexec/at-spi-bus-launcher
/usr/local/libexec/evolution-addressbook-factory	      <
/usr/local/libexec/evolution-calendar-factory		      <
/usr/local/libexec/evolution-data-server/evolution-alarm-noti <
/usr/local/libexec/evolution-source-registry		      <
/usr/local/libexec/gnome-session-binary			      <
/usr/local/libexec/gnome-shell-calendar-server		      <
/usr/local/libexec/gnome-terminal-server		      <
/usr/local/libexec/goa-daemon				      <
/usr/local/libexec/gsd-a11y-settings			      <
/usr/local/libexec/gsd-datetime				      <
/usr/local/libexec/gsd-housekeeping			      <
/usr/local/libexec/gsd-keyboard				      <
/usr/local/libexec/gsd-media-keys			      <
/usr/local/libexec/gsd-power				      <
/usr/local/libexec/gsd-printer				      <
/usr/local/libexec/gsd-print-notifications		      <
/usr/local/libexec/gsd-screensaver-proxy		      <
/usr/local/libexec/gsd-sharing				      <
/usr/local/libexec/gsd-smartcard			      <
/usr/local/libexec/gsd-sound				      <
/usr/local/libexec/gsd-usb-protection			      <
/usr/local/libexec/gsd-xsettings			      <
/usr/local/libexec/gvfsd					/usr/local/libexec/gvfsd
/usr/local/libexec/gvfsd-burn				      |	/usr/local/libexec/gvfsd-metadata
/usr/local/libexec/gvfsd-trash					/usr/local/libexec/gvfsd-trash
/usr/local/libexec/gvfs-gphoto2-volume-monitor			/usr/local/libexec/gvfs-gphoto2-volume-monitor
/usr/local/libexec/gvfs-mtp-volume-monitor			/usr/local/libexec/gvfs-mtp-volume-monitor
/usr/local/libexec/gvfs-udisks2-volume-monitor			/usr/local/libexec/gvfs-udisks2-volume-monitor
/usr/local/libexec/ibus-dconf				      |	/usr/local/lib/tumbler-1/tumblerd
/usr/local/libexec/ibus-engine-simple			      |	/usr/local/lib/xfce4/notifyd/xfce4-notifyd
/usr/local/libexec/ibus-extension-gtk3			      |	/usr/local/lib/xfce4/panel/wrapper-2.0
/usr/local/libexec/ibus-portal				      |	/usr/local/lib/xfce4/xfconf/xfconfd
/usr/local/libexec/ibus-x11				      |	xfce4-panel
							      >	xfce4-power-manager
							      >	xfce4-session
							      >	xfdesktop
							      >	xfsettingsd
							      >	xfwm4
Comment 19 Matthias Andree freebsd_committer freebsd_triage 2023-04-25 21:20:32 UTC
so, beyond that, and to get back to the color space transformation crash (RGB to Lab), gnome-settings-daemon (gsd-*) stuff depends on colord, but strangely enough, it passes -Dcolord=false to meson when building gnome-settings-daemon.  colord also has daemons in libexec and executables, but again, does not install documentation I can make heads or tails of.

Chances are that running colord and/or colord-session, directly or under dbus-launch, might help. You may want to add -v to see what that stuff is doing.
Comment 20 Andrew Terekhov 2023-04-26 01:39:32 UTC
Under XFCE I see that colord process:

$ ps axl|grep colord
 970 1875    1  5  29  0    52300    7324 select   I     -     0:00.09 /usr/local/libexec/colord


but if I go into Settings/Color Profiles it says No devices found and all the buttons are greyed out
Comment 21 Andrew Terekhov 2023-04-27 18:58:56 UTC
If I start XFCE under gdm I also do not have anything in Settings/Color Profiles, but RT works fine.
Comment 22 merritt.draney 2023-04-28 23:32:45 UTC
Try this in your .xinitrc.  I think it is something in the session startup and environmental variables.  This is the way I have to start it up using startx.  I am not sure what needs to be changed to get lightdm to startup correctly.

#!/bin/sh
export LANG="en_US.UTF-8"  
export LC_CTYPE="en_US.UTF-8"  
export LC_MESSAGES="en_US.UTF-8"  
export XDG_SESSION_TYPE=x11  
export WINDOWPATH=9  
export COLORTERM=truecolor

# fix broken $UID on some system...
if test "x$UID" = "x"; then
  if test -x /usr/xpg4/bin/id; then
    UID=`/usr/xpg4/bin/id -u`;
  else
    UID=`id -u`;
  fi
fi

# set $XDG_MENU_PREFIX to "xfce-" so that "xfce-applications.menu" is picked
# over "applications.menu" in all Xfce applications.
if test "x$XDG_MENU_PREFIX" = "x"; then
  XDG_MENU_PREFIX="xfce-"
  export XDG_MENU_PREFIX
fi

# set DESKTOP_SESSION so that one can detect easily if an Xfce session is running
if test "x$DESKTOP_SESSION" = "x"; then
  DESKTOP_SESSION="xfce"
  export DESKTOP_SESSION
fi

# set XDG_CURRENT_DESKTOP so that Qt 5 applications can identify user set Xfce theme
if test "x$XDG_CURRENT_DESKTOP" = "x"; then
  XDG_CURRENT_DESKTOP="XFCE"
  export XDG_CURRENT_DESKTOP
fi

# $XDG_CONFIG_HOME defines the base directory relative to which user specific
# configuration files should be stored. If $XDG_CONFIG_HOME is either not set
# or empty, a default equal to $HOME/.config should be used.
if test "x$XDG_CONFIG_HOME" = "x" ; then
  XDG_CONFIG_HOME=$HOME/.config
fi
[ -d "$XDG_CONFIG_HOME" ] || mkdir "$XDG_CONFIG_HOME"

# $XDG_CACHE_HOME defines the base directory relative to which user specific
# non-essential data files should be stored. If $XDG_CACHE_HOME is either not
# set or empty, a default equal to $HOME/.cache should be used.
if test "x$XDG_CACHE_HOME" = "x" ; then
  XDG_CACHE_HOME=$HOME/.cache
fi
[ -d "$XDG_CACHE_HOME" ] || mkdir "$XDG_CACHE_HOME"

# set up XDG user directores.  see
# http://freedesktop.org/wiki/Software/xdg-user-dirs
if command -v xdg-user-dirs-update >/dev/null 2>&1; then
    xdg-user-dirs-update
fi

# For now, start with an empty list
XRESOURCES=""

# Has to go prior to merging Xft.xrdb, as its the "Defaults" file
test -r "/usr/local/etc/xdg/xfce4/Xft.xrdb" && XRESOURCES="$XRESOURCES /usr/local/etc/xdg/xfce4/Xft.xrdb"
test -r $HOME/.Xdefaults && XRESOURCES="$XRESOURCES $HOME/.Xdefaults"

BASEDIR=$XDG_CONFIG_HOME/xfce4
if test -r "$BASEDIR/Xft.xrdb"; then
  XRESOURCES="$XRESOURCES $BASEDIR/Xft.xrdb"
elif test -r "$XFCE4HOME/Xft.xrdb"; then
  mkdir -p "$BASEDIR"
  cp "$XFCE4HOME/Xft.xrdb" "$BASEDIR"/
  XRESOURCES="$XRESOURCES $BASEDIR/Xft.xrdb"
fi

# merge in X cursor settings
test -r "$BASEDIR/Xcursor.xrdb" && XRESOURCES="$XRESOURCES $BASEDIR/Xcursor.xrdb"

# ~/.Xresources contains overrides to the above
test -r "$HOME/.Xresources" && XRESOURCES="$XRESOURCES $HOME/.Xresources"

# load all X resources (adds /dev/null to avoid an empty list that would hang the process)
cat /dev/null $XRESOURCES | xrdb -merge -

# load local modmap
test -r $HOME/.Xmodmap && xmodmap $HOME/.Xmodmap

# if XAUTHLOCALHOSTNAME is not set in systemd user session, starting of xfce4-notifyd, DISPLAY etc. will fail
if command -v systemctl >/dev/null 2>&1 && systemctl --user list-jobs >/dev/null 2>&1; then # user session is running
  dbus-update-activation-environment --systemd XAUTHLOCALHOSTNAME=$XAUTHLOCALHOSTNAME
fi


# check if we start xfce4-session with ck-launch-session. this is only
# required for starting from a console, not a login manager
if test "x$XFCE4_SESSION_WITH_CK" = "x1"; then
  if command -v ck-launch-session >/dev/null 2>&1; then
    exec ck-launch-session xfce4-session
  else
    echo
    echo "You have tried to start Xfce with consolekit support, but"
    echo "ck-launch-session is not installed."
    echo "Aborted startup..."
    echo
    exit 1
  fi
else
  # start xfce4-session normally
  exec xfce4-session
fi

# if we got here, then exec failed
exit 1
Comment 23 Andrew Terekhov 2023-04-29 17:06:04 UTC
Your .xinitrc works for me - RT runs fine and does not crash. I'll play around to see if I can make lightdm work the same. Or I can use gdm which does not have this problem.
Comment 24 Andrew Terekhov 2023-05-06 00:26:09 UTC
It looks I found the remedy. If env. var. LC_ALL is set like this then RT works:

export LC_ALL=C.UTF-8


If I add this var. to my ~/.bashrc (I use bash as my shell) and start RT from shell, it works.

If I add this var. to my ~/.xinitrc and start Xorg without Display Manager RT works.

If I add this var to /usr/local/etc/rc.d/lightdm and start Xorg with lightdm then RT works.
Comment 25 Matthias Andree freebsd_committer freebsd_triage 2023-05-06 08:04:57 UTC
Hello Andrew,

you are up to something... which might bring me closer to reproducing things.

What is the output of these commands WITHOUT LC_ALL added (be sure to add an empty line between the outputs when pasting them, so I can tell which is which):

/usr/bin/env | egrep '^(LC_|LANG)'

locale
Comment 26 Matthias Andree freebsd_committer freebsd_triage 2023-05-06 08:07:47 UTC
(In reply to Matthias Andree from comment #25)
Oh... and we should do this with the failing lightdm/xfce4 once, and once with the working gdm. Then we should know which variable might be worth my try triggering it.  LC_ALL is the "master switch" if you wish.
Comment 27 Andrew Terekhov 2023-05-06 18:17:38 UTC
I commented out setting of LC_ALL where I added them. Verified that under lightdm RT crashes now.

Here is the output of commands you asked for:

$ /usr/bin/env | egrep '^(LC_|LANG)'
LANG=C.UTF-8


$ locale
LANG=C.UTF-8
LC_CTYPE="C.UTF-8"
LC_COLLATE="C.UTF-8"
LC_TIME="C.UTF-8"
LC_NUMERIC="C.UTF-8"
LC_MONETARY="C.UTF-8"
LC_MESSAGES="C.UTF-8"
LC_ALL=
Comment 28 Andrew Terekhov 2023-05-06 18:21:44 UTC
I commented out setting of LC_ALL where I added them. Verified that under lightdm RT crashes now.

Here is the output of commands you asked for:

$ /usr/bin/env | egrep '^(LC_|LANG)'
LANG=C.UTF-8


$ locale
LANG=C.UTF-8
LC_CTYPE="C.UTF-8"
LC_COLLATE="C.UTF-8"
LC_TIME="C.UTF-8"
LC_NUMERIC="C.UTF-8"
LC_MONETARY="C.UTF-8"
LC_MESSAGES="C.UTF-8"
LC_ALL=



And here are the same commands under gdm where RT works fine:

$ /usr/bin/env | egrep '^(LC_|LANG)'
LANG=en_US.UTF-8
LC_MESSAGES=en_US.UTF-8
LC_CTYPE=en_US.UTF-8


$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_ALL=
Comment 29 Andrew Terekhov 2023-05-06 18:56:00 UTC
I did more of experiments. If I add only this one to /usr/local/etc/rc.d/lightdm:

export LANG=en_US.UTF-8

then RT kind of works. When I start it the first time it immediately terminates:

$ rawtherapee
Bus error

But when I start it after that it works fine. Does it mean it is DBus related and some initialization is missing?


Here is the environment:

$ /usr/bin/env | egrep '^(LC_|LANG)'
LANG=en_US.UTF-8


$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_ALL=
Comment 30 Andrew Terekhov 2023-05-09 20:41:53 UTC
Overall I found a nice solution for me. I continue to use lightdm because gdm has problems with auto-login. I put export LC_ALL=C.UTF-8 everywhere listed above. Rawtherapee does not crash anymore. As a bonus I have now correct sorting of files with Russian symbols in their names.
Comment 31 martin 2023-11-20 00:12:46 UTC
I was helping on the same issue: https://forums.freebsd.org/threads/rawtherapee-crashes-when-trying-to-edit-nef-files.90900/ unaware of this PR.

OP opened a bug report too: https://github.com/Beep6581/RawTherapee/issues/6876

I debugged it and found out why it was failing -- the profile map was not found even though it was loaded and present ( map::find() returned false negative). I'm not a C++ programmer and I was not aware find() is such locale sensitive.

I'm linking forums and bug tracker # here for future googlers.
Comment 32 commit-hook freebsd_committer freebsd_triage 2024-02-23 17:37:32 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7e027ece12342fab2bd29ce325c4a6109677ae8a

commit 7e027ece12342fab2bd29ce325c4a6109677ae8a
Author:     Matthias Andree <mandree@FreeBSD.org>
AuthorDate: 2024-02-20 23:24:23 +0000
Commit:     Matthias Andree <mandree@FreeBSD.org>
CommitDate: 2024-02-23 17:37:09 +0000

    graphics/rawtherapee: update to 5.10

    ChangeLog:      https://rawtherapee.com/downloads/5.10/#new-features

    We need to stick to GCC because LLVM-compiled code may take more than
    twice as much processing time as GCC-compiled does, for my test set
    comparing a few images with denoising and stuff on FreeBSD-14.0-RELEASE
    amd64 comparing GCC 12.3 to clang 16.0, and similar values on
    FreeBSD-13.2-RELEASE.

    Pin GCC to 12 and override -stdlib accordingly, to fix
    PR:             273682

    Clean up Makefile a bit, but we cannot let go of the CCACHE
    workarounds yet, which we need when enforcing GCC compile.
    Convert some .if branches to options helpers.

    Make LTO an option that defaults to on. For some strange reason,
    massively-parallel compilation WITHOUT LTO appears to trigger
    OOM kills much more than an LTO-enabled build.  Upstream states
    that LTO build should run faster.

    For one self-test that fails frequently with SIGPIPE (Exit code 141 is
    128 for core dump + 13 for SIGPIPE), pipe through dd with bigger input
    buffer to avoid SIGPIPE/exit code 141 test failures.

    Replace echo by ${ECHO_CMD} in self-tests to appease portlint.
    Portlint misdetects "file system" as bare use of file though and
    suggests ${FILE}, which is wrong.

    Revise warnings around the CCACHE hacks because
    https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277204
    strives to move ports to CCACHE_ENABLED, which does not work for this
    port.

    Also, 5.10 should fix the profile/locale related crash
    PR:             257255
    by switching the std::map variable to use std::string as index,
    rather than Glib::ustring, which caused inconsistencies with locales.
    Upstream references (two bug reports, and the fix, in order):
    https://github.com/Beep6581/RawTherapee/issues/6357
    https://github.com/Beep6581/RawTherapee/issues/6876
    https://github.com/Beep6581/RawTherapee/pull/6889/commits/a95a58a8a399173e6947ff12a4b82b5d83ae80d9

 graphics/rawtherapee/Makefile  | 88 +++++++++++++++++++++---------------------
 graphics/rawtherapee/distinfo  |  6 +--
 graphics/rawtherapee/pkg-plist | 20 ++++++++++
 3 files changed, 68 insertions(+), 46 deletions(-)
Comment 33 Matthias Andree freebsd_committer freebsd_triage 2024-02-23 17:40:21 UTC
(In reply to martin from comment #31)
It seems to me that the locale-sensitivity was inherited by using Glib::ustring, and this seemed to somehow cause inconsistent behavior as to when/why/how locale handling changed exactly, and std::string is a "dumb" container without any locale smarts.