darktable-org / darktable

darktable is an open source photography workflow application and raw developer
https://www.darktable.org
GNU General Public License v3.0
9.79k stars 1.14k forks source link

Arbitrary crashes during darktable use with CR3 #17816

Open NohWayJose opened 2 days ago

NohWayJose commented 2 days ago

Describe the bug

I recently started using Darktable after I bought a new Canon R6 mk2 - it has CR3 RAW files. Pretty much every session Darktable crashes catastrophically, in that I cannot force close the frozen app. and all I can do is reboot the OS.

Even kill -9 <pid> doesn't work and I have to reboot every time. I can drag the Darktable window around and resize it but I can't interact with the GUI.

I cannot identify any specific action that causes the hang and I've kept the system monitor open to keep an eye on memory & CPU load but not noticed a large spike (it may be that I missed it, rather than it didn't happen). I am not sure what I should post, system log or std-out (where I could start Darktable from the command-line and pipe output to a text file, so it survives reboot.

To my untrained eye, I wonder whether it's a memory leak - so, independent of what I'm doing, but then again often, everything else continues to work?

Please let me know what (and how) I need to capture to let you see what the cause is.

Please hurry, I want to process my new photos! ;-P

Thanks

Steps to reproduce

Open Darktable -> edit some (indeterminate number) of CR3s -> it crashes but doesn't take down the OS every time (does sometimes) but to purge the Darktable process I have to reboot.

Expected behavior

Darktable works reliably and doesn't arbitrarily crash

Logfile | Screenshot | Screencast

Please advise how to collect what you need to see

Commit

I don't know how to find out

Where did you obtain darktable from?

distro packaging

darktable version

4.8.1_91.9

What OS are you using?

Linux

What is the version of your OS?

OpenSuSE Tumbleweed

Describe your system?

Operating System: openSUSE Tumbleweed 20241107
KDE Plasma Version: 6.2.3
KDE Frameworks Version: 6.7.0
Qt Version: 6.8.0
Kernel Version: 6.11.6-2-default (64-bit)
Graphics Platform: Wayland
Processors: 32 × 13th Gen Intel® Core™ i9-13900K
Memory: 62.6 GiB of RAM
Graphics Processor: AMD Radeon RX 6650 XT
Manufacturer: Gigabyte Technology Co., Ltd.
Product Name: Z790 AORUS ELITE AX

OpenCL
Number of platforms                               0
ICD loader properties
  ICD loader Name                                 OpenCL ICD Loader
  ICD loader Vendor                               OCL Icd free software
  ICD loader Version                              2.3.1
  ICD loader Profile                              OpenCL 3.0

Also OpenGL (EGL) & (GLX), Vulcan, Wayland - too much to paste (unless needed?)

2 x acer UHD 4k2k 28" screens

Are you using OpenCL GPU in darktable?

I dont know

If yes, what is the GPU card and driver?

01:00.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 XL Upstream Port of PCI Express Switch (rev c1) (prog-if 00 [Normal decode]) 02:00.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 XL Downstream Port of PCI Express Switch (prog-if 00 [Normal decode]) Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 XL Downstream Port of PCI Express Switch 03:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Navi 23 [Radeon RX 6650 XT / 6700S / 6800S] (rev c1) (prog-if 00 [VGA controller]) Kernel driver in use: amdgpu Kernel modules: amdgpu 03:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Navi 21/23 HDMI/DP Audio Controller Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] Navi 21/23 HDMI/DP Audio Controller

Please provide additional context if applicable. You can attach files too, but might need to rename to .txt or .zip

Don't know - What's a Lua script?

NohWayJose commented 2 days ago

Just checked and I downloaded 4.8._81.9 from your repo

ralfbrown commented 1 day ago

Does this happen only with CR3s or with other file types as well? (CR3-only would point to LibRaw.)

How much swap space does your system have? Runaway memory usage can force the entire user interface to be swapped out, resulting in an apparent freeze (it'll come back eventually as the UI code swaps back in, but that can take several minutes). You can try

ulimit -m $MEM -v $MEM

in a terminal window before starting darktable from that window, where $MEM should be around 3/4 of your physical memory size in kilobytes, i.e. "12000000" for a 16GB system. If the problem is runaway memory usage by darktable, this should cause it to fail some operations or possibly crash, but would prevent the system freeze. Note that "ulimit" isn't enforced on all system, so it might also do nothing....

NohWayJose commented 23 hours ago

ulimit is installed on my system and so I presume it's enforced? I've got 64GB Ram, so I tried (as me, not sudo): ulimit -m 48000000 -v 48000000 which returned: bash: ulimit: max memory size: cannot modify limit: Operation not permitted

Did I do that right ?

pehar1 commented 2 hours ago

To my knowlede ulimit needs sudo privileges.

ralfbrown commented 1 hour ago

User accounts should be able to reduce limits; that works just fine for me. Raising limits, on the other hand does require elevated privileges, and attempting to do so from a user account gives me exactly the error message you reported.

So it's likely that your system already includes a per-process restriction on memory. What does "ulimit -a" report for "max memory size" and "virtual memory"?