Project

General

Profile

Bug #11007

Thumbnails: "race condition" between dt_image_altered() and auto_apply_presets()

Added by Roman Lebedev almost 2 years ago.

Status:
New
Priority:
Medium
Assignee:
-
Category:
Lighttable
Target version:
-
Start date:
04/25/2016
Due date:
% Done:

0%

Affected Version:
git development version
System:
all
bitness:
64-bit
hardware architecture:
amd64/x86

Description

When _init_8() tries to create thumbnail, it first tries to
use embedded thumbnail, if:
  1. the image is not altered according to dt_image_altered()
  2. config option never_use_embedded_thumb is not set

BUT.

If there are auto-appliable presets, and they are not applied
yet (e.g. right after history reset), dt_image_altered() will
say that the image is not altered.

Because those auto-appliable presets are applied by auto_apply_presets(),
which is only called by the export after we decide that image is modified:

#0 0x00007ffff7c3e89f in auto_apply_presets (dev=dev@entry=0x7fffdf110c10) at /home/lebedevri/darktable/src/develop/develop.c:851
#1 0x00007ffff7c416f4 in dt_dev_read_history (dev=0x7fffdf110c10) at /home/lebedevri/darktable/src/develop/develop.c:988
#2 0x00007ffff7c42261 in dt_dev_load_image (dev=dev@entry=0x7fffdf110c10, imgid=imgid@entry=186) at /home/lebedevri/darktable/src/develop/develop.c:488
#3 0x00007ffff7c0da34 in dt_imageio_export_with_flags (imgid=imgid@entry=186, filename=filename@entry=0x7ffff7d48d8f "unused", format=format@entry=0x7fffdf122520, format_params=format_params@entry=0x7fffdf122480, ignore_exif=ignore_exif@entry=1, display_byteorder=display_byteorder@entry=0, high_quality=0, upscale=0, thumbnail_export=1, filter=0x0, copy_metadata=0, storage=0x0, storage_params=0x0, num=1, total=1) at /home/lebedevri/darktable/src/common/imageio.c:551
#4 0x00007ffff7c1dc0c in dt_mipmap_cache_get_with_caller (size=DT_MIPMAP_0, imgid=186, color_space=0x7fffdf123a88, height=<optimized out>, width=<optimized out>, buf=<optimized out>) at /home/lebedevri/darktable/src/common/mipmap_cache.c:1265
#5 0x00007ffff7c1dc0c in dt_mipmap_cache_get_with_caller (cache=0x19758a0, buf=buf@entry=0x7fffdf123a70, imgid=186, mip=DT_MIPMAP_0, flags=flags@entry=DT_MIPMAP_BLOCKING, mode=mode@entry=114 'r', file=0x7ffff7d77200 "/home/lebedevri/darktable/src/control/jobs/image_jobs.c", line=36) at /home/lebedevri/darktable/src/common/mipmap_cache.c:734
#6 0x00007ffff7c3dd1c in dt_image_load_job_run (job=<optimized out>) at /home/lebedevri/darktable/src/control/jobs/image_jobs.c:36
#7 0x00007ffff7c38386 in dt_control_work (control=0x4f10d0) at /home/lebedevri/darktable/src/control/jobs.c:295
#8 0x00007ffff7c38386 in dt_control_work (ptr=<optimized out>) at /home/lebedevri/darktable/src/control/jobs.c:526
#9 0x00007ffff39f0454 in start_thread (arg=0x7fffdf124700) at pthread_create.c:334
#10 0x00007fffefdbeeed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

So it is chicken-and-the-egg problem :(

Also available in: Atom PDF