Bug 378587

Summary: Geolocation hangs when opened twice
Product: [Applications] digikam Reporter: Sander <bugs>
Component: Plugin-Generic-GeolocationEditAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: bugs, caulier.gilles, freisim93, gburca-kde, metzpinguin
Priority: NOR    
Version: 5.5.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 5.8.0
Sentry Crash Report:
Attachments: Backtrace of geolocation freeze
Backtrace of geolocation drag freezing
Backtrace of geolocation drag freezing - with debug symbols

Description Sander 2017-04-09 12:09:33 UTC
Steps to reproduce:
1. Open Geolocation. Geotag (drag 'n drop) one image on the map.
2. Click Apply and close geolocation screen
3. Open Geolocation again.
4. Drag a picture to the map -> mouse cursor changes to 'forbidden to change' and digikam becomes unresponsive
Comment 1 Simon 2017-04-09 19:05:50 UTC
Created attachment 104931 [details]
Backtrace of geolocation freeze

I can reproduce this with a locally compiled digiKam but not with the Appimage. The attached backtrace suggest a problem somewhere in libqgtk3/libgdk/libglib or its configuration. That is at least for my system very sound argument, as gtk2/3 handling is a bit messy/outdated on xfce.

What system do you use and where do you install digiKam from?
Comment 2 Simon 2017-04-09 19:09:04 UTC
Actually I did something else that resulted in a freeze as well so I assumed it is the same: I opened a gpx file, then closed the dialog, and tried to open a gpx file again. However I can't reproduce the problem with drag 'n dropping images to the map as you described.
Comment 3 Gabriel Burca 2017-04-11 14:07:45 UTC
I have the exact same problem as original problem report. It always works the first time around, and always freezes the second time I open the geolocation dialog and try to drag a picture to the map.

I did some more experimenting and here's what I see:

- If I open the dialog box (for the 1st time) and drag pictures to the map one by one, it works fine. So it doesn't seem to be tied to the first drag.

- If I drag a picture and then close the dialog without clicking Apply, but answer "Yes" or "No" to the dialog prompting me to save changes, it still happens the next time I open the dialog. So it's not tied to the "Apply" button.

- If I open the dialog box, and close it back up without dragging anything, it seems to be fine (i.e. I can open it again the 2nd time and drag a picture to the map).

What's weird is that it freezes the whole desktop, so I can't switch to another app by using the mouse, almost like having a modular window open that has captured the mouse. I have to use the keyboard to switch to a terminal and send digiKam a SIGTERM.

I'm using Kubuntu 16.04 with DigiKam 5.5 from https://launchpad.net/~philip5/+archive/ubuntu/extra/ and the map provider is Google (but it's no different if I switch to Marble).
Comment 4 Simon 2017-04-11 14:38:55 UTC
Can you create a backtrace during the freeze?
There apparently is some automatic crash handler in Ubuntu, so if that does its magic to get you a backtrace, please attach it. If it doesn, here you have information on getting debug symbols on ubuntu:
https://wiki.ubuntu.com/DebuggingProgramCrash
And creating a backtrace:
https://wiki.ubuntu.com/Backtrace
Comment 5 Gabriel Burca 2017-04-11 16:39:09 UTC
Created attachment 104970 [details]
Backtrace of geolocation drag freezing

I ran digikam5 in gdb, reproduced the issue, switched back to gdb while it was frozen, Ctrl-C to get to gdb prompt (line 566), and did a backtrace (line 569) along with a few other useful dumps (lines 706, 731, and 748).
Comment 6 caulier.gilles 2017-04-11 17:36:20 UTC
And where is the digiKam code relevant of the problem in the backtrace... ??? I see nothing especially.

Gilles Caulier
Comment 7 Gabriel Burca 2017-04-11 18:12:31 UTC
Created attachment 104972 [details]
Backtrace of geolocation drag freezing - with debug symbols

The first attempt at installing digikam5-dbg failed, but I now have it installed so this backtrace should be more informative.
Comment 8 caulier.gilles 2017-04-11 18:39:20 UTC
Sound like the place of the crash :

#8  0x00007ffff6c05a44 in Digikam::GPSImageList::startDrag (this=0x4a64690, supportedActions=...) at /build/digikam5-AYcouh/digikam5-5.5.0/core/utilities/geolocation/editor/items/gpsimagelist.cpp:122
        selectedIndicesFromModel = {<QListSpecialMethods<QModelIndex>> = {<No data fields>}, {p = {static shared_null = {ref = {atomic = {_q_value = -1}}, alloc = 0, begin = 0, end = 0, array = {0x0}}, d = 0x1ba97a0}, d = 0x1ba97a0}}
        selectedIndices = {<QListSpecialMethods<QPersistentModelIndex>> = {<No data fields>}, {p = {static shared_null = {ref = {atomic = {_q_value = -1}}, alloc = 0, begin = 0, end = 0, array = {0x0}}, d = 0x4b0bf20}, d = 0x4b0bf20}}
        dragMimeData = 0x4b08fb0
        drag = 0x4934d40

Gilles Caulier
Comment 9 Gabriel Burca 2017-04-11 18:59:23 UTC
That line changed ~5m ago from drag->start(...) to drag->exec(...).
Comment 10 Maik Qualmann 2017-04-11 19:03:41 UTC
drag->start() ist obsolete in Qt-5.x. We use overall in digiKam drag->exec().

Maik
Comment 11 Maik Qualmann 2017-04-11 19:13:10 UTC
The problem is here not to reproduce under openSUSE. We could try using a Qt::MoveAction instead of Qt::CopyAction. I also think that it crashed later.

Maik
Comment 12 caulier.gilles 2017-06-22 21:39:00 UTC
digiKam 5.6.0 is now release and available as bundle for Linux, MacOS and Windows.

Can you check if problem still exists with this version ?

Thanks in advance

Gilles Caulier
Comment 13 caulier.gilles 2017-11-30 09:31:16 UTC
Please update this entry from bugzilla with current 5.8.0 pre-release bundle to see if problem remain.

https://files.kde.org/digikam/

Thanks in advance

Gilles Caulier
Comment 14 Sander 2017-12-29 16:14:10 UTC
Reply to latest comment: Can't reproduce the problem with AppImage 5.8.0.
AppImage 5.7.0 also works. Seems more like a local problem?
Haven't tried AppImage 5.5.0 though.