Segfault on master branch using previous databases
Is there an existing issue for this?
- [x] I checked and did not find my issue in the already reported ones
Describe the bug
I was rebuilding code (sad story, SSD died a few months ago, just now restoring everything from the backup drive...). The code from the master branch (1e47fed-dirty) asked to update the database schema, and then crashed with a segfault in src/gui/accelerators.c in dt_action_insert_sorted(). Now it doesn't ask to update the schema, but still segfaults. So I moved my ~/.config/darktable to another location, and darktable runs just fine starting with a brand new database.
Would you like me to track this down further? I can recreate everything for my needs, but if you see value in catching a likely rare bug I'll see what I can find out.
Cheers, Jeff
Would you like me to track this down further?
Steps to reproduce
Have to use my particular database I believe...
Expected behavior
segfaults
Logfile | Screenshot | Screencast
darktable 1e47fed-dirty Copyright (C) 2012-2025 Johannes Hanika and other contributors.
Compile options: Bit depth -> 64 bit Exiv2 -> 0.27.6 Lensfun -> 0.3.4 Debug -> DISABLED SSE2 optimizations -> ENABLED OpenMP -> ENABLED OpenCL -> ENABLED Lua -> DISABLED Colord -> ENABLED gPhoto2 -> ENABLED OSMGpsMap -> DISABLED - map view is NOT available GMIC -> DISABLED - Compressed LUTs are NOT supported GraphicsMagick -> ENABLED ImageMagick -> DISABLED libavif -> DISABLED libheif -> ENABLED libjxl -> ENABLED LibRaw -> ENABLED - Version 0.22.0-Devel202502 OpenJPEG -> DISABLED 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.0009 [dt starting]
./darktable -d perf
2.3711 [dt_dev_load_raw] loading the image. took 0.067 secs (0.200 CPU)
2.4374 [export] creating pixelpipe took 0.057 secs (0.166 CPU)
2.4375 [dev_pixelpipe] took 0.000 secs (0.000 CPU) initing base buffer [thumbnail]
2.4423 [dev_pixelpipe] took 0.005 secs (0.004 CPU) [thumbnail] processed rawprepare' on GPU, blended on GPU 2.4440 [dev_pixelpipe] took 0.002 secs (0.001 CPU) [thumbnail] processed temperature' on GPU, blended on GPU
2.4513 [dev_pixelpipe] took 0.007 secs (0.006 CPU) [thumbnail] processed highlights' on GPU, blended on GPU 2.4542 [dev_pixelpipe] took 0.003 secs (0.001 CPU) [thumbnail] processed demosaic' on GPU, blended on GPU
2.4553 [dev_pixelpipe] took 0.001 secs (0.001 CPU) [thumbnail] processed exposure' on GPU, blended on GPU 2.4571 [dev_pixelpipe] took 0.002 secs (0.001 CPU) [thumbnail] processed colorin' on GPU, blended on GPU
2.4598 [dt_ioppr_transform_image_colorspace_cl] IOP_CS_LAB-->IOP_CS_RGB took 0.002 secs (0.002 GPU) [colorbalancergb]
2.4623 [dev_pixelpipe] took 0.005 secs (0.003 CPU) [thumbnail] processed colorbalancergb' on GPU, blended on GPU 2.4635 [dev_pixelpipe] took 0.001 secs (0.001 CPU) [thumbnail] processed sigmoid' on GPU, blended on GPU
2.4667 [dev_pixelpipe] took 0.003 secs (0.001 CPU) [thumbnail] processed filmicrgb' on GPU, blended on GPU 2.4689 [dt_ioppr_transform_image_colorspace_cl] IOP_CS_RGB-->IOP_CS_LAB took 0.002 secs (0.002 GPU) [colorout] 2.4705 [dev_pixelpipe] took 0.004 secs (0.002 CPU) [thumbnail] processed colorout' on GPU, blended on GPU
2.4740 [dev_pixelpipe] took 0.003 secs (0.010 CPU) [thumbnail] processed `gamma' on CPU, blended on CPU
2.4740 [dev_process_thumbnail] pixel pipeline processing took 0.037 secs (0.031 CPU)
welty@lt1:~/images/src/darktable_git/darktable_Dec2$ sh run_build.sh
darktable 1e47fed-dirty
Copyright (C) 2012-2025 Johannes Hanika and other contributors.
Compile options: Bit depth -> 64 bit Exiv2 -> 0.27.6 Lensfun -> 0.3.4 Debug -> DISABLED SSE2 optimizations -> ENABLED OpenMP -> ENABLED OpenCL -> ENABLED Lua -> DISABLED Colord -> ENABLED gPhoto2 -> ENABLED OSMGpsMap -> DISABLED - map view is NOT available GMIC -> DISABLED - Compressed LUTs are NOT supported GraphicsMagick -> ENABLED ImageMagick -> DISABLED libavif -> DISABLED libheif -> ENABLED libjxl -> ENABLED LibRaw -> ENABLED - Version 0.22.0-Devel202502 OpenJPEG -> DISABLED 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.0001 [dt starting]
./darktable -d perf
(darktable:9870): GLib-CRITICAL **: 16:42:57.520: g_utf8_collate: assertion 'str1 != NULL' failed [New LWP 9904] [New LWP 9903] [New LWP 9902] [New LWP 9901] [New LWP 9900] [New LWP 9899] [New LWP 9898] [New LWP 9895] [New LWP 9894] [New LWP 9893] [New LWP 9892] [New LWP 9891] [New LWP 9890] [New LWP 9889] [New LWP 9888] [New LWP 9887] [New LWP 9886] [New LWP 9885] [New LWP 9884] [New LWP 9883] [New LWP 9882] [New LWP 9881] [New LWP 9880] [New LWP 9879] [New LWP 9878] [New LWP 9877] [New LWP 9876] [New LWP 9875] [New LWP 9874] [New LWP 9873] [New LWP 9872] [New LWP 9871]
warning: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libglib-2.0.so.0
warning: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libgdk-3.so.0
warning: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0
warning: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libgio-2.0.so.0
warning: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libgobject-2.0.so.0
warning: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libgphoto2.so.6
warning: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libgphoto2_port.so.12
warning: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libOpenEXR-3_1.so.30
warning: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libgmodule-2.0.so.0
warning: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libcolord.so.2
warning: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libIlmThread-3_1.so.30
warning: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libIex-3_1.so.30
warning: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libbrotlidec.so.1
warning: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/liblber.so.2
warning: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libbrotlicommon.so.1
warning: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libcap.so.2
warning: could not find '.gnu_debugaltlink' file for /usr/lib/x86_64-linux-gnu/gtk-3.0/modules/libxapp-gtk3-module.so
warning: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libxapp.so.1
warning: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libgnomekbdui.so.8
warning: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libgnomekbd.so.8
warning: could not find '.gnu_debugaltlink' file for /usr/lib/x86_64-linux-gnu/gio/modules/libgvfsdbus.so
warning: could not find '.gnu_debugaltlink' file for /usr/lib/x86_64-linux-gnu/gvfs/libgvfscommon.so [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". 0x0000712683f10813 in __GI___wait4 (pid=pid@entry=9905, stat_loc=stat_loc@entry=0x0, options=options@entry=0, usage=usage@entry=0x0) at ../sysdeps/unix/sysv/linux/wait4.c:30
warning: 30 ../sysdeps/unix/sysv/linux/wait4.c: No such file or directory
warning: Currently logging to /tmp/darktable_bt_LZ48G3.txt. Turn the logging off and on to make the new setting effective.
#0 0x0000712683f10813 in __GI___wait4 (pid=pid@entry=9905, stat_loc=stat_loc@entry=0x0, options=options@entry=0, usage=usage@entry=0x0) at ../sysdeps/unix/sysv/linux/wait4.c:30
#1 0x0000712683f1091b in __GI___waitpid (pid=pid@entry=9905, stat_loc=stat_loc@entry=0x0, options=options@entry=0) at ./posix/waitpid.c:38
#2 0x00007126843a3e00 in _dt_sigsegv_handler (param=11) at /home/welty/images/src/darktable_git/darktable_Dec2/src/common/system_signal_handling.c:97
#3 0x0000712683e45330 in
=========
Commit
No response
Where did you obtain darktable from?
darktable.org / GitHub release
darktable version
1e47fed-dirty
What OS are you using?
Linux
What is the version of your OS?
mint 22.2
Describe your system
No response
Are you using OpenCL GPU in darktable?
Yes
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
Can we assume that your library file got corrupted when darktable crashed during the database schema update? If yes, can you try to open the database in sqlitebrowser and browse the tables to check if there is something weird (if it can be opened with sqlitebrowser)?
@da-phil Darktable did not crash during the schema update, it crashed (still crashes) with the updated database. Great idea to use sqlitebrowser to see if there is something weird going on. I have the un-updated database as well, so maybe I can spot what is going on. Seems to be something in the styles, so not a lot of records to look at.
I'll pursue this and get back with what I find.
If you do this, please don't forget to check both, the library.db as well as the data.db file.
Seems like there is no relation to DB in the crash. Can you test by removing (backup if needed) the shortcutsrc file from ~/.config/darktable?
If it works without shortcutsrc maybe post it here for analysis.
@TurboGit, @da-phil
- removing shortcutsrc did not fix it.
- databases (data.db, library.db) were not corrupt as far as sqlitebrowser was concerned.
- what I did discover, is the styles in data.db->styles table with iop_list fields of NULL were causing the crash, unless the style name indicated an "internal use" style -- i.e. style name starts with "_l10n_darktable".
For a test, I filtered out the offending styles in dt_init_styles_actions()
I am not suggesting the following is the correct fix (because I really have no idea how all this works), but here is hacked code for dt_init_styles_actions() in styles.c at line 1706 that will let the master branch run for my current data.db. Looks like the styles are correctly loaded and I am able to apply them (presumeablly loaded from ~/.config/darktable/styles/... )
I am posting this -- hoping someone with more experience with the style loading code will look at this snippet and have a better clue about what may be going wrong here or somewhere else in the code with regard to my current styles...
` void dt_init_styles_actions() { GList *result = dt_styles_get_list("");
if(result) { dt_action_t *stl = dt_action_section(&darktable.control->actions_global, N_("styles")); for(GList *res_iter = result; res_iter; res_iter = g_list_next(res_iter)) { dt_style_t *style = res_iter->data; gchar tmp[16] ;
for(int i=0 ; i < 15 && i < strlen(style->name) ; i++) {
tmp[i] = style->name[i] ;
}
tmp[15] = '\0' ;
gboolean is_dt_internal_style = strcmp(tmp,"_l10n_darktable") ? FALSE : TRUE ;
if(is_dt_internal_style || dt_styles_has_module_order(style->name) ) {
// only call dt_action_register() for:
// "internal" styles, i.e. name begins with "_l10n_darktable"
// or the iop_list column is populated
printf("dt_action_register: %s\n", style->name) ;
dt_action_register(stl, style->name, _apply_style_shortcut_callback, 0, 0);
} else {
printf("dt_action_register, SKIP: %s\n", style->name) ;
}
}
g_list_free_full(result, dt_style_free);
} } `