Bug 411763 - When I enter in "Tags" tab in "No tags" mode, the program is crashing every time
Summary: When I enter in "Tags" tab in "No tags" mode, the program is crashing every time
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Tags-Engine (show other bugs)
Version: 6.2.0
Platform: Microsoft Windows Microsoft Windows
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-09 16:36 UTC by anegro
Modified: 2020-08-10 10:18 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 7.1.0


Attachments
log file created with Debugview (113.53 KB, text/plain)
2019-09-09 16:36 UTC, anegro
Details

Note You need to log in before you can comment on or make changes to this bug.
Description anegro 2019-09-09 16:36:57 UTC
Created attachment 122566 [details]
log file created with Debugview

I upgraded to 6.2 a few days ago, and I used digikam daily until today I deleted some duplicate image files from windows explorer. After that I opened the "Tags" tab, checked "No tags" option, and begun to add tags to untagged images, but suddenly the program crashed. After that when I open Digikam and enter in "Tags" tab in "No tags" mode, the program will crash. I tried to delete the tumbnails database to rebuild it, but the program crashed again at 25% of the process. When I enter in "Tags" tab in "No tags" mode, the program is crashing every time.


STEPS TO REPRODUCE
1. in "Tags" tab check "No tags" mode, 
2. crash


OBSERVED RESULT
crash

EXPECTED RESULT
no crash

SOFTWARE/OS VERSIONS
Windows 8.1 

ADDITIONAL INFORMATION

I created a log file with Debugview which I attach
Comment 1 caulier.gilles 2019-09-09 17:06:59 UTC
From your trace :

00000856	34.62976456	[5300] digikam.dbengine: Detected locked database file. There is an active transaction. Waited but giving up now.	
00000857	34.62999725	[5300] digikam.dbengine: Failure executing query:	
00000858	34.62999725	[5300]  "SELECT tagid FROM ImageTags WHERE imageID=:a;" 	
00000859	34.62999725	[5300] Error messages: "Unable to fetch row" "database table is locked: ImageTags" "6" 1 	
00000860	34.62999725	[5300] Bound values:  (QVariant(qlonglong, 24640))	
00000861	34.63032150	[5300] digikam.dbengine: Database is locked. Waited 0	
00000862	34.66988754	[5300] digikam.dbengine: Database is locked. Waited 9750	
00000863	34.88820267	[5300] digikam.dbengine: Database is locked. Waited 250	
00000864	34.92834854	[5300] digikam.dbengine: Database is locked. Waited 10000	
00000865	34.93808365	[5300] digikam.dbengine: Detected locked database file. There is an active transaction. Waited but giving up now.	
00000866	34.93822098	[5300] digikam.dbengine: Failure executing query:	
00000867	34.93822098	[5300]  "SELECT name, category, modificationDate, fileSize FROM Images WHERE id=:a;" 	
00000868	34.93822098	[5300] Error messages: "Unable to fetch row" "database table is locked: Images" "6" 1 	
00000869	34.93822098	[5300] Bound values:  (QVariant(qlonglong, 16277))	
00000870	34.93863678	[5300] digikam.dbengine: Database is locked. Waited 0	
00000871	35.10963821	[5300] digikam.database: items to tag ()	
00000872	35.11095428	[5300] digikam.database: Complete scan took: 13122 msecs.	
00000873	35.16640472	[5300] ASSERT failure in QList<T>::at: "index out of range", file ../../../../../../../../mnt/devel/GIT/6.x/project/bundles/mxe/build.win64/usr/x86_64-w64-mingw32.shared/qt5/include/QtCore/qlist.h, line 560

I remember something about an empty list exception crash fixed by Maik with 6.3.0, if i'm not too wrong.

Event if we don't publish yet the release announcement, 6.3.0 windows installers are on line in official download area. Please try with this version to see if problem is reproducible.

https://download.kde.org/stable/digikam/6.3.0/

Thanks in advance

Gilles Caulier
Comment 2 Maik Qualmann 2019-09-09 19:53:03 UTC
Git commit f8da3b703f1b1c27d525e4f62626b4382d979ccf by Maik Qualmann.
Committed on 09/09/2019 at 19:52.
Pushed by mqualmann into branch 'master'.

prevent possible crash in getImagesFields()

M  +13   -3    core/libs/database/coredb/coredb.cpp

https://invent.kde.org/kde/digikam/commit/f8da3b703f1b1c27d525e4f62626b4382d979ccf
Comment 3 anegro 2019-09-09 20:47:46 UTC
I installed this  new version, but crash again.... Log file attached.I used digikam years, it is a great program. This is the first problem I met... 
bugzilla_noreply@kde.org írta:
>https://bugs.kde.org/show_bug.cgi?id=411763
>
>caulier.gilles@gmail.com changed:
>
>           What    |Removed                     |Added
>----------------------------------------------------------------------------
>                 CC|                            |caulier.gilles@gmail.com
>
>--- Comment #1 from caulier.gilles@gmail.com ---
>From your trace :
>
>00000856        34.62976456     [5300] digikam.dbengine: Detected locked
>database file. There is an active transaction. Waited but giving up now.       
>00000857        34.62999725     [5300] digikam.dbengine: Failure executing
>query:       
>00000858        34.62999725     [5300]  "SELECT tagid FROM ImageTags WHERE
>imageID=:a;"         
>00000859        34.62999725     [5300] Error messages: "Unable to fetch row"
>"database table is locked: ImageTags" "6" 1        
>00000860        34.62999725     [5300] Bound values:  (QVariant(qlonglong,
>24640))      
>00000861        34.63032150     [5300] digikam.dbengine: Database is locked.
>Waited 0   
>00000862        34.66988754     [5300] digikam.dbengine: Database is locked.
>Waited 9750        
>00000863        34.88820267     [5300] digikam.dbengine: Database is locked.
>Waited 250 
>00000864        34.92834854     [5300] digikam.dbengine: Database is locked.
>Waited 10000       
>00000865        34.93808365     [5300] digikam.dbengine: Detected locked
>database file. There is an active transaction. Waited but giving up now.       
>00000866        34.93822098     [5300] digikam.dbengine: Failure executing
>query:       
>00000867        34.93822098     [5300]  "SELECT name, category,
>modificationDate, fileSize FROM Images WHERE id=:a;"    
>00000868        34.93822098     [5300] Error messages: "Unable to fetch row"
>"database table is locked: Images" "6" 1   
>00000869        34.93822098     [5300] Bound values:  (QVariant(qlonglong,
>16277))      
>00000870        34.93863678     [5300] digikam.dbengine: Database is locked.
>Waited 0   
>00000871        35.10963821     [5300] digikam.database: items to tag ()        
>00000872        35.11095428     [5300] digikam.database: Complete scan took:
>13122 msecs.       
>00000873        35.16640472     [5300] ASSERT failure in QList<T>::at: "index
>out of range", file
>../../../../../../../../mnt/devel/GIT/6.x/project/bundles/mxe/build.win64/usr/x86_64-w64-mingw32.shared/qt5/include/QtCore/qlist.h,
>line 560
>
>I remember something about an empty list exception crash fixed by Maik with
>6.3.0, if i&#39;m not too wrong.
>
>Event if we don&#39;t publish yet the release announcement, 6.3.0 windows
>installers are on line in official download area. Please try with this version
>to see if problem is reproducible.
>
>https://download.kde.org/stable/digikam/6.3.0/
>
>Thanks in advance
>
>Gilles Caulier
>
>-- 
>You are receiving this mail because:
>You reported the bug.
Comment 4 Maik Qualmann 2019-09-10 06:39:36 UTC
Is there a "digikam_crash.log" file under "C:\Users\%USERNAME%\AppData\Local"? Please post here.

Maik
Comment 5 anegro 2019-09-10 21:13:58 UTC
There is no log file in the "Local" folder. I observed a new thing: when I enter in "No tags" mode, and one of the extenal hard drives is not connected to my computer, digikam is not  crashing. I tried on my laptop with windows 10 and digikam 6.1, and I opened "No tags" mode without crashing with and without the hard drive connected. After that I updated to 6.3, and now in windows 10 digikam is  crashing again in that mode only if the external hard drive is connected...
Comment 6 Maik Qualmann 2019-09-10 21:31:49 UTC
Can you try to start digikam in the debugger?
Launch cmd.exe and copy and paste this command:

"C:\Program Files\digiKam\gdb" "C:\Program Files\digiKam\digikam.exe"

Press "r" + Enter to start.
After the crash enter "bt" + Enter. Please post the messages.

Maik
Comment 7 anegro 2019-09-10 23:01:00 UTC
Something not working, this is the result in cmd window:

C:\Program Files\digiKam\gdb.exe: warning: Couldn't determine a path for the ind
ex cache directory.
GNU gdb (GDB) 8.3
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-w64-mingw32.shared".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from C:\Program Files\digiKam\digikam.exe...
(gdb)
Comment 8 Maik Qualmann 2019-09-11 05:48:46 UTC
That looks good. Now write in the CMD console an "r" and press the enter key to start digikam in the debugger.
After the crash you can spend the backtrace with "bt" + enter key.

Maik
Comment 9 anegro 2019-09-11 07:13:29 UTC
Ok, thanks. Here is the last part of the content from cmd window:

warning: digikam.general: Trying to load Embedded preview with libraw
warning: digikam.rawengine: Failed to load embedded RAW preview
warning: digikam.general: Trying to load half preview with libraw
warning: digikam.general: Trying to load Embedded preview with Exiv2
warning: digikam.metaengine: Cannot load metadata using Exiv2   (Error # 11 :  K
:/=Image Arhivalt=/Vegyes/2015.05.[Marco-Polo_Peli.Barna]/PANO_20150521_190848.j
pg: The file contains data of an unknown image type
warning: digikam.dimg: "K:/=Image Arhivalt=/Vegyes/2015.05.[Marco-Polo_Peli.Barn
a]/PANO_20150521_190848.jpg"  : JPEG file identified
warning: digikam.dimg: "K:/=Image Arhivalt=/Vegyes/2015.05.[Marco-Polo_Peli.Barn
a]/PANO_20150521_190848.jpg"  : Try to load with ImageMagick
warning: digikam.dimg: Try to load image with ImageMagick codecs
warning: digikam.dimg: ImageMagick exception [ "K:/=Image Arhivalt=/Vegyes/2015.
05.[Marco-Polo_Peli.Barna]/PANO_20150521_190848.jpg" ] digikam.exe: Not a JPEG f
ile: starts with 0x00 0x00 `K:/=Image Arhivalt=/Vegyes/2015.05.[Marco-Polo_Peli.
Barna]/PANO_20150521_190848.jpg' @ error/jpeg.c/JPEGErrorHandler/322
warning: digikam.dimg: "K:/=Image Arhivalt=/Vegyes/2015.05.[Marco-Polo_Peli.Barn
a]/PANO_20150521_190848.jpg"  : Try to load with QImage
warning: digikam.dimg.qimage: Can not load " "K:/=Image Arhivalt=/Vegyes/2015.05
.[Marco-Polo_Peli.Barna]/PANO_20150521_190848.jpg" " using DImg::QImageLoader!
warning: digikam.dimg.qimage: Error message from loader: "Unsupported image form
at"
warning: digikam.general: Trying to load video preview with FFmpeg
warning: digikam.general: Failed to decode video frame: bytesDecoded < 0
warning: digikam.general: decodeVideoFrame() failed: frame not finished
warning: digikam.general: Cannot create thumbnail for  "K:/=Image Arhivalt=/Vegy
es/2015.05.[Marco-Polo_Peli.Barna]/PANO_20150521_190848.jpg"
warning: digikam.general: Thumbnail is null for  "K:/=Image Arhivalt=/Vegyes/201
5.05.[Marco-Polo_Peli.Barna]/PANO_20150521_190848.jpg"
warning: digikam.dimg: "K:/=Image Arhivalt=/ART/Sajat Anyagok/=Doktoris munkak/E
xpo Moara/Plakat&meghivo/Imagini despre imagini.png"  : PNG file identified
warning: KMemoryInfo: Platform identified :  "WINDOWS"
warning: KMemoryInfo: AvailableRam:  21120684032  (cache:  0 )
warning: KMemoryInfo: AvailableSwap:  24511291392

Thread 63 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 3692.0x240]
0x00007fffe2315809 in ntdll!RtlUnwindEx () from C:\Windows\SYSTEM32\ntdll.dll
(gdb) bt
#0  0x00007fffe2315809 in ntdll!RtlUnwindEx ()
   from C:\Windows\SYSTEM32\ntdll.dll
#1  0x00007fffe102da6a in msvcrt!longjmp ()
   from C:\Windows\system32\msvcrt.dll
#2  0x0000000068b48144 in png_longjmp ()
   from C:\Program Files\digiKam\libpng16-16.dll
#3  0x0000000068b7ce5b in ?? () from C:\Program Files\digiKam\libpng16-16.dll
#4  0x00007fffa1ada0b0 in Digikam::DImgLoaderObserver::progressInfo(Digikam::DIm
g*, float) () from C:\Program Files\digiKam\libdigikamcore.dll
#5  0x000000a8338cdfa0 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb)
Comment 10 Maik Qualmann 2019-09-11 08:38:24 UTC
Ok, problem is clear. It crashes in the PNG loader. It jumps into the msvcrt.dll with an exception. This is a compiler error. We can not fix it right now. Why it does not crash in digiKam-6.1.0 is a bit surprising to me now. Remove the faulty "Imagini despre imagini.png" file. Alternatively, you could also use the 32-bit digiKam Windows version, it would not crash.

Maik
Comment 11 Maik Qualmann 2019-09-11 08:39:23 UTC

*** This bug has been marked as a duplicate of bug 408592 ***
Comment 12 Maik Qualmann 2019-09-11 08:42:13 UTC
You also have JPG files ("PANO_20150521_190848.jpg") that have corrupted headers. The cause could be a defective hard drive.

Maik
Comment 13 caulier.gilles 2019-09-11 09:16:54 UTC
Maik,

between 6.1.0 and 6.3.0, MXE have been rebuild all from scratch, and probably plenty of changes/versions/rules have been updated (as libpng, compiler, etc.).

Gilles
Comment 14 anegro 2019-09-11 22:03:54 UTC
I found and deleted more corrupt images on that external hard drive, which were copied from a damaged hard disk. Now the problem is gone :)
Comment 15 caulier.gilles 2020-08-01 20:20:34 UTC
Problem fixed as reported in bug #406979