Bug 454656 - When locales not set, crash occurs when opening "Settings -> Configure digikam"
Summary: When locales not set, crash occurs when opening "Settings -> Configure digikam"
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Metadata-ExifTool (show other bugs)
Version: 8.0.0
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-31 11:39 UTC by Kristian Karl
Modified: 2022-05-31 21:22 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 8.0.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kristian Karl 2022-05-31 11:39:46 UTC
SUMMARY
When using exiftool, and  locales are not set, the output from exiftool messes up(?) the parsing from the tool, and digikam crashes when opening the "Settings _ Configure digikam"


STEPS TO REPRODUCE
1. Enable the exiftool
2. If the locales are not properly set. It gives the output like this:
krikar@desktop:~$ exiftool
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = "",
        LC_ALL = (unset),
        LC_ADDRESS = "sv_SE.UTF-8",
        LC_NAME = "sv_SE.UTF-8",
        LC_MONETARY = "sv_SE.UTF-8",
        LC_PAPER = "sv_SE.UTF-8",
        LC_IDENTIFICATION = "sv_SE.UTF-8",
        LC_TELEPHONE = "sv_SE.UTF-8",
        LC_MEASUREMENT = "sv_SE.UTF-8",
        LC_TIME = "sv_SE.UTF-8",
        LC_NUMERIC = "sv_SE.UTF-8",
        LANG = "en_SE.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Syntax:  exiftool [OPTIONS] FILE

Consult the exiftool documentation for a full list of options.

3. Open  "Settings -> Configure digikam" 

OBSERVED RESULT
Digikam crashes while opening the dialog:
digikam.general: Event is dispatched to KDE desktop notifier
digikam.general: Testing  "mysql_install_db" ...
digikam.general: Found  "mysql_install_db"
digikam.general: Testing  "mysqladmin" ...
digikam.general: Found  "mysqladmin"
digikam.general: Testing  "mysqld" ...
digikam.general: Found  "mysqld"
digikam.avplayer: decoderPriority not changed
digikam.qtav: xcb_egl=0
digikam.general: Testing  "exiftool" ...
digikam.general: "exiftool"  help header line: 
 "perl: warning: Setting locale failed."
digikam.general: Found  "exiftool"  version:  ""
ASSERT: "!isEmpty()" in file /usr/include/x86_64-linux-gnu/qt5/QtCore/qlist.h, line 363
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = digikam path = /usr/bin pid = 81860
KCrash: Arguments: /usr/bin/digikam 
QSocketNotifier: Invalid socket 43 and type 'Read', disabling...
QSocketNotifier: Invalid socket 45 and type 'Read', disabling...
QSocketNotifier: Invalid socket 50 and type 'Read', disabling...
KCrash: Attempting to start /usr/lib/x86_64-linux-gnu/libexec/drkonqi


EXPECTED RESULT
The digikam Configure dialog is displayed


SOFTWARE/OS VERSIONS
Operating System: Ubuntu 22.04
KDE Plasma Version: 5.24.4
KDE Frameworks Version: 5.92.0
Qt Version: 5.15.3
Kernel Version: 5.15.0-33-generic (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-2600K CPU @ 3.40GHz
Memory: 15,6 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 960/PCIe/SSE2

ADDITIONAL INFORMATION
If setting the locales correct, like following the instructions here for example: https://www.thomas-krenn.com/en/wiki/Perl_warning_Setting_locale_failed_in_Debian
the output from the exiftool is then the expected, and digikam won't crash when opening the Configure dialog

krikar@desktop:~/Downloads$ exiftool
Syntax:  exiftool [OPTIONS] FILE

Consult the exiftool documentation for a full list of options.
Comment 1 caulier.gilles 2022-05-31 12:31:06 UTC
Which ExifTool version is installed on your system ?
Comment 2 caulier.gilles 2022-05-31 12:32:32 UTC
Other Q: why the Locale settings is missing on your system ? You will be faced to another in-deep problems certainly...
Comment 3 Kristian Karl 2022-05-31 12:58:52 UTC
exiftool version => 12.40

Regarding the question of missing locale settings:
Yes, that is a good question indeed. It's a complete fresh install of Ubuntu 22.04, using English as the main language, and Swedish as the locale for the keyboard layout and other regional settings.
The problem of missing locales does not really affect my system, I only see it when running some command line tools, like exiftool, now and then. The printouts are annoying yes, but it usually don't bother the system/desktop machine otherwise.
Comment 4 Maik Qualmann 2022-05-31 13:17:07 UTC
The crash probably occurs in an empty QList. I think it's the Read Formats and Write Formast listings that are causing the crash. We can fix that.

Maik
Comment 5 Maik Qualmann 2022-05-31 18:00:52 UTC
Git commit a03519ceb2760134e11a44d86d4af2763c24f72a by Maik Qualmann.
Committed on 31/05/2022 at 17:59.
Pushed by mqualmann into branch 'master'.

fix crash in DBinaryIface if version a empty string
FIXED-IN: 8.0.0

M  +2    -1    NEWS
M  +21   -5    core/libs/widgets/files/dbinaryiface.cpp

https://invent.kde.org/graphics/digikam/commit/a03519ceb2760134e11a44d86d4af2763c24f72a
Comment 6 Maik Qualmann 2022-05-31 20:00:24 UTC
Git commit 9e78e13453119d266156d548d93ae80bb535cc3c by Maik Qualmann.
Committed on 31/05/2022 at 19:58.
Pushed by mqualmann into branch 'master'.

using QRegularExpressionMatch::captured() is better

M  +3    -22   core/libs/widgets/files/dbinaryiface.cpp

https://invent.kde.org/graphics/digikam/commit/9e78e13453119d266156d548d93ae80bb535cc3c
Comment 7 Kristian Karl 2022-05-31 21:22:04 UTC
I verified the fix, and it works fine now.
Thanks!