Bug 468932 - Segmentation fault when editing IPTC Copyright
Summary: Segmentation fault when editing IPTC Copyright
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-Generic-MetadataEdit (show other bugs)
Version: 8.0.0
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-24 22:33 UTC by aslam karachiwala
Modified: 2023-04-25 16:37 UTC (History)
3 users (show)

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


Attachments
Log with debug messages (48.53 KB, text/x-log)
2023-04-24 22:33 UTC, aslam karachiwala
Details
Screenshot of Metadata > Behavior (247.34 KB, image/png)
2023-04-24 22:35 UTC, aslam karachiwala
Details
GDB backtrace (15.06 KB, text/x-log)
2023-04-25 08:43 UTC, aslam karachiwala
Details

Note You need to log in before you can comment on or make changes to this bug.
Description aslam karachiwala 2023-04-24 22:33:22 UTC
Created attachment 158404 [details]
Log with debug messages

SUMMARY
AppImage segfaults upon attempting to edit IPTC Copyright field.


STEPS TO REPRODUCE
1. Select an image.
2. Action: edit metadata
3. In the metadata editing window, go to the IPTC tab.
4. Put the cursor in the Copyright field and try deleting existing text – I had the Copyright field checked and it had contents copied from a template.

OBSERVED RESULT
AppImage crashed as soon as I tried deleting text in the IPTC copyright field.

EXPECTED RESULT
AppImage does not crash; Copyright field can be edited.

SOFTWARE/OS VERSIONS
Operating System: Kubuntu 22.04
KDE Plasma Version: 5.24.7
KDE Frameworks Version: 5.98.0
Qt Version: 5.15.3
Kernel Version: 5.15.0-70-generic (64-bit)

ADDITIONAL INFORMATION
ExifTool 12.60
exiv2 0.27.5
Comment 1 aslam karachiwala 2023-04-24 22:35:01 UTC
Created attachment 158405 [details]
Screenshot of Metadata > Behavior
Comment 2 caulier.gilles 2023-04-25 03:02:10 UTC
We need a gdb backtrace of the crash. See here for details :

https://www.digikam.org/contribute/

Also please share the image responsible of the crash to reproduce here.

Best
Comment 3 aslam karachiwala 2023-04-25 08:43:28 UTC
Created attachment 158412 [details]
GDB backtrace
Comment 4 aslam karachiwala 2023-04-25 08:45:10 UTC
(In reply to caulier.gilles from comment #2)
> We need a gdb backtrace of the crash. See here for details :
> 
> https://www.digikam.org/contribute/
Attached.

> Also please share the image responsible of the crash to reproduce here.
The latest AppImage, 8.0.0.
Comment 5 caulier.gilles 2023-04-25 08:54:35 UTC
There is nothing to see in the backtrace. Please use the debug version of the AppImage (heavy file with -debug in file name)
Comment 6 Maik Qualmann 2023-04-25 11:55:40 UTC
Gilles, I think this is the cause. It needs to be changed to QPlainTextEdit. The same in DTextEdit at this point.

https://invent.kde.org/graphics/digikam/-/blob/master/core/libs/widgets/text/dplaintextedit.cpp#L217

Maik
Comment 7 caulier.gilles 2023-04-25 13:33:41 UTC
yes, you are right Maik. feel free to fix it in git, i'm busy in my office currently
Comment 8 Maik Qualmann 2023-04-25 16:35:06 UTC
Git commit fa463ea8555d494590890f29669094af0db30e8c by Maik Qualmann.
Committed on 25/04/2023 at 16:34.
Pushed by mqualmann into branch 'master'.

fix infinite loop in D(Plain)TextEdit::keyPressEvent()
FIXED-IN: 8.1.0

M  +1    -1    NEWS
M  +1    -1    core/libs/widgets/text/dplaintextedit.cpp
M  +1    -1    core/libs/widgets/text/dtextedit.cpp

https://invent.kde.org/graphics/digikam/commit/fa463ea8555d494590890f29669094af0db30e8c
Comment 9 Maik Qualmann 2023-04-25 16:37:52 UTC
The problem could be reproduced when the text exceeded the maximum number of characters allowed in this edit field and an attempt was made to delete characters.

Maik