ufraw-batch in bionic segfault

Bug #1768855 reported by Eugene Romanenko on 2018-05-03
76
This bug affects 14 people
Affects Status Importance Assigned to Milestone
UFRaw
New
Undecided
Unassigned
lensfun (Ubuntu)
Undecided
Unassigned
ufraw (Ubuntu)
Undecided
Unassigned

Bug Description

Segmentation fault after any manipulation with any RAW files.

Example:

---
eugene@eugene:~/Изображения$ ufraw-batch --embedded-image IMG_1375.CR2
ufraw-batch: Loaded IMG_1375.CR2
ufraw-batch: Saved /home/eugene/Изображения/IMG_1375.embedded.jpg
Segmentation fault (core dumped)
---

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: ufraw-batch 0.22-3
ProcVersionSignature: Ubuntu 4.15.0-20.21-generic 4.15.17
Uname: Linux 4.15.0-20-generic x86_64
ApportVersion: 2.20.9-0ubuntu7
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Thu May 3 16:54:23 2018
InstallationDate: Installed on 2017-11-15 (169 days ago)
InstallationMedia: Ubuntu 18.04 LTS "Bionic Beaver" - Alpha amd64 (20171114)
SourcePackage: ufraw
UpgradeStatus: No upgrade log present (probably fresh install)

Eugene Romanenko (eros2) wrote :
Eugene Romanenko (eros2) on 2018-05-04
summary: - ufraw-batch in bionic crashes
+ ufraw-batch in bionic segfault
tags: removed: wayland-session
description: updated
Robert Strube (robstrube) wrote :

I can also confirm that I also have similar problems when attempting to run ufraw. I discovered it when trying to setup ufraw-batch as my thumbnailer for RAW files (specifically for me olympus .orf files).

I've discovered the following debian bug report which I believe is related. It's actually caused by liblensfun (which ufraw-batch is compiled against by default).

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=862662

When ufraw-batch runs (as the thumbnailer) my syslog fills up with these messages (one for each attempted thumbnail generation):

May 26 12:49:13 RYZEN kernel: [ 2896.326150] ufraw-batch[16764]: segfault at 38 ip 00007f800c2d4b64 sp 00007fff8280a470 error 4 in liblensfun.so.0.3.2[7f800c2c1000+1a000]

I did some more investigation, and the ufraw developers claim it's a bug in liblensfun that needs to be fixed.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ufraw (Ubuntu):
status: New → Confirmed
Kyle Fazzari (kyrofa) wrote :

I'm hitting this in 18.04 as well, trying to use ufraw-batch for my .CR2 thumbnails.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in lensfun (Ubuntu):
status: New → Confirmed
Kristiyan Tachev (rampager289) wrote :

I have faced the same issue with latest 18.04.1 version of ubuntu.

I understand that even if it says that "core is dumped" the file is converted correctly so i decided to just iterate over my files and even if status for command is 1 all files will be converted according to the for statement.

```
for d in ./* ; do ( ufraw-batch $d --out-type=jpeg ); done;
```

Eugene Romanenko (eros2) wrote :

Kristiyan, yes, it converts one file correctly, then crash.

But I mostly use ufraw-batch as thumbnail generator (Ex. https://gist.github.com/h4cc/7a7938d774a50b421922 ) and in this mode return status prevents thumbnails from creation.

Kristiyan Tachev (rampager289) wrote :

@Eugene Romanenko the strange thing was before doing this somehow i was able to convert more than 60 files without problem then it appears "core is dumped".hmm....

How is this even possible ?

steve davis (launch-faygate) wrote :

I think this may be the same problem I am having: see bug #1791138

Probably is as big in lensfun, but the sad thing is that even calling it with --lensfun=none still give the core dump...

I compiled ufraw-batch with -g, and this is the result:

tarting program: /home/romano/tmp/src/ufraw-0.22/ufraw-batch --embedded-image --out-type=png --size=64 p1040069.rw2 --overwrite --silent --output=uffa.png
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff71acb64 in lfModifier::~lfModifier() ()
   from /usr/lib/x86_64-linux-gnu/liblensfun.so.1
(gdb) RuntimeError: object at 0x7ff6cee868c0 of type ColumnExtension is not initialized
bt
#0 0x00007ffff71acb64 in lfModifier::~lfModifier() ()
   from /usr/lib/x86_64-linux-gnu/liblensfun.so.1
#1 0x00007ffff71acb89 in lfModifier::Destroy() ()
   from /usr/lib/x86_64-linux-gnu/liblensfun.so.1
#2 0x00005555555f5a62 in ufraw_close (uf=0x5555559ed940) at ufraw_ufraw.c:770
#3 0x00005555555f266f in main (argc=8, argv=0x7fffffffe338)
    at ufraw-batch.c:107
(gdb) quit
A debugging session is active.

So I tried to recompile it with

/* have the lensfun library */
/* #define HAVE_LENSFUN 1 */
#undef HAVE_LENSFUN

(I was unable to find a configure option to disable lensfun) and now the resulting ufraw-batch is not segfaulting any more. Unfortunately, still I can't generate thumbnails for raw files... I'm stuck.

Eugene Romanenko (eros2) wrote :

Romano,

"Unfortunately, still I can't generate thumbnails for raw files..." - to workaround this I installed old ufraw-batch package from ubuntu 16.04 - https://ubuntu.pkgs.org/16.04/ubuntu-universe-amd64/ufraw-batch_0.20-3build1_amd64.deb.html - also needs liblensfun0 and libpng12-0 - listed in Requires.
Download debs, install using dpkg -i, and mark packages hold to prevent update.

Thanks Eugene. I found the problem, was a typo in my MIME type (so it was really unrelated).

Your solution is probably better than mine, but if someone wants the ufraw-batch binary compiled without lensfun (you shouldn't trust binaries from internet) just tell me --- or I can post instructions on how to compile it.

BTW, I still think that if ufraw-batch is called with --nolensfun it should not fails in this case. I tried to follow the option handling, but I got lost.

Lauro Moura (lauromoura) wrote :

This seems to be the same problem as debian bug 898297. Attached is a patch that fixed the issue for me (already submitted it to the debian bug).

The attachment "Tentative patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Nick Smolinske (smolinux) wrote :

I'm running 18.04 and I have this error. However, I was able to get thumbnails working in Thunar. Ufraw is still segfaulting, but it creates the thumbnail first. So it seems it might be incidental and this bug is not causing the thumbnail issue.

The fix for me to get thumbnails was to run:

sudo update-mime-database

Then thunar -q, then restart Thunar.

Ted Cabeen (ted-cabeen) wrote :

The debian patch does work, as does the debian package, if installed with libjpeg62-turbo.

Same problem here when using ufraw as raw thumbnailer.

ufraw-batch[7493]: segfault at 38 ip 00007ff69be83b64 sp 00007ffe9f51f530 error 4 in liblensfun.so.0.3.2[7ff69be70000+1a000]

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.