[KPhotoAlbum] problem with gps tagged images on kphotoalbum 5.2 and 5.3, possible fix proposed

g gsv000 at comcast.net
Sat Jul 14 20:24:09 BST 2018



Hi,


Running happily kphotoalbum for many years, mainly on fedora. I just run
into a problem with geotagged jpg images. kphotoalbum crashed when
encountering jpeg files from my phone, but not jpeg files from cameras.
This is quite unexpected.

The message I received on the command line   (5.2 on fedora core 28).


/usr/include/c++/8/bits/stl_vector.h:950: std::vector<_Tp,
_Alloc>::const_reference std::vector<_Tp,
_Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) const [with _Tp
= std::pair<unsigned int, unsigned int>; _Alloc =
std::allocator<std::pair<unsigned int, unsigned int> >; std::vector<_Tp,
_Alloc>::const_reference = const std::pair<unsigned int, unsigned int>&;
std::vector<_Tp, _Alloc>::size_type = long unsigned int]: Assertion
'__builtin_expect(__n < this->size(), true)' failed.
Aborted (core dumped)



I got the latest source from git (v5.3-104-g83a42241-dirty), built it
and through gdb I got this stacktrace:


#0  0x00007ffff2380f2b in raise () from /lib64/libc.so.6
#1  0x00007ffff236b561 in abort () from /lib64/libc.so.6
#2  0x00007ffff774c388 in ?? () from /lib64/libexiv2.so.26
#3  0x00007ffff77636eb in ?? () from /lib64/libexiv2.so.26
#4  0x00000000006077f8 in
Exif::RationalExifElement::valueFromExif(Exiv2::ExifData&) const () at
/home/gsv000/proq/kphotoalbum/Exif/DatabaseElement.cpp:144
#5  0x00000000005f13d2 in Exif::Database::insert(DB::FileName const&,
Exiv2::ExifData) () at /home/gsv000/proq/kphotoalbum/Exif/Database.cpp:358
#6  0x00000000005f17fe in Exif::Database::add(DB::FileInfo&) () at
/usr/include/c++/8/new:169
#7  0x000000000056e137 in DB::ImageInfo::readExif(DB::FileName const&,
QFlags<DB::EXIFMODE_FLAG>) () at
/home/gsv000/proq/kphotoalbum/DB/ImageInfo.cpp:478
#8  0x000000000056e3b4 in DB::ImageInfo::setMD5Sum(DB::MD5 const&, bool)
() at /usr/include/qt5/QtCore/qrefcount.h:60
#9  0x0000000000597c39 in DB::NewImageFinder::loadExtraFile(DB::FileName
const&, DB::MediaType) () at
/home/gsv000/proq/kphotoalbum/DB/NewImageFinder.cpp:619
#10 0x0000000000598a06 in DB::NewImageFinder::loadExtraFiles() () at
/home/gsv000/proq/kphotoalbum/DB/NewImageFinder.cpp:505
#11 0x0000000000598f90 in DB::NewImageFinder::findImages() () at
/home/gsv000/proq/kphotoalbum/DB/NewImageFinder.cpp:395
#12 0x00000000005929ed in DB::ImageDB::slotRescan() () at
/usr/include/qt5/QtCore/qarraydata.h:123
#13 0x0000000000545d4c in MainWindow::Window::delayedInit() () at
/home/gsv000/proq/kphotoalbum/MainWindow/Window.cpp:252
#14 0x00007ffff32dea26 in QObject::event(QEvent*) () from
/lib64/libQt5Core.so.5
#15 0x00007ffff45b304b in QWidget::event(QEvent*) () from
/lib64/libQt5Widgets.so.5
#16 0x00007ffff46c8a68 in QMainWindow::event(QEvent*) () from
/lib64/libQt5Widgets.so.5
#17 0x00007ffff6405e2b in KMainWindow::event(QEvent*) () from
/lib64/libKF5XmlGui.so.5
#18 0x00007ffff644f4f9 in KXmlGuiWindow::event(QEvent*) () from
/lib64/libKF5XmlGui.so.5
#19 0x00007ffff4572e95 in QApplicationPrivate::notify_helper(QObject*,
QEvent*) () from /lib64/libQt5Widgets.so.5
#20 0x00007ffff457a83a in QApplication::notify(QObject*, QEvent*) ()
from /lib64/libQt5Widgets.so.5
#21 0x00007ffff32b5376 in QCoreApplication::notifyInternal2(QObject*,
QEvent*) () from /lib64/libQt5Core.so.5
#22 0x00007ffff32b809b in
QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*)
() from /lib64/libQt5Core.so.5
#23 0x00007ffff3305ec7 in postEventSourceDispatch(_GSource*, int
(*)(void*), void*) () from /lib64/libQt5Core.so.5
#24 0x00007fffeba5b8ad in g_main_context_dispatch () from
/lib64/libglib-2.0.so.0
#25 0x00007fffeba5bc78 in g_main_context_iterate.isra () from
/lib64/libglib-2.0.so.0
#26 0x00007fffeba5bd10 in g_main_context_iteration () from
/lib64/libglib-2.0.so.0
#27 0x00007ffff3305c13 in
QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
() from /lib64/libQt5Core.so.5
#28 0x00007fffd9948065 in
QPAEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
() from /lib64/libQt5XcbQpa.so.5
#29 0x00007ffff32b412b in
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from
/lib64/libQt5Core.so.5
#30 0x00007ffff32bc5b6 in QCoreApplication::exec() () from
/lib64/libQt5Core.so.5
#31 0x000000000047c539 in main () at
/home/gsv000/proq/kphotoalbum/main.cpp:127
#32 0x00007ffff236d18b in __libc_start_main () from /lib64/libc.so.6
#33 0x000000000047dfba in _start () at
/home/gsv000/proq/kphotoalbum/main.cpp:127



I was able to fix the crash by changing

// hour / minute / second:
            for (int i=0 ; i < 4 ; i++ )


to

 // hour / minute / second:
            for (int i=0 ; i < 3 ; i++ )


in DatabaseElement.cpp



The branch condition checks for count of 3, so it makes sense that the
iteration would be i=0 ; i<3. And there are 3 parts to the GPS data
scheme, so the 4 is again unexpected.

I am not equipped to create patch files etc right now, but I hope this
helps.

Thank you for kphotoalbum

--
Georgios
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pEpkey.asc
Type: application/pgp-keys
Size: 1745 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kphotoalbum/attachments/20180714/9d69844c/attachment.key>


More information about the Kphotoalbum mailing list