Project

General

Profile

Bug #9447

segmentation fault when exporting website-gallery

Added by bremner - almost 6 years ago. Updated over 5 years ago.

Status:
Fixed
Priority:
Low
Category:
-
Start date:
05/30/2013
Due date:
% Done:

100%

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

Description

A Debian user reports (and I confirmed with 1.2.1)

-> Open darktable
-> 'import' a new folder of images
-> 'select' all
-> 'export selected'
 --> choose "website gallery" as 'target storage'
 --> select a new directory for export
      target directory will change to e.g. "/tmp/darktable/foo/$(FILE_NAME)" 
 --> click on 'export'

Result:
 * darktable starts exporting and eventually crashes
 * the target directory (e.g. "/tmp/darktable/foo/") will stay empty
 * the directory where darktable has been launched, will contain
   weird files, e.g.
      $ find .
      ./x
      ./x-thumb.jpg
      ./x.jpg
   another time i got files like:
          $ ls
      ?      <div><a class="dia" rel="lightbox[viewer]" title="??.jpg - &nbsp;" href="??.jpg"><span><
      ??
      ??-thumb.jpg
      ??.jpg
    (yes, that's filenames looking like HTML code!!)

For more details, and a backtrace, see

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=709174

Associated revisions

Revision eccdccae
Added by Tobias Ellinghaus over 5 years ago

Fix #9447: Don't crash when exporting to gallery

History

#1 Updated by Jörn Nettingsmeier over 5 years ago

i can confirm this behaviour with 1.2.2. it also exists in the current 1.3 git snapshot that's available from opensuse contributor toganm.

it appears the root of the bug is in the file chooser dialog: if you use it to select a base directory, weird characters appear in file and directory names, and the export process ultimately fails.

there is a workaround, which is described in the debian bug tracker thread: if you type the export base dir rather than using the file chooser, the export succeeds.

#2 Updated by Christian Kanzian over 5 years ago

  • Status changed from New to Confirmed
  • % Done changed from 0 to 10

I can confirm this with current 1.3+1376~g3e7e96e git version too.

if you use the file chooser dialog, the $(FILE_NAME) variable is appended automaticaly. dt crashes during export and you will find a folder and 2 files with scrambled file names in your home.
removing $(FILE_NAME) from the path by hand avoid this crash as descripted.

To me $(FILE_NAME) makes no sense in the path for a web gallery.

Changing src/imageio/storage/gallery.c line 96 from:

snprintf(composed, DT_MAX_PATH_LEN, "%s/$(FILE_NAME)", dir);

to:

snprintf(composed, DT_MAX_PATH_LEN, "%s/", dir);

avoids this behaviour.

But if a user type in $(FILE_NAME) he also will endup with a crash. I don't know how to fix it, because i have no coding skills.

#3 Updated by Tobias Ellinghaus over 5 years ago

  • % Done changed from 10 to 20
  • Assignee set to Tobias Ellinghaus
  • Status changed from Confirmed to Triaged
  • Target version set to Candidate for next minor release
  • bitness set to 64-bit
  • Affected Version changed from 1.2 to git development version

If noone is faster than me I will look into this. It seems there are several things going on that are not correct.

#4 Updated by Tobias Ellinghaus over 5 years ago

  • % Done changed from 20 to 100
  • Status changed from Triaged to Fixed

Applied in changeset darktable|commit:eccdccaed99e9fa259976d944d52fb2290ab408e.

Also available in: Atom PDF