Skip to content

[AI] Fix crash with --library :memory: by skipping disk cache#20623

Merged
TurboGit merged 1 commit intodarktable-org:masterfrom
andriiryzhkov:mask_in_memory
Mar 22, 2026
Merged

[AI] Fix crash with --library :memory: by skipping disk cache#20623
TurboGit merged 1 commit intodarktable-org:masterfrom
andriiryzhkov:mask_in_memory

Conversation

@andriiryzhkov
Copy link
Copy Markdown
Contributor

Fixes #20611 :

When darktable runs with --library :memory: (in-memory database for testing), the disk cache for object mask encoder embeddings crashed because dt_database_get_path() returns ":memory:" which is not a valid filesystem path.

The g_realpath(":memory:") call logged path lookup ':memory:' fails and the subsequent cache operations failed.

Fix

_get_cache_dir() now returns FALSE when the database is unavailable or in-memory. Callers skip disk cache operations gracefully — encoding still works, just without caching between sessions.

Copy link
Copy Markdown
Member

@TurboGit TurboGit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thanks!

@TurboGit TurboGit added this to the 5.6 milestone Mar 22, 2026
@TurboGit TurboGit added the bugfix pull request fixing a bug label Mar 22, 2026
@TurboGit TurboGit merged commit 5d57b2d into darktable-org:master Mar 22, 2026
5 checks passed
@andriiryzhkov andriiryzhkov deleted the mask_in_memory branch March 22, 2026 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix pull request fixing a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mac, onnxruntime crashing in 'memory'

2 participants