Bug 312212 - Marble segfaults when GPS fix is lost
Summary: Marble segfaults when GPS fix is lost
Status: RESOLVED FIXED
Alias: None
Product: marble
Classification: Applications
Component: general (show other bugs)
Version: 1.4 (KDE 4.9)
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: Dennis Nienhüser
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-26 07:36 UTC by Tom Hardy
Modified: 2013-04-07 07:41 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: KDE/4.10.0;Marble/1.5.0
Sentry Crash Report:


Attachments
Short track with nans sprinkled about (15.89 KB, application/vnd.google-earth.kml+xml)
2013-03-02 04:07 UTC, Tom Hardy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Hardy 2012-12-26 07:36:47 UTC
Application: marble (1.4.4 (stable release))
KDE Platform Version: 4.9.4 "release 5"
Qt Version: 4.8.4
Operating System: Linux 3.4.11-2.16-desktop x86_64
Distribution: "openSUSE 12.2 (x86_64)"

-- Information about the crash:
- What I was doing when the application crashed:
Running Marble indoors with weak GPS signal from USB device through gpsd.  I can induce a weak signal by hiding the device under furniture.
-Further description:
Running Marble side by side with xgps (which reports satellite and signal status), I noticed that when xgps reports a no fix, Marble's Current Location tab reports nan for longitude, latitude and elevation, and the map display would blank.  If this continued for a variable single digit number of seconds, Marble would segfault. It seems to be more likely or happen sooner at higher zoom levels.
- Custom settings of the application:
Displaying OpenStreetMap, using gpsd, Map Adjustment "Keep at Center", Autozoom, zoom level 16.

-- Backtrace:
Application: Marble Virtual Globe (marble), signal: Segmentation fault
Using host libthread_db library "/lib64/libthread_db.so.1".
[Current thread is 1 (Thread 0x7fafd3aa7780 (LWP 6802))]

Thread 7 (Thread 0x7fafc3929700 (LWP 6803)):
#0  0x00007fafd042914f in poll () from /lib64/libc.so.6
#1  0x00007fafca5c4684 in ?? () from /usr/lib64/libglib-2.0.so.0
#2  0x00007fafca5c47a4 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#3  0x00007fafd1b9f136 in QEventDispatcherGlib::processEvents (this=0x7fafbc0008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:426
#4  0x00007fafd1b6f94f in QEventLoop::processEvents (this=this@entry=0x7fafc3928dd0, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007fafd1b6fbd8 in QEventLoop::exec (this=0x7fafc3928dd0, flags=...) at kernel/qeventloop.cpp:204
#6  0x00007fafd1a720b0 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:542
#7  0x00007fafd1b500bf in QInotifyFileSystemWatcherEngine::run (this=0x1547d70) at io/qfilesystemwatcher_inotify.cpp:256
#8  0x00007fafd1a7508c in QThreadPrivate::start (arg=0x1547d70) at thread/qthread_unix.cpp:338
#9  0x00007fafcf71be0e in start_thread () from /lib64/libpthread.so.0
#10 0x00007fafd04312cd in clone () from /lib64/libc.so.6

Thread 6 (Thread 0x7fafbb99a700 (LWP 6804)):
#0  0x00007fafd042914f in poll () from /lib64/libc.so.6
#1  0x00007fafca5c4684 in ?? () from /usr/lib64/libglib-2.0.so.0
#2  0x00007fafca5c47a4 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#3  0x00007fafd1b9f136 in QEventDispatcherGlib::processEvents (this=0x7fafb40008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:426
#4  0x00007fafd1b6f94f in QEventLoop::processEvents (this=this@entry=0x7fafbb999dd0, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007fafd1b6fbd8 in QEventLoop::exec (this=0x7fafbb999dd0, flags=...) at kernel/qeventloop.cpp:204
#6  0x00007fafd1a720b0 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:542
#7  0x00007fafd1b500bf in QInotifyFileSystemWatcherEngine::run (this=0x1451160) at io/qfilesystemwatcher_inotify.cpp:256
#8  0x00007fafd1a7508c in QThreadPrivate::start (arg=0x1451160) at thread/qthread_unix.cpp:338
#9  0x00007fafcf71be0e in start_thread () from /lib64/libpthread.so.0
#10 0x00007fafd04312cd in clone () from /lib64/libc.so.6

Thread 5 (Thread 0x7fafa9ffb700 (LWP 6814)):
#0  0x00007fafca60048c in g_mutex_lock () from /usr/lib64/libglib-2.0.so.0
#1  0x00007fafca5c4790 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#2  0x00007fafd1b9f136 in QEventDispatcherGlib::processEvents (this=0x7faf8c003580, flags=...) at kernel/qeventdispatcher_glib.cpp:426
#3  0x00007fafd1b6f94f in QEventLoop::processEvents (this=this@entry=0x7fafa9ffadb0, flags=...) at kernel/qeventloop.cpp:149
#4  0x00007fafd1b6fbd8 in QEventLoop::exec (this=0x7fafa9ffadb0, flags=...) at kernel/qeventloop.cpp:204
#5  0x00007fafd1a720b0 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:542
#6  0x00007fafd3085098 in Marble::FileStorageWatcher::run (this=0x1532900) at /usr/src/debug/marble-4.9.4/src/lib/FileStorageWatcher.cpp:401
#7  0x00007fafd1a7508c in QThreadPrivate::start (arg=0x1532900) at thread/qthread_unix.cpp:338
#8  0x00007fafcf71be0e in start_thread () from /lib64/libpthread.so.0
#9  0x00007fafd04312cd in clone () from /lib64/libc.so.6

Thread 4 (Thread 0x7fafb08d4700 (LWP 6817)):
#0  0x00007fafd043db17 in pthread_mutex_lock () from /lib64/libc.so.6
#1  0x00007fafca600471 in g_mutex_lock () from /usr/lib64/libglib-2.0.so.0
#2  0x00007fafca5c3ec9 in g_main_context_prepare () from /usr/lib64/libglib-2.0.so.0
#3  0x00007fafca5c45ab in ?? () from /usr/lib64/libglib-2.0.so.0
#4  0x00007fafca5c47a4 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#5  0x00007fafd1b9f136 in QEventDispatcherGlib::processEvents (this=0x7fafa400c8b0, flags=...) at kernel/qeventdispatcher_glib.cpp:426
#6  0x00007fafd1b6f94f in QEventLoop::processEvents (this=this@entry=0x7fafb08d3e00, flags=...) at kernel/qeventloop.cpp:149
#7  0x00007fafd1b6fbd8 in QEventLoop::exec (this=0x7fafb08d3e00, flags=...) at kernel/qeventloop.cpp:204
#8  0x00007fafd1a720b0 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:542
#9  0x00007fafd1a7508c in QThreadPrivate::start (arg=0x1de0700) at thread/qthread_unix.cpp:338
#10 0x00007fafcf71be0e in start_thread () from /lib64/libpthread.so.0
#11 0x00007fafd04312cd in clone () from /lib64/libc.so.6

Thread 3 (Thread 0x7fafab7fe700 (LWP 7181)):
#0  0x00007fafd042914f in poll () from /lib64/libc.so.6
#1  0x00007fafca5c4684 in ?? () from /usr/lib64/libglib-2.0.so.0
#2  0x00007fafca5c47a4 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#3  0x00007fafd1b9f136 in QEventDispatcherGlib::processEvents (this=0x7faf96708200, flags=...) at kernel/qeventdispatcher_glib.cpp:426
#4  0x00007fafd1b6f94f in QEventLoop::processEvents (this=this@entry=0x7fafab7fde00, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007fafd1b6fbd8 in QEventLoop::exec (this=0x7fafab7fde00, flags=...) at kernel/qeventloop.cpp:204
#6  0x00007fafd1a720b0 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:542
#7  0x00007fafd1a7508c in QThreadPrivate::start (arg=0x17d5960) at thread/qthread_unix.cpp:338
#8  0x00007fafcf71be0e in start_thread () from /lib64/libpthread.so.0
#9  0x00007fafd04312cd in clone () from /lib64/libc.so.6

Thread 2 (Thread 0x7fafa97fa700 (LWP 7182)):
#0  0x00007fafd04251ed in read () from /lib64/libc.so.6
#1  0x00007fafca5ff82f in ?? () from /usr/lib64/libglib-2.0.so.0
#2  0x00007fafca5c4209 in g_main_context_check () from /usr/lib64/libglib-2.0.so.0
#3  0x00007fafca5c4622 in ?? () from /usr/lib64/libglib-2.0.so.0
#4  0x00007fafca5c47a4 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#5  0x00007fafd1b9f136 in QEventDispatcherGlib::processEvents (this=0x7faf9c2d6ee0, flags=...) at kernel/qeventdispatcher_glib.cpp:426
#6  0x00007fafd1b6f94f in QEventLoop::processEvents (this=this@entry=0x7fafa97f9e00, flags=...) at kernel/qeventloop.cpp:149
#7  0x00007fafd1b6fbd8 in QEventLoop::exec (this=0x7fafa97f9e00, flags=...) at kernel/qeventloop.cpp:204
#8  0x00007fafd1a720b0 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:542
#9  0x00007fafd1a7508c in QThreadPrivate::start (arg=0x13ebd70) at thread/qthread_unix.cpp:338
#10 0x00007fafcf71be0e in start_thread () from /lib64/libpthread.so.0
#11 0x00007fafd04312cd in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x7fafd3aa7780 (LWP 6802)):
[KCrash Handler]
#6  QVector (v=..., this=0x7fffa156ced0) at /usr/include/QtCore/qvector.h:123
#7  Marble::PlacemarkLayout::roomForLabel (this=this@entry=0x14b3738, style=style@entry=0x1753b10, x=x@entry=-nan(0x8000000000000), y=y@entry=-nan(0x8000000000000), labelText=...) at /usr/src/debug/marble-4.9.4/src/lib/PlacemarkLayout.cpp:683
#8  0x00007fafd3069faf in Marble::PlacemarkLayout::layoutPlacemark (this=this@entry=0x14b3738, placemark=0x7faf94886f70, x=-nan(0x8000000000000), y=-nan(0x8000000000000), selected=selected@entry=false) at /usr/src/debug/marble-4.9.4/src/lib/PlacemarkLayout.cpp:616
#9  0x00007fafd306db8b in Marble::PlacemarkLayout::generateLayout (this=0x14b3738, viewport=0x14b35b0) at /usr/src/debug/marble-4.9.4/src/lib/PlacemarkLayout.cpp:596
#10 0x00007fafd2fde83f in Marble::PlacemarkLayer::render (this=0x14b3720, geoPainter=0x7fffa156d7b0, viewport=0x14b35b0, renderPos=..., layer=<optimized out>) at /usr/src/debug/marble-4.9.4/src/lib/layers/PlacemarkLayer.cpp:65
#11 0x00007fafd304b78c in Marble::LayerManager::Private::renderLayer (this=0x1c4c8b8, painter=painter@entry=0x7fffa156d7b0, viewport=viewport@entry=0x14b35b0, renderPosition=...) at /usr/src/debug/marble-4.9.4/src/lib/LayerManager.cpp:185
#12 0x00007fafd304bd73 in Marble::LayerManager::renderLayers (this=0x14b3680, painter=0x7fffa156d7b0, viewport=0x14b35b0) at /usr/src/debug/marble-4.9.4/src/lib/LayerManager.cpp:155
#13 0x00007fafd2ffaa2a in Marble::MarbleMap::paint (this=0x141eda0, painter=..., dirtyRect=...) at /usr/src/debug/marble-4.9.4/src/lib/MarbleMap.cpp:697
#14 0x00007fafd2ff10da in Marble::MarbleWidget::paintEvent (this=0x1517150, evt=0x7fffa156e070) at /usr/src/debug/marble-4.9.4/src/lib/MarbleWidget.cpp:800
#15 0x00007fafd0f6a0de in QWidget::event(QEvent*) () from /usr/lib64/libQtGui.so.4
#16 0x00007fafd0f1a85c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/libQtGui.so.4
#17 0x00007fafd0f1ecda in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/libQtGui.so.4
#18 0x00007fafd25d4616 in KApplication::notify (this=0x7fffa156f090, receiver=0x1517150, event=0x7fffa156e070) at /usr/src/debug/kdelibs-4.9.4/kdeui/kernel/kapplication.cpp:311
#19 0x00007fafd1b70bfe in QCoreApplication::notifyInternal (this=0x7fffa156f090, receiver=0x1517150, event=0x7fffa156e070) at kernel/qcoreapplication.cpp:946
#20 0x00007fafd0f65ca4 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib64/libQtGui.so.4
#21 0x00007fafd113014d in ?? () from /usr/lib64/libQtGui.so.4
#22 0x00007fafd0f5a940 in QWidgetPrivate::syncBackingStore() () from /usr/lib64/libQtGui.so.4
#23 0x00007fafd0f6a584 in QWidget::event(QEvent*) () from /usr/lib64/libQtGui.so.4
#24 0x00007fafd132e55b in QMainWindow::event(QEvent*) () from /usr/lib64/libQtGui.so.4
#25 0x00007fafd26c5ec8 in KXmlGuiWindow::event (this=0x13decf0, ev=0x1b649d0) at /usr/src/debug/kdelibs-4.9.4/kdeui/xmlgui/kxmlguiwindow.cpp:126
#26 0x00007fafd0f1a85c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/libQtGui.so.4
#27 0x00007fafd0f1ecda in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/libQtGui.so.4
#28 0x00007fafd25d4616 in KApplication::notify (this=0x7fffa156f090, receiver=0x13decf0, event=0x1b649d0) at /usr/src/debug/kdelibs-4.9.4/kdeui/kernel/kapplication.cpp:311
#29 0x00007fafd1b70bfe in QCoreApplication::notifyInternal (this=0x7fffa156f090, receiver=receiver@entry=0x13decf0, event=event@entry=0x1b649d0) at kernel/qcoreapplication.cpp:946
#30 0x00007fafd1b74561 in sendEvent (event=0x1b649d0, receiver=0x13decf0) at kernel/qcoreapplication.h:231
#31 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x126d670) at kernel/qcoreapplication.cpp:1570
#32 0x00007fafd1b9ef83 in sendPostedEvents () at kernel/qcoreapplication.h:236
#33 postEventSourceDispatch (s=0x12c7ea0) at kernel/qeventdispatcher_glib.cpp:279
#34 0x00007fafca5c43b5 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#35 0x00007fafca5c46e8 in ?? () from /usr/lib64/libglib-2.0.so.0
#36 0x00007fafca5c47a4 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#37 0x00007fafd1b9f116 in QEventDispatcherGlib::processEvents (this=0x12a5c10, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#38 0x00007fafd0fbabee in ?? () from /usr/lib64/libQtGui.so.4
#39 0x00007fafd1b6f94f in QEventLoop::processEvents (this=this@entry=0x7fffa156eea0, flags=...) at kernel/qeventloop.cpp:149
#40 0x00007fafd1b6fbd8 in QEventLoop::exec (this=0x7fffa156eea0, flags=...) at kernel/qeventloop.cpp:204
#41 0x00007fafd1b74878 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1218
#42 0x000000000041c7a8 in main (argc=1, argv=0x7fffa156f1c8) at /usr/src/debug/marble-4.9.4/src/kdemain.cpp:398

Reported using DrKonqi
Comment 1 Dennis Nienhüser 2012-12-28 11:03:30 UTC
Seems the position validity is not checked correctly.
Comment 2 Tom Hardy 2013-01-21 17:13:03 UTC
In order to prevent the segfault, it is sufficient to hide the opened Marble window, e.g., by switching to a different desktop before and during the lost fix.

Note, although I reproduced the original problem while sitting at home, I normally encounter the problem while driving.  I drive 12 hours a day with a laptop mounted on my dash, displaying Marble with OpenStreetMap.  It's a bit harder to notice and duplicate a problem that way, but I generally see a crash several times a day.

I  see other problems as well, such as odd or disappearing tracks, but I generally don't have the ability to report adequately.  Should I attempt to report anyway?
Comment 3 Dennis Nienhüser 2013-01-23 18:16:40 UTC
Git commit 17b732a713a53df8f9a7d45b4815ac3185084e78 by Dennis Nienhüser.
Committed on 23/01/2013 at 19:09.
Pushed by nienhueser into branch 'master'.

status is unreliable, check for nan explicitly.

Losing the GPS fix often results in gpsd reporting status as ok, but
reporting nan as position. These invalid coordinates result in broken
position data (nan as position, random painting on the map) and likely
also crashes.
Related: bug 313224

M  +1    -1    src/plugins/positionprovider/gpsd/GpsdPositionProviderPlugin.cpp

http://commits.kde.org/marble/17b732a713a53df8f9a7d45b4815ac3185084e78
Comment 4 Dennis Nienhüser 2013-01-23 18:27:48 UTC
Git commit 8ec4b0569d75f8b636e969156da6ea682b68c7a0 by Dennis Nienhüser.
Committed on 23/01/2013 at 19:09.
Pushed by nienhueser into branch 'KDE/4.10'.

status is unreliable, check for nan explicitly.

Losing the GPS fix often results in gpsd reporting status as ok, but
reporting nan as position. These invalid coordinates result in broken
position data (nan as position, random painting on the map) and likely
also crashes.
Related: bug 313224
FIXED-IN: KDE/4.10.0;Marble/1.5.0
(cherry picked from commit 17b732a713a53df8f9a7d45b4815ac3185084e78)

M  +1    -1    src/plugins/positionprovider/gpsd/GpsdPositionProviderPlugin.cpp

http://commits.kde.org/marble/8ec4b0569d75f8b636e969156da6ea682b68c7a0
Comment 5 Tom Hardy 2013-03-02 04:07:43 UTC
Created attachment 77679 [details]
Short track with nans sprinkled about

I've been on 1.5 for a full day and no crashes, to include several 15 second trips through a tunnel where Marble previously reliably crashed.

The previous behavior was to freeze upon entering the tunnel, and then segfault several seconds after exiting the tunnel.

Current behavior has one oddity: the track ends when the fix is lost as you might expect, but does not appear to pick up again, until toggling "Show Track" twice, whereupon the track is shown as you would expect.  This is consistent with previous behavior where tracks would disappear for some reason, but would come back after toggling " Show Track".

I've attached a short track with nans saved previously; you might find it interesting.  It shows lines from the displayed discontinuities converging toward the upper left edge of the screen and to a point beyond it.  When you hold the left mouse button down on the map, or otherwise manipulate it, you get a sort of a flood fill effect.  It seems to have no permanent ill effects.  This is consistent with every "funny" track I have seen.