darktable is suddenly crashing without warning

Hi all.
Up until a couple of days ago, my installation of darktable 4.8 was working fine. Then, all of a sudden, and with no known changes to my system, it started crashing within 15 seconds of launching the app. Don’t even have to attempt anything. It just exits with no warning, no errors… it just vanishes.
I’m on mx linux.
If anyone would be willing to help me track down the cause, I’d be most grateful.

System specs are as follows:

System: Kernel: 6.1.0-22-amd64 [6.1.94-1] arch: x86_64 bits: 64 compiler: gcc v: 12.2.0 parameters: BOOT_IMAGE=/boot/vmlinuz-6.1.0-22-amd64 root=UUID=<filter> ro quiet splash init=/lib/systemd/systemd Desktop: Xfce v: 4.18.1 tk: Gtk v: 3.24.36 info: xfce4-panel wm: xfwm v: 4.18.0 vt: 7 dm: LightDM v: 1.26.0 Distro: MX-23.3_x64 Libretto October 15 2023 base: Debian GNU/Linux 12 (bookworm) Machine: Type: Desktop System: Micro-Star product: MS-7B79 v: 2.0 serial: <superuser required> Mobo: Micro-Star model: X470 GAMING PLUS (MS-7B79) v: 2.0 serial: <superuser required> UEFI: American Megatrends v: A.B0 date: 07/04/2019 Battery: Device-1: hidpp_battery_0 model: Logitech Wireless Mouse M325 serial: <filter> charge: 100% (should be ignored) rechargeable: yes status: discharging CPU: Info: model: AMD Ryzen 7 2700X bits: 64 type: MT MCP arch: Zen+ gen: 2 level: v3 note: check built: 2018-21 process: GF 12nm family: 0x17 (23) model-id: 8 stepping: 2 microcode: 0x800820D Topology: cpus: 1x cores: 8 tpc: 2 threads: 16 smt: enabled cache: L1: 768 KiB desc: d-8x32 KiB; i-8x64 KiB L2: 4 MiB desc: 8x512 KiB L3: 16 MiB desc: 2x8 MiB Speed (MHz): avg: 2177 high: 2200 min/max: 2200/3700 boost: enabled scaling: driver: acpi-cpufreq governor: ondemand cores: 1: 2192 2: 2072 3: 2200 4: 2176 5: 2200 6: 2200 7: 2199 8: 2200 9: 2188 10: 2200 11: 2172 12: 2064 13: 2187 14: 2196 15: 2196 16: 2199 bogomips: 118383 Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm Vulnerabilities: Type: gather_data_sampling status: Not affected Type: itlb_multihit status: Not affected Type: l1tf status: Not affected Type: mds status: Not affected Type: meltdown status: Not affected Type: mmio_stale_data status: Not affected Type: reg_file_data_sampling status: Not affected Type: retbleed mitigation: untrained return thunk; SMT vulnerable Type: spec_rstack_overflow mitigation: safe RET Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via prctl Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization Type: spectre_v2 mitigation: Retpolines; IBPB: conditional; STIBP: disabled; RSB filling; PBRSB-eIBRS: Not affected; BHI: Not affected Type: srbds status: Not affected Type: tsx_async_abort status: Not affected Graphics: Device-1: NVIDIA GA104 [GeForce RTX 3070] vendor: ASUSTeK driver: nvidia v: 535.183.01 non-free: 530.xx+ status: current (as of 2023-03) arch: Ampere code: GAxxx process: TSMC n7 (7nm) built: 2020-22 pcie: gen: 3 speed: 8 GT/s lanes: 16 link-max: gen: 4 speed: 16 GT/s bus-ID: 27:00.0 chip-ID: 10de:2484 class-ID: 0300 Display: x11 server: X.Org v: 1.21.1.7 compositor: xfwm v: 4.18.0 driver: X: loaded: nvidia unloaded: fbdev,modesetting,nouveau,vesa alternate: nv gpu: nvidia display-ID: :0.0 screens: 1 Screen-1: 0 s-res: 7680x2160 s-dpi: 96 s-size: 2032x572mm (80.00x22.52") s-diag: 2111mm (83.11") Monitor-1: HDMI-0 pos: primary,left res: 3840x2160 hz: 60 dpi: 163 size: 597x336mm (23.5x13.23") diag: 685mm (26.97") modes: N/A Monitor-2: HDMI-1 pos: right res: 3840x2160 hz: 60 dpi: 187 size: 521x293mm (20.51x11.54") diag: 598mm (23.53") modes: N/A API: OpenGL v: 4.6.0 NVIDIA 535.183.01 renderer: NVIDIA GeForce RTX 3070/PCIe/SSE2 direct-render: Yes Audio: Device-1: NVIDIA GA104 High Definition Audio vendor: ASUSTeK driver: snd_hda_intel v: kernel bus-ID: 3-2:3 pcie: chip-ID: 1235:8201 class-ID: 0103 gen: 3 speed: 8 GT/s serial: <filter> lanes: 16 link-max: gen: 4 speed: 16 GT/s bus-ID: 27:00.1 chip-ID: 10de:228b class-ID: 0403 Device-2: Focusrite-Novation Scarlett 18i20 USB type: USB driver: snd-usb-audio API: ALSA v: k6.1.0-22-amd64 status: kernel-api tools: alsamixer,amixer Server-1: JACK v: 1.9.21 status: off tools: jack_control,jack_mixer Server-2: PipeWire v: 1.0.0 status: active with: 1: pipewire-pulse status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin 4: pw-jack type: plugin tools: pactl,pw-cat,pw-cli,wpctl Network: Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Micro-Star MSI driver: r8169 v: kernel pcie: gen: 1 speed: 2.5 GT/s lanes: 1 port: f000 bus-ID: 22:00.0 chip-ID: 10ec:8168 class-ID: 0200 IF: eth0 state: up speed: 1000 Mbps duplex: full mac: <filter> Drives: Local Storage: total: 6.94 TiB used: 4.99 TiB (71.9%) SMART Message: Unable to run smartctl. Root privileges required. ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Samsung model: MZVLW256HEHP-000H1 size: 238.47 GiB block-size: physical: 512 B logical: 512 B speed: 31.6 Gb/s lanes: 4 type: SSD serial: <filter> rev: CXB73H1Q temp: 29.9 C scheme: GPT ID-2: /dev/sda maj-min: 8:0 vendor: Samsung model: SSD 840 EVO 120GB size: 111.79 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s type: SSD serial: <filter> rev: BB6Q scheme: GPT ID-3: /dev/sdb maj-min: 8:16 vendor: Samsung model: SSD 850 EVO 250GB size: 232.89 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s type: SSD serial: <filter> rev: 2B6Q scheme: GPT ID-4: /dev/sdc maj-min: 8:32 vendor: Seagate model: ST3000DM008-2DM166 size: 2.73 TiB block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s type: HDD rpm: 7200 serial: <filter> rev: CC26 scheme: GPT ID-5: /dev/sdd maj-min: 8:48 vendor: Seagate model: ST4000DM004-2CV104 size: 3.64 TiB block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s type: HDD rpm: 5425 serial: <filter> rev: 0001 scheme: GPT Partition: ID-1: / raw-size: 112.3 GiB size: 112.3 GiB (100.00%) used: 9.55 GiB (8.5%) fs: btrfs dev: /dev/nvme0n1p6 maj-min: 259:6 ID-2: /boot/efi raw-size: 473 MiB size: 472 MiB (99.80%) used: 592 KiB (0.1%) fs: vfat dev: /dev/sdb1 maj-min: 8:17 ID-3: /home raw-size: 232.42 GiB size: 232.42 GiB (100.00%) used: 67.68 GiB (29.1%) fs: btrfs dev: /dev/sdb2 maj-min: 8:18 Swap: Kernel: swappiness: 15 (default 60) cache-pressure: 100 (default) ID-1: swap-1 type: partition size: 8 GiB used: 0 KiB (0.0%) priority: -2 dev: /dev/sdd2 maj-min: 8:50 Sensors: System Temperatures: cpu: 39.0 C mobo: N/A gpu: nvidia temp: 46 C Fan Speeds (RPM): N/A gpu: nvidia fan: 0% Repos: Packages: 2628 pm: dpkg pkgs: 2621 libs: 1413 tools: apt,apt-get,aptitude,nala,synaptic pm: rpm pkgs: 0 pm: flatpak pkgs: 0 pm: snap pkgs: 7 No active apt repos in: /etc/apt/sources.list Active apt repos in: /etc/apt/sources.list.d/darktable-ppa.list 1: deb http://ppa.launchpad.net/ubuntuhandbook1/darktable/ubuntu bookworm main Active apt repos in: /etc/apt/sources.list.d/debian-stable-updates.list 1: deb http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware Active apt repos in: /etc/apt/sources.list.d/debian.list 1: deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware 2: deb http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware Active apt repos in: /etc/apt/sources.list.d/google-chrome.list 1: deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main Active apt repos in: /etc/apt/sources.list.d/mx.list 1: deb http://mx.debian.nz/mx/repo/ bookworm main non-free Info: Processes: 381 Uptime: 12m wakeups: 2 Memory: 31.29 GiB used: 3.97 GiB (12.7%) Init: systemd v: 252 target: graphical (5) default: graphical tool: systemctl Compilers: gcc: 12.2.0 alt: 12 clang: 14.0.6 Client: shell wrapper v: 5.2.15-release inxi: 3.3.26 Boot Mode: UEFI

Urgh.
Apologies for that abomination above. Apparently this forum software doesn’t like carriage returns in copy/paste text.

I was just trying moving data.db and library.db to a safe folder, and launching with the “pre-4.8” versions. A ton of images naturally appeared with newer xmp files than the library.db was aware of, and asked how to handle the conflict. I chose “keep newest edit”, and as you can see from the graphic, they all returned an error of “unable to write to the database”.
It’s not a space issue. There’s more than a TB of free space on the photos drive, and both the root file system, and the user home directory have hundreds of GB to spare.
Anyone got any thoughts on why that might be the case?
Thanks in advance…

Not a problem usually, just use code blocks (three backticks; single ones are for short, one-liner code).

That system spec information is not useful. Start darktable from terminal with the -d common flag. Post the output in a text file to start the troubleshooting.

Except that there’s a bug that, on some systems, causes crashes shortly after startup if -d imageio (or common or all, which imply it) is used. Did not occur for me with Ubuntu 23.10, and caught me by surprise on 24.04.

The symptom is a crash while populating the lighttable, with the following on the console:

*** buffer overflow detected ***: terminated
Aborted (core dumped)

@Bruce_Williams , if you don’t yet use the affected logging setup, your problem is different.

During the upgrade, darktable creates a backup of the DB. Maybe you can restore those files, if you want to revert to 4.6.1 for the time being.

1 Like

I also have snapshots of the databases created. Perhaps those can be useful as well (but do backup the current database before using one of those, a crash might mess them up)

Please note as @kofa said: DO NOT use -d common ! -d pipe -d opencl is safe and mostly enough !

Thanks one and all.

To answer the earlier posts, no, I have NOT run darktable from the command line (with ANY options) before. I’ve never had a reason to.

Yes, I have both snp AND -pre-4.x versions of the data.db and library.db files.

From within /.config/darktable, I tried moving data.db, and library.db to a safe place, and then copying data.db-pre-4.9.0, and library.db-pre-4.9.0 to the same location. And then from that original path, removing the “-pre-4.9.0” suffixes from the backups, and attempting a launch with those files.

Again, the app launched, but crashed with no warning 15 seconds later (or thereabouts).

With a little help from ChatGPT, I run this command, from inside the directory where the darktable binary lives:

darktable -d pipe -d opencl > /home/bruce/Documents/dtoutput.txt 2>&1

…but it didn’t launch the app. It simply generated a text file of the options:

usage: darktable [options] [IMG_1234.{RAW,..}|image_folder/] options: --cachedir <user cache directory> --conf <key>=<value> --configdir <user config directory> -d {all,act_on,cache,camctl,camsupport,control,demosaic,dev,imageio, input,ioporder,lighttable,lua,masks,memory,nan,opencl,params, perf,print,pwstorage,signal,sql,tiling,undo,verbose,roi} --d-signal <signal> --d-signal-act <all,raise,connect,disconnect,print-trace> --datadir <data directory> --disable-opencl -h, --help --library <library file> --localedir <locale directory> --luacmd <lua command> --moduledir <module directory> --noiseprofiles <noiseprofiles json file> -t <num openmp threads> --tmpdir <tmp directory> --version

What did I miss?

From the output there, it looks like -d pipe is not valid for this version of darktable. You could just run darktable -d all which is more output than really needed but should succeed

Even though @kofa said don’t use “-d common”?
And “-d all” would include that?
I’ll hold off until advised accordingly…

Can you run darktable --version and which darktable to see which version of darktable and where it is on your system?

I’m running darktable 4.8.0 and when I run darktable --help I see both pipe and opencl listed as valid values for -d, unlike the output you pasted above, so we’re missing something about the version that is installed on your system:

-d SIGNAL
    Enable debug output to the terminal. Valid signals are:

    act_on, cache, camctl, camsupport, control, dev, expose,
    imageio, input, ioporder, lighttable, lua, masks, memory,
    nan, opencl, params, perf, pipe, print, pwstorage, signal,
    sql, tiling, picker, undo

    all     -> to debug all signals
    common  -> to debug dev, imageio, masks, opencl, params, pipe
    verbose -> when combined with debug options like '-d opencl'
               provides more detailed output. To activate verbosity,
               use the additional option '-d verbose'
               even when using '-d all'.

    There are several subsystems of darktable and each of them can be
    debugged separately. You can use this option multiple times if you
    want to debug more than one subsystem.

    E.g. darktable -d opencl -d camctl -d perf

OK, I am REALLY confused now.

this is darktable 4.2.1
copyright (c) 2009-2023 johannes hanika
https://github.com/darktable-org/darktable/issues/new/choose

compile options:
  bit depth is 64 bit
  normal build
  SSE2 optimized codepath enabled
  OpenMP support enabled
  OpenCL support enabled
  Lua support enabled, API version 9.0.0
  Colord support enabled
  gPhoto2 support enabled
  GraphicsMagick support enabled
  ImageMagick support disabled
  libavif support enabled
  libheif support enabled
  libjxl support enabled
  OpenJPEG support enabled
  OpenEXR support enabled
  WebP support enabled


$ which darktable
/usr/bin/darktable


$ darktable --help
usage: darktable [options] [IMG_1234.{RAW,..}|image_folder/]

options:

  --cachedir <user cache directory>
  --conf <key>=<value>
  --configdir <user config directory>
  -d {all,act_on,cache,camctl,camsupport,control,demosaic,dev,imageio,
      input,ioporder,lighttable,lua,masks,memory,nan,opencl,params,
      perf,print,pwstorage,signal,sql,tiling,undo,verbose,roi}
  --d-signal <signal> 
  --d-signal-act <all,raise,connect,disconnect,print-trace>
  --datadir <data directory>
  --disable-opencl
  -h, --help
  --library <library file>
  --localedir <locale directory>
  --luacmd <lua command>
  --moduledir <module directory>
  --noiseprofiles <noiseprofiles json file>
  -t <num openmp threads>
  --tmpdir <tmp directory>
  --version

I compiled from source, and when dt was running, it was v4.9, and it is installed at /opt/darktable/

/usr/bin suggests a version from the operating system. Locally installed code usually goes under /usr/local or /opt. I just install to my home directory, though.

Do you use a Debian-based distro? If so, dpkg -l can list all installed packages, dpkg -l darktable could specifically show darktable, and dpkg -S /usr/bin/darktable would show the package owning the file.

It sounds like you have two versions installed, and /usr/bin comes first on the PATH environment variable so that version is getting used. You can override this by specifying the full path to the darktable binary - look for it in /opt/darktable but it’s probably something like /opt/darktable/bin/darktable so use that full path when running these darktable commands and you should see the version you expect. Then run /opt/darktable/bin/darktable -d pipe -d opencl and see what happens

1 Like

I have what looks like exactly the same problem as Bruce. Running on Fedora 40, in my case I see it since yesterday’s upgrade to kernel 6.9.8; the other packages that got upgraded do not look as likely cases (firmware files, xorg-Xwayland – which I do not use as runnign Xfce – and two python3 libraries.

Just starting it from command-line w/o doing anything (not even a mouse touch) results in

>  darktable
an error occurred while trying to execute gdb. please check if gdb is installed on your system.
backtrace written to /tmp/darktable_bt_U32RQ2.txt
Segmentation fault (core dumped)

Output of darktable -d pipe -d opencl:

>  darktable -d pipe -d opencl
darktable 4.8.0
Copyright (C) 2012-2024 Johannes Hanika and other contributors.

Compile options:
  Bit depth              -> 64 bit
  Debug                  -> DISABLED
  SSE2 optimizations     -> ENABLED
  OpenMP                 -> ENABLED
  OpenCL                 -> ENABLED
  Lua                    -> ENABLED  - API version 9.3.0
  Colord                 -> ENABLED
  gPhoto2                -> ENABLED
  GMIC                   -> ENABLED  - Compressed LUTs are supported
  GraphicsMagick         -> ENABLED
  ImageMagick            -> DISABLED
  libavif                -> ENABLED
  libheif                -> ENABLED
  libjxl                 -> ENABLED
  OpenJPEG               -> ENABLED
  OpenEXR                -> ENABLED
  WebP                   -> ENABLED

See https://www.darktable.org/resources/ for detailed documentation.
See https://github.com/darktable-org/darktable/issues/new/choose to report bugs.

     0.0929 [dt_get_sysresource_level] switched to 2 as `large'
     0.0929   total mem:       15846MB
     0.0929   mipmap cache:    1980MB
     0.0929   available mem:   10832MB
     0.0929   singlebuff:      247MB
     0.1085 [opencl_init] opencl disabled via darktable preferences
     0.1086 [dt_dlopencl_init] could not find default opencl runtime library 'libOpenCL'
     0.1086 [dt_dlopencl_init] could not find default opencl runtime library 'libOpenCL.so'
     0.1087 [opencl_init] opencl library 'libOpenCL.so.1' found on your system and loaded, preference 'default path'
     0.1088 [opencl_init] 0 platforms detected, error: Unknown OpenCL error
     0.1088 [opencl_init] FINALLY: opencl PREFERENCE=OFF is NOT AVAILABLE and NOT ENABLED.

after which it crashes, gdb kicks in and a backtrace is dumped on screen.

I only have Intels built-in GPU so the OpenCL messages are correct. To suppress these I have included OpenCL=False as of somewhere in 4.6.x w/o issues.

Starting with -d common gives more debug output, but not clues – DT dies after a number of lines with [history] succesfully loaded module … from history. Last module that gets loaded is ‘spots’, Only comment is that most loaded modules are followed by blendop and params version WRONG and params WRONG, but I do not know what that means.

Bugzilla report filed Buzilla report 2297697

You can try --disable-opencl (sometimes crashes early on, during detection; this is ‘stronger than’ telling darktable not to use OpenCL: it disables even the detection code).

It is like not a GPU problem. Please post the text file of the output from terminal.

Here it is, using --disable-opencl to rule that out:

darktable-log-segfault.txt (6.2 KB)