darktable-org / darktable-org/darktable

macOS: SIGSEGV in _gradient_events_button_pressed

Open
#20,759 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

no-issue-activity
Dominant language
C
Stars
13.1k
Forks
1.4k
Avg merge
22h 14m
Merged PRs (30d)
198

Description

Is there an existing issue for this?
  • I checked and did not find my issue in the already reported ones
Describe the bug

I tried to add a second (ctrl+click) gradient mask in darkroom and got an NPE here:

Exception Type:    EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000000
Exception Codes:   0x0000000000000001, 0x0000000000000000

Termination Reason:  Namespace SIGNAL, Code 11, Segmentation fault: 11
Terminating Process: exc handler [27410]


VM Region Info: 0 is not in any region.  Bytes before following region: 4303273984
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      UNUSED SPACE AT START
--->
      __TEXT                      1007ec000-100800000    [   80K] r-x/r-x SM=COW  /Applications/darktable.app/Contents/MacOS/darktable

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   libdarktable.dylib            	       0x1011ee800 _gradient_events_button_pressed + 88
1   libdarktable.dylib            	       0x1011f66cc dt_masks_events_button_pressed + 248
2   libdarkroom.so                	       0x120358844 button_pressed + 584
3   libdarktable.dylib            	       0x10119377c dt_control_button_pressed + 360
4   libdarktable.dylib            	       0x101255d08 _button_pressed + 108 

see attached dump for full info.

Steps to reproduce

Add a second gradient mask (with ctrl+click). Mask indicator can't be detached from mouse with single left click (only with right click which btw is inconsistent UI behaviour in my point of view). On double left click NPE occurs. Bug is reproducable, but not necessarily with other masks, tried circular mask as alternative only.

Expected behavior

No NPE of course and probably consistent left click behaviour

Logfile | Screenshot | Screencast

darktable_dump.txt

Commit

No response

Where did you obtain darktable from?

darktable.org / GitHub release

darktable version

5.4.1

What OS are you using?

Mac

What is the version of your OS?

Tahoe 26.4 (25E246)

Describe your system
Model: Mac15,6, BootROM 18000.101.7, proc 12:6:6:0 processors, 36 GB, SMC
Graphics: Apple M3 Pro, Apple M3 Pro, Built-In
Display: HP Z32k G3, 6016 x 3384, Main, MirrorOff, Online
Memory Module: LPDDR5, Micron                 
AirPort: spairport_wireless_card_type_wifi (0x14E4, 0x4388), wl0: Feb  2 2026 19:18:00 version 23.50.20.0.41.51.208 FWID 01-3e23bec0
IO80211_driverkit-1555.23 "IO80211_driverkit-1555.23" Mar  5 2026 21:45:55
AirPort: 
Bluetooth: Version (null), 0 services, 0 devices, 0 incoming serial ports
Network Service: USB 10/100/1000 LAN, Ethernet, en10
Network Service: Wi-Fi, AirPort, en0
Thunderbolt Bus: MacBook Pro, Apple Inc.      
Thunderbolt Device: Z32k G3, HP, 1, 38.5
Thunderbolt Bus: MacBook Pro, Apple Inc.      
Thunderbolt Bus: MacBook Pro, Apple Inc.
Are you using OpenCL GPU in darktable?

None

If yes, what is the GPU card and driver?

No response

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

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the second gradient-mask interaction in darkroom and inspect the crash dump around _gradient_events_button_pressed, dt_masks_events_button_pressed, and button_pressed. Trace the double- and left-click paths for the mask indicator, then verify that adding a second gradient mask and subsequent clicks no longer cause a SIGSEGV and that the expected detachment behavior is consistent.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, macos
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.