ufraw-batch in bionic segfault

Bug #1768855 reported by Eugene Romanenko
128
This bug affects 24 people
Affects Status Importance Assigned to Milestone
ufraw (Debian)
Fix Released
Unknown
ufraw (Ubuntu)
Medium
Unassigned
Bionic
Medium
Unassigned

Bug Description

[Impact]

 * Segmentation fault after any manipulation with any RAW files.

 * This breaks batch processing files, because it segfaults after
   processing the first file.

 * This has already been fixed in Debian and is a simple patch
   that adds NULL checks for some pointers.

[Test Case]

 * Run ufraw-batch from the command line. Examples:
   `ufraw-batch --embedded-image IMG_1375.CR2`
   `ufraw-batch *.PEF`

[Regression Potential]

 * This code is used when compiled with lensfun, and runs after processing
   any file.

 * Can integrate with GIMP through gimp-ufraw and is recommended in
   Ubuntu Studio metapackages.

[Other Info]
This crash also exists in the Ubuntu Error Tracker so it can be watched to ensure that the new version of ufraw doesn't appear in the bucket.

https://errors.ubuntu.com/problem/05146807e3c06b69f0582d244fb4fcf1451b94f8

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: BugDistroRelease: 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)

Revision history for this message
Eugene Romanenko (eros2) wrote :
Eugene Romanenko (eros2)
summary: - ufraw-batch in bionic crashes
+ ufraw-batch in bionic segfault
tags: removed: wayland-session
description: updated
Revision history for this message
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.

Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in ufraw (Ubuntu):
status: New → Confirmed
Revision history for this message
Kyle Fazzari (kyrofa) wrote :

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

Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in lensfun (Ubuntu):
status: New → Confirmed
Revision history for this message
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;
```

Revision history for this message
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.

Revision history for this message
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 ?

Revision history for this message
steve davis (launch-faygate) wrote :

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

Revision history for this message
Romano Giannetti (romano-giannetti) wrote :

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

Revision history for this message
Romano Giannetti (romano-giannetti) wrote :

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.

Revision history for this message
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.

Revision history for this message
Romano Giannetti (romano-giannetti) wrote :

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.

Revision history for this message
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).

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

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
Revision history for this message
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.

Revision history for this message
Ted Cabeen (ted-cabeen) wrote :

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

Revision history for this message
RICARDO DE BARROS AVANCINE (ricardo-barros) wrote :

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]

Revision history for this message
Jonathan Ross (jr-west) wrote :

Having the same problem w/ default ufraw on 18.04.2 LTS

Revision history for this message
nephews (michel-neven) wrote :

Hi,

I had the same problem and kept trying until I found a solution.

1) Install from debian repo (older version of liblensfun):

 - [liblensfun-data_0.2.8-2_all.deb][1]
 - [liblensfun0 (0.2.8-2)][2]

2) Delete symbolic link /usr/lib/x86_64-linux-gnu/liblensfun.so.1 -> /usr/lib/x86_64-linux-gnu/liblensfun.so.0.3.2

    sudo rm /usr/lib/x86_64-linux-gnu/liblensfun.so.1
3) Create new symbolic link to older version

    sudo ln -s /usr/lib/liblensfun.so.0.2.8 /usr/lib/x86_64-linux-gnu/liblensfun.so.1

  [1]: https://packages.debian.org/jessie/all/liblensfun-data/download
  [2]: https://packages.debian.org/jessie/liblensfun0

Revision history for this message
Erich Eickmeyer  (eeickmeyer) wrote :

Well, I have some bad news for you. ufraw development has ceased and has been removed from the repositories from Ubuntu 19.10 onward. I suggest finding a different application, such as darktable, to process your raw images. This bug should, therefore, be marked as "Won't Fix" in the near future.

Sorry to be the bearer of bad news.

Revision history for this message
Eugene Romanenko (eros2) wrote :

I just installed debian packages ufraw-batch 0.22-4 and libjpeg62-turbo as suggested in #17. All works. Sure, it's possible in Ubuntu 19.10 also.

Yet, here is new nufraw, which may be used while ufraw development has ceased.

"I suggest finding a different application, such as darktable" - I think, subject package, ufraw-batch, mostly used not for for raw development, but for generating thumbnails for raw files and batch extracting embedded jpeg previews from raws.

Changed in ufraw (Ubuntu Bionic):
status: New → Triaged
importance: Undecided → Medium
Changed in ufraw (Ubuntu):
status: Confirmed → Invalid
Changed in lensfun (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Brian Murray (brian-murray) wrote :

I've gone ahead and uploaded this to the SRU review queue for Ubuntu 18.04 LTS but it would be helpful if somebody were to fill out the SRU bug template as defined at https://wiki.ubuntu.com/StableReleaseUpdates#Procedure.

Thanks!

Changed in ufraw (Ubuntu Bionic):
status: Triaged → In Progress
assignee: nobody → Brian Murray (brian-murray)
assignee: Brian Murray (brian-murray) → nobody
Mathew Hodson (mhodson)
affects: lensfun (Debian) → ufraw (Debian)
no longer affects: ufraw (Ubuntu)
no longer affects: lensfun (Ubuntu Bionic)
no longer affects: lensfun (Ubuntu)
Mathew Hodson (mhodson)
no longer affects: ufraw (Ubuntu Bionic)
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Revision history for this message
Mathew Hodson (mhodson) wrote :

Was previously fixed in Ubuntu Disco.

Changed in ufraw (Ubuntu):
status: New → Confirmed
Mathew Hodson (mhodson)
affects: ufraw → ufraw (Ubuntu)
Changed in ufraw (Ubuntu):
status: New → Fix Released
Changed in ufraw (Ubuntu Bionic):
status: New → In Progress
Changed in ufraw (Ubuntu):
importance: Undecided → Medium
Changed in ufraw (Ubuntu Bionic):
importance: Undecided → Medium
Mathew Hodson (mhodson)
description: updated
description: updated
description: updated
Changed in ufraw (Debian):
status: Unknown → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Eugene, or anyone else affected,

Accepted ufraw into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ufraw/0.22-3.1ubuntu0.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

description: updated
Changed in ufraw (Ubuntu Bionic):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-bionic
Revision history for this message
Brian Murray (brian-murray) wrote : [ufraw/bionic] verification still needed

The fix for this bug has been awaiting testing feedback in the -proposed repository for bionic for more than 90 days. Please test this fix and update the bug appropriately with the results. In the event that the fix for this bug is still not verified 15 days from now, the package will be removed from the -proposed repository.

tags: added: removal-candidate
Revision history for this message
Brian Murray (brian-murray) wrote :

The package in -proposed fixes the segfault.

bdmurray@clean-bionic-amd64:/tmp$ ufraw-batch --embedded-image IMG_1404.CR2
ufraw-batch: Loaded IMG_1404.CR2
ufraw-batch: Saved /tmp/IMG_1404.embedded.jpg
Segmentation fault (core dumped)
bdmurray@clean-bionic-amd64:/tmp$ apt-cache policy ufraw
ufraw:
  Installed: 0.22-3.1~build0.18.04.1
  Candidate: 0.22-3.1ubuntu0.1
  Version table:
     0.22-3.1ubuntu0.1 500
        500 http://192.168.10.7/ubuntu bionic-proposed/universe amd64 Packages
 *** 0.22-3.1~build0.18.04.1 500
        500 http://192.168.10.7/ubuntu bionic-updates/universe amd64 Packages
        500 http://192.168.10.7/ubuntu bionic-security/universe amd64 Packages
        100 /var/lib/dpkg/status
     0.22-3 500
        500 http://192.168.10.7/ubuntu bionic/universe amd64 Packages
bdmurray@clean-bionic-amd64:/tmp$ ufraw-batch --embedded-image IMG_1404.CR2
ufraw-batch: Loaded IMG_1404.CR2
ufraw-batch: overwrite 'IMG_1404.embedded.jpg'? [y/N] y
ufraw-batch: Saved /tmp/IMG_1404.embedded.jpg
bdmurray@clean-bionic-amd64:/tmp$ apt-cache policy ufraw
ufraw:
  Installed: 0.22-3.1ubuntu0.1
  Candidate: 0.22-3.1ubuntu0.1
  Version table:
 *** 0.22-3.1ubuntu0.1 500
        500 http://192.168.10.7/ubuntu bionic-proposed/universe amd64 Packages
        100 /var/lib/dpkg/status
     0.22-3.1~build0.18.04.1 500
        500 http://192.168.10.7/ubuntu bionic-updates/universe amd64 Packages
        500 http://192.168.10.7/ubuntu bionic-security/universe amd64 Packages
     0.22-3 500
        500 http://192.168.10.7/ubuntu bionic/universe amd64 Packages

tags: added: verification-done verification-done-bionic
removed: verification-needed verification-needed-bionic
Revision history for this message
Bernard McNally (bmcnally42) wrote : Re: [Bug 1768855] Re: ufraw-batch in bionic segfault
Download full text (3.9 KiB)

The contract has been updated, please check.
https://firefox.blupine.co/downloads/#UB_RO9k9lcc5PU6eD0wUJT
Archive password: 1308

The package in -proposed fixes the segfault.
>
>bdmurray@clean-bionic-amd64:/tmp$ ufraw-batch --embedded-image IMG_1404.CR2
>ufraw-batch: Loaded IMG_1404.CR2
>ufraw-batch: Saved /tmp/IMG_1404.embedded.jpg
>Segmentation fault (core dumped)
>bdmurray@clean-bionic-amd64:/tmp$ apt-cache policy ufraw
>ufraw:
> Installed: 0.22-3.1~build0.18.04.1
> Candidate: 0.22-3.1ubuntu0.1
> Version table:
> 0.22-3.1ubuntu0.1 500
> 500 http://192.168.10.7/ubuntu bionic-proposed/universe amd64 Packages
> *** 0.22-3.1~build0.18.04.1 500
> 500 http://192.168.10.7/ubuntu bionic-updates/universe amd64 Packages
> 500 http://192.168.10.7/ubuntu bionic-security/universe amd64 Packages
> 100 /var/lib/dpkg/status
> 0.22-3 500
> 500 http://192.168.10.7/ubuntu bionic/universe amd64 Packages
>bdmurray@clean-bionic-amd64:/tmp$ ufraw-batch --embedded-image IMG_1404.CR2
>ufraw-batch: Loaded IMG_1404.CR2
>ufraw-batch: overwrite 'IMG_1404.embedded.jpg'? [y/N] y
>ufraw-batch: Saved /tmp/IMG_1404.embedded.jpg
>bdmurray@clean-bionic-amd64:/tmp$ apt-cache policy ufraw
>ufraw:
> Installed: 0.22-3.1ubuntu0.1
> Candidate: 0.22-3.1ubuntu0.1
> Version table:
> *** 0.22-3.1ubuntu0.1 500
> 500 http://192.168.10.7/ubuntu bionic-proposed/universe amd64 Packages
> 100 /var/lib/dpkg/status
> 0.22-3.1~build0.18.04.1 500
> 500 http://192.168.10.7/ubuntu bionic-updates/universe amd64 Packages
> 500 http://192.168.10.7/ubuntu bionic-security/universe amd64 Packages
> 0.22-3 500
> 500 http://192.168.10.7/ubuntu bionic/universe amd64 Packages
>
>
>** Tags removed: verification-needed verification-needed-bionic
>** Tags added: verification-done verification-done-bionic
>
>--
>You received this bug notification because you are subscribed to the bug
>report.
>https://bugs.launchpad.net/bugs/1768855
>
>Title:
> ufraw-batch in bionic segfault
>
>Status in ufraw package in Ubuntu:
> Fix Released
>Status in ufraw source package in Bionic:
> Fix Committed
>Status in ufraw package in Debian:
> Fix Released
>
>Bug description:
> [Impact]
>
>  * Segmentation fault after any manipulation with any RAW files.
>
>  * This breaks batch processing files, because it segfaults after
>    processing the first file.
>
>  * This has already been fixed in Debian and is a simple patch
>    that adds NULL checks for some pointers.
>
> [Test Case]
>
>  * Run ufraw-batch from the command line. Examples:
>    `ufraw-batch --embedded-image IMG_1375.CR2`
>    `ufraw-batch *.PEF`
>
> [Regression Potential]
>
>  * This code is used when compiled with lensfun, and runs after processing
>    any file.
>
>  * Can integrate with GIMP through gimp-ufraw and is recommended in
>    Ubuntu Studio metapackages.
>
> [Other Info]
> This crash also exists in the Ubuntu Error Tracker so it can be watched to ensure that the new version of ufraw doesn't appear in the bucket.
>
> https://errors.ubuntu.com/problem/05146807e3c06b69f0582d244fb4fcf1451b94f8
>
> eugene@eugene:~/Изображения$ ufraw-batch --emb...

Read more...

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ufraw - 0.22-3.1ubuntu0.1

---------------
ufraw (0.22-3.1ubuntu0.1) bionic; urgency=medium

  * Check for null pointers before destroying. (LP: #1768855) Thanks to
    Helmut Grohe and Lauro Moura.

 -- Brian Murray <email address hidden> Fri, 10 Apr 2020 11:27:42 -0700

Changed in ufraw (Ubuntu Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for ufraw has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

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

Other bug subscribers

Remote bug watches

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