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).
** Patch added: "Tentative patch" https://bugs.launchpad.net/ubuntu/+source/ufraw/+bug/1768855/+attachment/5201431/+files/05_lensfun_destroy_cleanup.patch -- You received this bug notification because you are a member of Ubuntu Studio Bugs, which is subscribed to ufraw in Ubuntu. Matching subscriptions: Ubuntu Studio Bugs https://bugs.launchpad.net/bugs/1768855 Title: ufraw-batch in bionic segfault Status in UFRaw: New Status in lensfun package in Ubuntu: Confirmed Status in ufraw package in Ubuntu: Confirmed 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) To manage notifications about this bug go to: https://bugs.launchpad.net/ufraw/+bug/1768855/+subscriptions -- Mailing list: https://launchpad.net/~ubuntustudio-bugs Post to : ubuntustudio-bugs@lists.launchpad.net Unsubscribe : https://launchpad.net/~ubuntustudio-bugs More help : https://help.launchpad.net/ListHelp