Bug 289420 - crash with gpsd not running
Summary: crash with gpsd not running
Status: RESOLVED FIXED
Alias: None
Product: marble
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Unlisted Binaries Linux
: NOR crash
Target Milestone: 1.3 (KDE 4.8)
Assignee: marble-bugs
URL:
Keywords:
: 300213 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-12-20 11:32 UTC by Anders Lund
Modified: 2012-05-23 21:31 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: KDE 4.8.1 / Marble 1.3.1


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anders Lund 2011-12-20 11:32:19 UTC
Version:           unspecified (using KDE 4.7.3) 
OS:                Linux

I experience a crash after having turned current location on, using gpsd.
After stopping gpsd, marble crashes at start, with the below trace.

The crash does not happen if I remove a line defining gpsd as the active position provider from marblerc.

I also observed that marble does not react when gpsd is stopped, or the gps device removed, it keeps showing the position icon.

Application: Marble virtuel globus (marble), signal: Segmentation fault
[Current thread is 1 (Thread 0xb347f710 (LWP 17812))]

Thread 9 (Thread 0xb209db70 (LWP 17813)):
#0  0xb3bb6d00 in clock_gettime () from /lib/librt.so.1
#1  0xb66a8245 in ?? () from /usr/lib/libQtCore.so.4
#2  0xb677a826 in ?? () from /usr/lib/libQtCore.so.4
#3  0xb677ab7a in ?? () from /usr/lib/libQtCore.so.4
#4  0xb67793c3 in ?? () from /usr/lib/libQtCore.so.4
#5  0xb677945d in ?? () from /usr/lib/libQtCore.so.4
#6  0xb3afd64c in g_main_context_prepare () from /usr/lib/libglib-2.0.so.0
#7  0xb3afe3f7 in ?? () from /usr/lib/libglib-2.0.so.0
#8  0xb3afe9ea in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#9  0xb6779ea7 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#10 0xb674ab6d in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#11 0xb674adb1 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#12 0xb664e3ab in QThread::exec() () from /usr/lib/libQtCore.so.4
#13 0xb672b83d in ?? () from /usr/lib/libQtCore.so.4
#14 0xb6651253 in ?? () from /usr/lib/libQtCore.so.4
#15 0xb65dbcf7 in start_thread () from /lib/libpthread.so.0
#16 0xb41ae86e in clone () from /lib/libc.so.6
Backtrace stopped: Not enough registers or memory available to unwind further

Thread 8 (Thread 0xb1655b70 (LWP 17814)):
#0  0xb3bb6d00 in clock_gettime () from /lib/librt.so.1
#1  0xb66a8245 in ?? () from /usr/lib/libQtCore.so.4
#2  0xb677a826 in ?? () from /usr/lib/libQtCore.so.4
#3  0xb677ab7a in ?? () from /usr/lib/libQtCore.so.4
#4  0xb67793c3 in ?? () from /usr/lib/libQtCore.so.4
#5  0xb677945d in ?? () from /usr/lib/libQtCore.so.4
#6  0xb3afd64c in g_main_context_prepare () from /usr/lib/libglib-2.0.so.0
#7  0xb3afe3f7 in ?? () from /usr/lib/libglib-2.0.so.0
#8  0xb3afe9ea in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#9  0xb6779ea7 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#10 0xb674ab6d in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#11 0xb674adb1 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#12 0xb664e3ab in QThread::exec() () from /usr/lib/libQtCore.so.4
#13 0xb672b83d in ?? () from /usr/lib/libQtCore.so.4
#14 0xb6651253 in ?? () from /usr/lib/libQtCore.so.4
#15 0xb65dbcf7 in start_thread () from /lib/libpthread.so.0
#16 0xb41ae86e in clone () from /lib/libc.so.6
Backtrace stopped: Not enough registers or memory available to unwind further

Thread 7 (Thread 0xae6fbb70 (LWP 17819)):
#0  0xb788c424 in __kernel_vsyscall ()
#1  0xb65dfca3 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2  0xb66516ee in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQtCore.so.4
#3  0xb6645464 in ?? () from /usr/lib/libQtCore.so.4
#4  0xb6651253 in ?? () from /usr/lib/libQtCore.so.4
#5  0xb65dbcf7 in start_thread () from /lib/libpthread.so.0
#6  0xb41ae86e in clone () from /lib/libc.so.6
Backtrace stopped: Not enough registers or memory available to unwind further

Thread 6 (Thread 0xad4f9b70 (LWP 17821)):
#0  0xb788c424 in __kernel_vsyscall ()
#1  0xb65dfca3 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2  0xb66516ee in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQtCore.so.4
#3  0xb6645464 in ?? () from /usr/lib/libQtCore.so.4
#4  0xb6651253 in ?? () from /usr/lib/libQtCore.so.4
#5  0xb65dbcf7 in start_thread () from /lib/libpthread.so.0
#6  0xb41ae86e in clone () from /lib/libc.so.6
Backtrace stopped: Not enough registers or memory available to unwind further

Thread 5 (Thread 0xaccf8b70 (LWP 17822)):
#0  0xb788c424 in __kernel_vsyscall ()
#1  0xb65dfca3 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2  0xb66516ee in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQtCore.so.4
#3  0xb6645464 in ?? () from /usr/lib/libQtCore.so.4
#4  0xb6651253 in ?? () from /usr/lib/libQtCore.so.4
#5  0xb65dbcf7 in start_thread () from /lib/libpthread.so.0
#6  0xb41ae86e in clone () from /lib/libc.so.6
Backtrace stopped: Not enough registers or memory available to unwind further

Thread 4 (Thread 0xac4f7b70 (LWP 17823)):
#0  0xb788c424 in __kernel_vsyscall ()
#1  0xb65dfca3 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2  0xb66516ee in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQtCore.so.4
#3  0xb6645464 in ?? () from /usr/lib/libQtCore.so.4
#4  0xb6651253 in ?? () from /usr/lib/libQtCore.so.4
#5  0xb65dbcf7 in start_thread () from /lib/libpthread.so.0
#6  0xb41ae86e in clone () from /lib/libc.so.6
Backtrace stopped: Not enough registers or memory available to unwind further

Thread 3 (Thread 0xadefab70 (LWP 17824)):
[KCrash Handler]
#7  0xb1813cfb in gps_waiting () from /usr/lib/libgps.so.20
#8  0xb1818207 in gpsmm::waiting(int) () from /usr/lib/libgps.so.20
#9  0xb1846e80 in Marble::GpsdConnection::update (this=0xa43c468) at /home/anders/src/marble/src/plugins/positionprovider/gpsd/GpsdConnection.cpp:106
#10 0xb1846fff in Marble::GpsdConnection::qt_metacall (this=0xa43c468, _c=QMetaObject::InvokeMetaMethod, _id=<optimized out>, _a=0xadef9cb4) at /home/anders/src/marble/build/src/plugins/positionprovider/gpsd/GpsdConnection.moc:81
#11 0xb6751eed in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/libQtCore.so.4
#12 0xb6760dda in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#13 0xb67afb25 in QTimer::timeout() () from /usr/lib/libQtCore.so.4
#14 0xb67685f6 in QTimer::timerEvent(QTimerEvent*) () from /usr/lib/libQtCore.so.4
#15 0xb6763d04 in QObject::event(QEvent*) () from /usr/lib/libQtCore.so.4
#16 0xb5c76a24 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#17 0xb5c7bdd3 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#18 0xb6d4e091 in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#19 0xb674bb2e in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#20 0xb677bf70 in ?? () from /usr/lib/libQtCore.so.4
#21 0xb67794c5 in ?? () from /usr/lib/libQtCore.so.4
#22 0xb3afe01f in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#23 0xb3afe750 in ?? () from /usr/lib/libglib-2.0.so.0
#24 0xb3afe9ea in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#25 0xb6779e4a in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#26 0xb674ab6d in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#27 0xb674adb1 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#28 0xb664e3ab in QThread::exec() () from /usr/lib/libQtCore.so.4
#29 0xb1848201 in Marble::GpsdThread::run (this=0xa41d950) at /home/anders/src/marble/src/plugins/positionprovider/gpsd/GpsdThread.cpp:40
#30 0xb6651253 in ?? () from /usr/lib/libQtCore.so.4
#31 0xb65dbcf7 in start_thread () from /lib/libpthread.so.0
#32 0xb41ae86e in clone () from /lib/libc.so.6
Backtrace stopped: Not enough registers or memory available to unwind further

Thread 2 (Thread 0xb06ffb70 (LWP 17825)):
#0  0xb4158700 in ?? () from /lib/libc.so.6
#1  0xb6653150 in QByteArray::QByteArray(char const*) () from /usr/lib/libQtCore.so.4
#2  0xb6726977 in ?? () from /usr/lib/libQtCore.so.4
#3  0xb671dd68 in ?? () from /usr/lib/libQtCore.so.4
#4  0xb66d6616 in ?? () from /usr/lib/libQtCore.so.4
#5  0xb66d683d in QDirIterator::next() () from /usr/lib/libQtCore.so.4
#6  0xb764694e in Marble::FileStorageWatcherThread::getCurrentCacheSize (this=0xaedfde70) at /home/anders/src/marble/src/lib/FileStorageWatcher.cpp:109
#7  0xb7646dc2 in Marble::FileStorageWatcher::run (this=0x9f8bd8c) at /home/anders/src/marble/src/lib/FileStorageWatcher.cpp:391
#8  0xb6651253 in ?? () from /usr/lib/libQtCore.so.4
#9  0xb65dbcf7 in start_thread () from /lib/libpthread.so.0
#10 0xb41ae86e in clone () from /lib/libc.so.6
Backtrace stopped: Not enough registers or memory available to unwind further

Thread 1 (Thread 0xb347f710 (LWP 17812)):
#0  0xb41bc7f7 in ?? () from /lib/libc.so.6
#1  0xb41a4197 in poll () from /lib/libc.so.6
#2  0xb36a73e0 in ?? () from /usr/lib/libxcb.so.1
#3  0xb36a79ec in ?? () from /usr/lib/libxcb.so.1
#4  0xb36a7aa1 in xcb_writev () from /usr/lib/libxcb.so.1
#5  0xb3edf0d0 in _XSend () from /usr/lib/libX11.so.6
#6  0xb3edf6da in _XReply () from /usr/lib/libX11.so.6
#7  0xb3edaec6 in XSync () from /usr/lib/libX11.so.6
#8  0xb5e910fd in QRasterWindowSurface::flush(QWidget*, QRegion const&, QPoint const&) () from /usr/lib/libQtGui.so.4
#9  0xb5eb1d58 in ?? () from /usr/lib/libQtGui.so.4
#10 0xb5eb2dec in ?? () from /usr/lib/libQtGui.so.4
#11 0xb5eb316b in ?? () from /usr/lib/libQtGui.so.4
#12 0xb5cc2fd4 in QWidgetPrivate::syncBackingStore(QRegion const&) () from /usr/lib/libQtGui.so.4
#13 0xb5cfedb4 in ?? () from /usr/lib/libQtGui.so.4
#14 0xb5cff7f8 in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib/libQtGui.so.4
#15 0xb5d2a39c in ?? () from /usr/lib/libQtGui.so.4
#16 0xb3afe01f in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#17 0xb3afe750 in ?? () from /usr/lib/libglib-2.0.so.0
#18 0xb3afe9ea in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#19 0xb6779e4a in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#20 0xb5d29f8a in ?? () from /usr/lib/libQtGui.so.4
#21 0xb674ab6d in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#22 0xb674adb1 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#23 0xb674f50d in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
#24 0xb5c74894 in QApplication::exec() () from /usr/lib/libQtGui.so.4
#25 0x0805efce in main (argc=) at /home/anders/src/marble/src/kdemain.cpp:398


Reproducible: Always

Steps to Reproduce:
1. start marble, start gpsd and add a device
2. remove the device and stop gpsd
3. close marble
4. start marble => CRASH

Actual Results:  
well, crash

Expected Results:  
no crash

OS: Linux (i686) release 3.1.5-1-ARCH
Compiler: gcc
Comment 1 Dennis Nienhüser 2012-01-18 18:21:59 UTC
Git commit 2404dd076c9e44f140d8aba61cd0f45a84493969 by Dennis Nienhüser.
Committed on 18/01/2012 at 19:13.
Pushed by nienhueser into branch 'master'.

Fix segfault with newer gpsd versions.

This patch adds a check for the stream method in libgpsmm to return not
NULL value. When that method returns NULL value, it's always should be
treated as an error.

No new calls introduced (despite the #if block moved), just added a
check for one return value.

Also see http://git.savannah.gnu.org/cgit/gpsd.git/commit/libgpsmm.cpp?id=ce15eae5b1170acebdbe88dd9a8a011a6d6957fb
for explanation: «C++ clients should test the return from the stream
method to see if the open succeeded.»

This fixes a segfault on newer gpsd versions, and should not affect
older versions.

Patch by Nikita Skovoroda, thanks!
CCMAIL: chalkerx@gmail.com
REVIEW: 103717

M  +5    -4    src/plugins/positionprovider/gpsd/GpsdConnection.cpp

http://commits.kde.org/marble/2404dd076c9e44f140d8aba61cd0f45a84493969
Comment 2 Dennis Nienhüser 2012-01-18 21:17:00 UTC
Git commit f21ea05a7d69b96b2e4ca6b414d618210b8e1f9c by Dennis Nienhüser.
Committed on 18/01/2012 at 19:13.
Pushed by nienhueser into branch 'KDE/4.8'.

Fix segfault with newer gpsd versions.

This patch adds a check for the stream method in libgpsmm to return not
NULL value. When that method returns NULL value, it's always should be
treated as an error.

No new calls introduced (despite the #if block moved), just added a
check for one return value.

Also see http://git.savannah.gnu.org/cgit/gpsd.git/commit/libgpsmm.cpp?id=ce15eae5b1170acebdbe88dd9a8a011a6d6957fb
for explanation: «C++ clients should test the return from the stream
method to see if the open succeeded.»

This fixes a segfault on newer gpsd versions, and should not affect
older versions.

Patch by Nikita Skovoroda, thanks!
CCMAIL: chalkerx@gmail.com
REVIEW: 103717
(cherry picked from commit 2404dd076c9e44f140d8aba61cd0f45a84493969)

M  +5    -4    src/plugins/positionprovider/gpsd/GpsdConnection.cpp

http://commits.kde.org/marble/f21ea05a7d69b96b2e4ca6b414d618210b8e1f9c
Comment 3 Dennis Nienhüser 2012-01-20 22:30:42 UTC
Git commit 91fc3d70ec2af2217e99d867f6bef19bf828bf0c by Dennis Nienhüser.
Committed on 18/01/2012 at 19:13.
Pushed by nienhueser into branch 'Touch/1.3'.

Fix segfault with newer gpsd versions.

This patch adds a check for the stream method in libgpsmm to return not
NULL value. When that method returns NULL value, it's always should be
treated as an error.

No new calls introduced (despite the #if block moved), just added a
check for one return value.

Also see http://git.savannah.gnu.org/cgit/gpsd.git/commit/libgpsmm.cpp?id=ce15eae5b1170acebdbe88dd9a8a011a6d6957fb
for explanation: «C++ clients should test the return from the stream
method to see if the open succeeded.»

This fixes a segfault on newer gpsd versions, and should not affect
older versions.

Patch by Nikita Skovoroda, thanks!
CCMAIL: chalkerx@gmail.com
REVIEW: 103717
(cherry picked from commit 2404dd076c9e44f140d8aba61cd0f45a84493969)

M  +5    -4    src/plugins/positionprovider/gpsd/GpsdConnection.cpp

http://commits.kde.org/marble/91fc3d70ec2af2217e99d867f6bef19bf828bf0c
Comment 4 Dennis Nienhüser 2012-05-19 10:08:50 UTC
*** Bug 300213 has been marked as a duplicate of this bug. ***