Discussion:
[KPhotoAlbum] problem with gps tagged images on kphotoalbum 5.2 and 5.3, possible fix proposed
g
2018-07-14 19:24:09 UTC
Permalink
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
Johannes Zarl-Zierl
2018-07-17 19:48:49 UTC
Permalink
Hi,

Thanks for the report!

It seems like none of my own geo-tagged images use that particular format, so
I never triggered the error during my tests...

I've applied the fix to current git master…

Cheers,
Johannes
Post by g
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
#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
for (int i=0 ; i < 4 ; i++ )
to
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
Constantin Orăsan
2018-07-18 14:25:24 UTC
Permalink
Dear Johannes and Georgios,

I was very happy when I saw Georgios' email because I was hoping it is
related to the crash I see on fedora. Unfortunately, the program still
crashes on my Fedora virtual machine even thought I compile the latest
version from git. (the kde git, not git hub ... I am mentioning this
because I believe someone mentioned as a potential issue).

When the program starts scanning for images, I get

[***@localhost build]$ kphotoalbum
Gtk-Message: 15:20:47.354: GtkDialog mapped without a transient parent.
This is discouraged.
ASSERT: "s_instance" in file
/home/dinel/kphotoalbum/ImageManager/ThumbnailBuilder.cpp, line 110
Aborted (core dumped)

Any idea what causes this?

Thank you,

Constantin
Post by Johannes Zarl-Zierl
Hi,
Thanks for the report!
It seems like none of my own geo-tagged images use that particular format, so
I never triggered the error during my tests...
I've applied the fix to current git master

Cheers,
Johannes
Post by g
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
#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
Post by g
#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>)
Post by g
() from /lib64/libQt5Core.so.5
#28 0x00007fffd9948065 in
QPAEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
Post by g
() 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
for (int i=0 ; i < 4 ; i++ )
to
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
_______________________________________________
KPhotoAlbum mailing list
https://mail.kdab.com/mailman/listinfo/kphotoalbum
Robert Krawitz
2018-07-18 14:59:58 UTC
Permalink
--===============2892387188792950474==
Content-Type: multipart/alternative; boundary="0000000000008cd6a0057146d7dd"
--0000000000008cd6a0057146d7dd
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Dear Johannes and Georgios,
I was very happy when I saw Georgios' email because I was hoping it is
related to the crash I see on fedora. Unfortunately, the program still
crashes on my Fedora virtual machine even thought I compile the latest
version from git. (the kde git, not git hub ... I am mentioning this
because I believe someone mentioned as a potential issue).
When the program starts scanning for images, I get
Gtk-Message: 15:20:47.354: GtkDialog mapped without a transient parent.
This is discouraged.
ASSERT: "s_instance" in file
/home/dinel/kphotoalbum/ImageManager/ThumbnailBuilder.cpp, line 110
Aborted (core dumped)
Any idea what causes this?
I'll look at it tonight. This is likely fallout from my performance work.
--
Robert Krawitz <***@alum.mit.edu>

*** MIT Engineers A Proud Tradition http://mitathletics.com ***
Member of the League for Programming Freedom -- http://ProgFree.org
Project lead for Gutenprint -- http://gimp-print.sourceforge.net

"Linux doesn't dictate how I work, I dictate how Linux works."
--Eric Crampton
Robert Krawitz
2018-07-19 00:01:35 UTC
Permalink
--===============2892387188792950474==
Content-Type: multipart/alternative; boundary="0000000000008cd6a0057146d7dd"
--0000000000008cd6a0057146d7dd
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Dear Johannes and Georgios,
I was very happy when I saw Georgios' email because I was hoping it is
related to the crash I see on fedora. Unfortunately, the program still
crashes on my Fedora virtual machine even thought I compile the latest
version from git. (the kde git, not git hub ... I am mentioning this
because I believe someone mentioned as a potential issue).
When the program starts scanning for images, I get
Gtk-Message: 15:20:47.354: GtkDialog mapped without a transient parent.
This is discouraged.
ASSERT: "s_instance" in file
/home/dinel/kphotoalbum/ImageManager/ThumbnailBuilder.cpp, line 110
Aborted (core dumped)
Any idea what causes this?
So I'm not able to reproduce it. Can you run it under a debugger and
get the stack trace when it dies?
--
Robert Krawitz <***@alum.mit.edu>

*** MIT Engineers A Proud Tradition http://mitathletics.com ***
Member of the League for Programming Freedom -- http://ProgFree.org
Project lead for Gutenprint -- http://gimp-print.sourceforge.net

"Linux doesn't dictate how I work, I dictate how Linux works."
--Eric Crampton
Constantin Orăsan
2018-07-19 09:52:12 UTC
Permalink
Hello,
Post by Robert Krawitz
Post by Constantin Orăsan
When the program starts scanning for images, I get
Gtk-Message: 15:20:47.354: GtkDialog mapped without a transient parent.
This is discouraged.
ASSERT: "s_instance" in file
/home/dinel/kphotoalbum/ImageManager/ThumbnailBuilder.cpp, line 110
Aborted (core dumped)
Any idea what causes this?
So I'm not able to reproduce it. Can you run it under a debugger and
get the stack trace when it dies?
#0 0x00007ffff2595f4b in __GI_raise (sig=***@entry=6) at
../sysdeps/unix/sysv/linux/raise.c:50
#1 0x00007ffff2580591 in __GI_abort () at abort.c:79
#2 0x00007ffff32e2ea3 in qt_message_fatal (context=..., message=<synthetic
pointer>...) at global/qlogging.cpp:1716
#3 0x00007ffff32e2ea3 in QMessageLogger::fatal(char const*, ...) const
(this=***@entry=0x7fffffffba30, msg=***@entry=0x7ffff3578f80 "ASSERT:
\"%s\" in file %s, line %d") at global/qlogging.cpp:822
#4 0x00007ffff330479c in qt_assert(char const*, char const*, int)
(assertion=<optimized out>, file=<optimized out>, line=<optimized out>) at
global/qglobal.cpp:3126
#5 0x000000000056a738 in ImageManager::ThumbnailBuilder::instance() () at
/home/dinel/kphotoalbum/ImageManager/ThumbnailBuilder.cpp:110
#6 0x0000000000587e7c in DB::NewImageFinder::loadExtraFile(DB::FileName
const&, DB::MediaType) (this=0x7fffffffbfb0, newFileName=...,
type=DB::Image) at /home/dinel/kphotoalbum/DB/NewImageFinder.cpp:647
#7 0x0000000000586ccf in DB::NewImageFinder::loadExtraFiles()
(this=0x7fffffffbfb0) at /home/dinel/kphotoalbum/DB/NewImageFinder.cpp:505
#8 0x0000000000585dd1 in DB::NewImageFinder::findImages()
(this=0x7fffffffbfb0) at /home/dinel/kphotoalbum/DB/NewImageFinder.cpp:395
#9 0x000000000058394b in DB::ImageDB::slotRescan() (this=0xd74f60) at
/home/dinel/kphotoalbum/DB/ImageDB.cpp:90
#10 0x0000000000538095 in MainWindow::Window::delayedInit() (this=0xa9ea50)
at /home/dinel/kphotoalbum/MainWindow/Window.cpp:252
#11 0x000000000063c636 in MainWindow::Window::qt_static_metacall(QObject*,
QMetaObject::Call, int, void**) (_o=0xa9ea50,
_c=QMetaObject::InvokeMetaMethod, _id=52, _a=0x1014df0)
at
/home/dinel/kphotoalbum/build/kphotoalbum_autogen/WCPGUQ57CZ/moc_Window.cpp:429
#12 0x00007ffff34f3a26 in QObject::event(QEvent*) (this=0xa9ea50,
e=<optimized out>) at kernel/qobject.cpp:1247
#13 0x00007ffff47c804b in QWidget::event(QEvent*) (this=***@entry=0xa9ea50,
event=***@entry=0x1015aa0) at kernel/qwidget.cpp:9343
#14 0x00007ffff48dda68 in QMainWindow::event(QEvent*)
(this=***@entry=0xa9ea50,
event=***@entry=0x1015aa0) at widgets/qmainwindow.cpp:1342
#15 0x00007ffff661ee2b in KMainWindow::event(QEvent*)
(this=***@entry=0xa9ea50,
ev=***@entry=0x1015aa0) at
/usr/src/debug/kf5-kxmlgui-5.44.0-1.fc28.x86_64/src/kmainwindow.cpp:865
#16 0x00007ffff66684f9 in KXmlGuiWindow::event(QEvent*) (this=0xa9ea50,
ev=0x1015aa0) at
/usr/src/debug/kf5-kxmlgui-5.44.0-1.fc28.x86_64/src/kxmlguiwindow.cpp:119
#17 0x00007ffff4787e95 in QApplicationPrivate::notify_helper(QObject*,
QEvent*) (this=<optimized out>, receiver=0xa9ea50, e=0x1015aa0) at
kernel/qapplication.cpp:3732
#18 0x00007ffff478f83a in QApplication::notify(QObject*, QEvent*)
(this=0x7fffffffd1c0, receiver=0xa9ea50, e=0x1015aa0) at
kernel/qapplication.cpp:3491
#19 0x00007ffff34ca376 in QCoreApplication::notifyInternal2(QObject*,
QEvent*) (receiver=0xa9ea50, event=0x1015aa0) at
kernel/qcoreapplication.cpp:1050
#20 0x00007ffff34cd09b in QCoreApplication::sendEvent(QObject*, QEvent*)
(event=0x1015aa0, receiver=0x0) at kernel/qcoreapplication.h:234
#21 0x00007ffff34cd09b in
QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*)
(receiver=0x0, event_type=0, data=0x94b510) at
kernel/qcoreapplication.cpp:1740
#22 0x00007ffff34cd4ec in QCoreApplication::sendPostedEvents(QObject*, int)
(receiver=***@entry=0x0, event_type=***@entry=0) at
kernel/qcoreapplication.cpp:1594
#23 0x00007ffff351aec7 in postEventSourceDispatch(GSource*, GSourceFunc,
gpointer) (s=0xac0750) at kernel/qeventdispatcher_glib.cpp:276
#24 0x00007fffebf677cd in g_main_dispatch (context=0x7fffd0004ff0) at
gmain.c:3177
#25 0x00007fffebf677cd in g_main_context_dispatch
(context=***@entry=0x7fffd0004ff0)
at gmain.c:3830
#26 0x00007fffebf67b98 in g_main_context_iterate
(context=***@entry=0x7fffd0004ff0,
block=***@entry=1, dispatch=***@entry=1, self=<optimized out>) at
gmain.c:3903
#27 0x00007fffebf67c30 in g_main_context_iteration (context=0x7fffd0004ff0,
may_block=***@entry=1) at gmain.c:3964
#28 0x00007ffff351ac13 in
QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
(this=0xb86a60, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#29 0x00007fffda56d065 in
QPAEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
(this=0xb86a60, flags=...) at qeventdispatcher_glib.cpp:69
#30 0x00007ffff34c912b in
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)
(this=0x7fffffffc8d0, flags=...) at
../../include/QtCore/../../src/corelib/global/qflags.h:71
#31 0x00007ffff4979ded in QDialog::exec() (this=0x101c240) at
dialogs/qdialog.cpp:546
#32 0x00007ffff51b82a6 in KMessageBox::createKMessageBox(QDialog*,
QDialogButtonBox*, QIcon const&, QString const&, QStringList const&,
QString const&, bool*, QFlags<KMessageBox::Option>, QString const&,
QMessageBox::Icon) (dialog=0x101c240, buttons=0x101c630, icon=...,
text=..., strlist=..., ask=..., checkboxReturn=0x7fffffffcc47, options=...,
details=..., notifyType=QMessageBox::Information)
at /usr/include/c++/8/bits/atomic_base.h:82
#33 0x00007ffff51b8720 in KMessageBox::createKMessageBox(QDialog*,
QDialogButtonBox*, QMessageBox::Icon, QString const&, QStringList const&,
QString const&, bool*, QFlags<KMessageBox::Option>, QString const&)
(dialog=***@entry=0x101c240, buttons=***@entry=0x101c630,
icon=***@entry=QMessageBox::Information, text=..., strlist=..., ask=...,
checkboxReturn=0x7fffffffcc47, options=..., details=...)
at /usr/include/qt5/QtCore/qrefcount.h:73
#34 0x00007ffff51bc17f in KMessageBox::informationListInternal(QDialog*,
QString const&, QStringList const&, QString const&, QString const&,
KMessageBox::Options) (dialog=0x101c240, text=..., strlist=...,
caption=..., dontShowAgainName=..., options=..., ***@entry=...) at
/usr/include/qt5/QtCore/qarraydata.h:123
#35 0x00007ffff51bc367 in KMessageBox::informationList(QWidget*, QString
const&, QStringList const&, QString const&, QString const&,
QFlags<KMessageBox::Option>) (parent=<optimized out>, text=...,
strlist=..., caption=..., dontShowAgainName=..., options=...) at
/usr/src/debug/kf5-kwidgetsaddons-5.44.0-1.fc28.x86_64/src/kmessagebox.cpp:933
#36 0x00007ffff51bc3a8 in KMessageBox::information(QWidget*, QString
const&, QString const&, QString const&, QFlags<KMessageBox::Option>)
(parent=<optimized out>, text=..., caption=..., dontShowAgainName=...,
options=...) at
/usr/src/debug/kf5-kwidgetsaddons-5.44.0-1.fc28.x86_64/src/kmessagebox.cpp:900
#37 0x0000000000547239 in MainWindow::Window::checkIfMplayerIsInstalled()
(this=0xa9ea50) at /home/dinel/kphotoalbum/MainWindow/Window.cpp:1898
#38 0x00000000005378e2 in MainWindow::Window::Window(QWidget*)
(this=0xa9ea50, parent=0x0, __in_chrg=<optimized out>,
__vtt_parm=<optimized out>) at
/home/dinel/kphotoalbum/MainWindow/Window.cpp:225
#39 0x00000000004663fd in main(int, char**) (argc=1, argv=0x7fffffffd768)
at /home/dinel/kphotoalbum/main.cpp:115

Cheers,

Constantin
Robert Krawitz
2018-07-19 12:16:48 UTC
Permalink
So it indicates a race condition between creating the thumbnail
builder and searching for new images. I can't reproduce it, but it
could be due to library (or other system) differences. This likely
would not have been a problem prior to the fast load, because in that
case thumbnails were not built until all new files were loaded (the
code did not change).

Anyway, this fix -- creating the thumbnail builder prior to any
reference to the delayed init which loads images on startup -- should
resolve the problem. We can't, unfortunately, have the thumbnail
builder created on the fly when needed, because it needs access to the
MainWindow to hook into.

diff --git a/MainWindow/Window.cpp b/MainWindow/Window.cpp
index 9b3f00c4..a7eb7247 100644
--- a/MainWindow/Window.cpp
+++ b/MainWindow/Window.cpp
@@ -216,6 +216,7 @@ MainWindow::Window::Window( QWidget* parent )
connect( m_browser, SIGNAL(imageCount(uint)), m_statusBar->mp_partial, SLOT(showBrowserMatches(uint)) );
connect(m_thumbnailView, &ThumbnailView::ThumbnailFacade::selectionChanged, this, &Window::updateContextMenuFromSelectionSize);

+ new ImageManager::ThumbnailBuilder( m_statusBar, this );
QTimer::singleShot( 0, this, SLOT(delayedInit()) );
updateContextMenuFromSelectionSize(0);

@@ -1875,7 +1876,6 @@ void MainWindow::Window::createSarchBar()

void MainWindow::Window::executeStartupActions()
{
- new ImageManager::ThumbnailBuilder( m_statusBar, this );
if ( ! Settings::SettingsData::instance()->incrementalThumbnails())
ImageManager::ThumbnailBuilder::instance()->buildMissing();
connect( Settings::SettingsData::instance(), SIGNAL(thumbnailSizeChanged(int)), this, SLOT(slotBuildThumbnailsIfWanted()) );
--
Robert Krawitz <***@alum.mit.edu>

*** MIT Engineers A Proud Tradition http://mitathletics.com ***
Member of the League for Programming Freedom -- http://ProgFree.org
Project lead for Gutenprint -- http://gimp-print.sourceforge.net

"Linux doesn't dictate how I work, I dictate how Linux works."
--Eric Crampton
Robert Krawitz
2018-07-19 12:30:48 UTC
Permalink
On second thought, I think this is better -- make sure that all of the
setup is done before possibly trying to load images.
--
Robert Krawitz <***@alum.mit.edu>

*** MIT Engineers A Proud Tradition http://mitathletics.com ***
Member of the League for Programming Freedom -- http://ProgFree.org
Project lead for Gutenprint -- http://gimp-print.sourceforge.net

"Linux doesn't dictate how I work, I dictate how Linux works."
--Eric Crampton
Constantin Orăsan
2018-07-19 15:13:54 UTC
Permalink
Hi Robert,

On second thought, I think this is better -- make sure that all of the
Post by Robert Krawitz
setup is done before possibly trying to load images.
This second patch worked like a charm. Thank you very much,
Constantin
Robert Krawitz
2018-07-20 01:26:44 UTC
Permalink
Post by Robert Krawitz
On second thought, I think this is better -- make sure that all of the
Post by Robert Krawitz
setup is done before possibly trying to load images.
This second patch worked like a charm. Thank you very much,
Great. I've pushed that fix.
--
Robert Krawitz <***@alum.mit.edu>

*** MIT Engineers A Proud Tradition http://mitathletics.com ***
Member of the League for Programming Freedom -- http://ProgFree.org
Project lead for Gutenprint -- http://gimp-print.sourceforge.net

"Linux doesn't dictate how I work, I dictate how Linux works."
--Eric Crampton
g
2018-07-19 00:33:00 UTC
Permalink
Hi Johann,

you are welcome,

glad to have been able to help even a bit with kphotoalbum.

Georgios.
Post by Johannes Zarl-Zierl
Hi,
Thanks for the report!
It seems like none of my own geo-tagged images use that particular format, so
I never triggered the error during my tests...
I've applied the fix to current git master

Cheers,
Johannes
Post by g
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
#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
for (int i=0 ; i < 4 ; i++ )
to
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
Loading...