Bug 288612

Summary: Marble and Qt 4.8 don't play well together
Product: [Applications] marble Reporter: Émeric Letavernier <emeric.letavernier>
Component: generalAssignee: marble-bugs
Status: RESOLVED FIXED    
Severity: major CC: jjm, nienhueser, shentey
Priority: HI    
Version: unspecified   
Target Milestone: 1.3 (KDE 4.8)   
Platform: Archlinux   
OS: Linux   
Latest Commit: Version Fixed In: 1.3.0

Description Émeric Letavernier 2011-12-09 23:44:30 UTC
Version:           unspecified (using Devel) 
OS:                Linux

When setting up a route, the button "get directions" goes to busy appearance and remains in that state.
Directions are never displayed.

When running "marble --debug-info", the following messages is repeated infinitely :
Timeout reached while waiting for result. Killing the runner.

As an important note, that used to work perfectly well on my PC. There must have been an upgrade breaking it.
I tried removing marble configuration files, that did not help.


Reproducible: Always

Steps to Reproduce:
Open Marble
Set up a "directions from here" point
Set up a "directions to here" point
Go to "route" tab.

Actual Results:  
The "get directions" button is busy and waiting does not change anything.

Expected Results:  
Route is displayed in a few seconds.

KDE SC 4.7.90 (4.8 beta 2), using archlinux kde-unstable precompiled packages.
Marble 1.2.80 (1.3 beta 1).

Can't remember what change on the system triggered the bug. At first I thought that it was a bug with my connection. When I found out that it was actually a bug i couldn't find out what packages/config might have changed.
Comment 1 Dennis Nienhüser 2011-12-13 20:28:10 UTC
I just tested both OpenRouteService and Yours which work fine in latest master. At which location are you trying to calculate a route? OpenRouteService is limited to Europe, and Yours sometimes just times out.
Please also check that Marble is not set to offline mode, in which both wouldn't work.
Do you have the monav-routing-daemon and maps for it installed?
Comment 2 Émeric Letavernier 2011-12-14 13:12:07 UTC
I tested again with OpenRouteService, offline mode disabled. Same result as above.
I'm in France and it used to work perfectly well.

I just tried with a test user to check again if there's a link with conf files, same result.

Additionnally, after having waited for a while, if i quit, marble crashes and judging by the call stack, it's stuck somewhere in routing service.

http://pastebin.archlinux.fr/434957
Comment 3 Émeric Letavernier 2011-12-18 11:30:20 UTC
I downgraded to the 4.7.4 version of marble : works again.
Upgraded back to 4.7.90 : the bug is back.

So, if nothing should have clearly changed between the two versions concerning routing service, i suppose it's a packaging bug. I'll check again in the archlinux community.
Comment 4 Dennis Nienhüser 2011-12-31 09:46:13 UTC
Any news here? :-)
Comment 5 Dennis Nienhüser 2012-01-05 12:26:55 UTC
Are you using Qt 4.8?
Comment 6 Dennis Nienhüser 2012-01-05 21:53:15 UTC
*** Bug 290714 has been marked as a duplicate of this bug. ***
Comment 7 Dennis Nienhüser 2012-01-05 22:02:17 UTC
First investigations with Qt 4.8 installed here shows that the majority of runners (which run in threads) keep running until their timeout of 30 seconds for a yet unknown reason. Since the number of threads executed in parallel is limited, jobs block each other. This is noticeable especially on startup, where more than a dozen of threads are started to load placemarks etc. This is done in 1-2 seconds with Qt 4.7, while the threads blocking each other with Qt 4.8 extend this to several minutes. While the UI keeps responsive, all runner related tasks take a very long time after startup to work. That are reverse geocoding, searching, routing and parsing.
Comment 8 Dennis Nienhüser 2012-01-05 23:15:31 UTC
Seems to be caused by the wrong assumption in

runTask( &localEventLoop );
[...]
localEventLoop.exec();

that runner() is not yet finished when executing the event loop. This does not hold true for short running threads and the problem seems to occur more likely with Qt 4.8. Hence the local event loop waits for an event that already happened until the watchdog terminates it.
Comment 9 Bernhard Beschow 2012-01-17 00:26:16 UTC
Git commit 9e833bed58de665115ff9e2ea2c1e056144c288a by Bernhard Beschow.
Committed on 16/01/2012 at 20:01.
Pushed by beschow into branch 'master'.

instantiate event loops in runner plugins rather than in RunnerTask and instantiate runners in background threads

Instantiating the event loops in the runner plugins rather than in RunnerTask resolves weired usage of QEventLoop: The synchronous runners were finished before QEventLoop::exec() was called. Somehow the finished signal of the runners still managed to quit the loop, such that exec() wouldn't block. Until Qt 4.8 we might just have been lucky...

Instantiating runners in the background thread avoids thread affinity issues wrt. to QEventLoop. In particular, QEventLoop instances would block a background thread forever because calling quit() or exit() wouldn't cause exec() to return.
REVIEw: 103711

M  +5    -23   src/lib/MarbleRunnerManager.cpp
M  +57   -44   src/lib/RunnerTask.cpp
M  +33   -16   src/lib/RunnerTask.h
M  +7    -0    src/plugins/runner/hostip/HostipRunner.cpp
M  +14   -0    src/plugins/runner/nominatim/OsmNominatimRunner.cpp
M  +7    -0    src/plugins/runner/openrouteservice/OpenRouteServiceRunner.cpp
M  +8    -0    src/plugins/runner/yours/YoursRunner.cpp
M  +83   -20   tests/MarbleRunnerManagerTest.cpp

http://commits.kde.org/marble/9e833bed58de665115ff9e2ea2c1e056144c288a
Comment 10 Jonathan Marten 2012-01-17 12:02:11 UTC
Works perfectly here with KDE 4.8 RC2+ and Qt 4.8.0, many thanks for the fix!
Comment 11 Bernhard Beschow 2012-01-17 16:46:33 UTC
Git commit 4957d88eba144f775493d2b95db1788070cfe53a by Bernhard Beschow.
Committed on 16/01/2012 at 20:01.
Pushed by beschow into branch 'KDE/4.8'.

instantiate event loops in runner plugins rather than in RunnerTask and instantiate runners in background threads

Instantiating the event loops in the runner plugins rather than in RunnerTask resolves weired usage of QEventLoop: The synchronous runners were finished before QEventLoop::exec() was called. Somehow the finished signal of the runners still managed to quit the loop, such that exec() wouldn't block. Until Qt 4.8 we might just have been lucky...

Instantiating runners in the background thread avoids thread affinity issues wrt. to QEventLoop. In particular, QEventLoop instances would block a background thread forever because calling quit() or exit() wouldn't cause exec() to return.
FIXED-IN: 1.3.0
REVIEW: 103711

M  +9    -22   src/lib/MarbleRunnerManager.cpp
M  +57   -44   src/lib/RunnerTask.cpp
M  +33   -16   src/lib/RunnerTask.h
M  +7    -0    src/plugins/runner/hostip/HostipRunner.cpp
M  +14   -0    src/plugins/runner/nominatim/OsmNominatimRunner.cpp
M  +7    -0    src/plugins/runner/openrouteservice/OpenRouteServiceRunner.cpp
M  +8    -0    src/plugins/runner/yours/YoursRunner.cpp

http://commits.kde.org/marble/4957d88eba144f775493d2b95db1788070cfe53a
Comment 12 Dennis Nienhüser 2012-01-18 19:34:32 UTC
There's a regression in OsmNominatimRunner: When I open Marble now with a route that gets restored, it segfaults during startup most of the time when doing a reverse geocoding call for the via points of the restored route. Backtrace below:

[New Thread 0xb60ffb70 (LWP 13112)]

Thread 22 (Thread 0xb60ffb70 (LWP 13112)):
#0  0x001110c2 in ?? () from /lib/ld-linux.so.2
No symbol table info available.
#1  0x016b55e3 in __lll_lock_wait_private () at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/lowlevellock.S:95
No locals.
#2  0x016afc02 in _L_lock_2951 () from /lib/i386-linux-gnu/libpthread.so.0
No symbol table info available.
#3  0x016aef1d in start_thread (arg=0xb60ffb70) at pthread_create.c:295
        oldtype = 0
        pd = 0xb60ffb70
        now = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {23855092, 0, 4001536, -1240468408, 1997540319, -1121138511}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = -512
        robust = <optimized out>
        pagesize_m1 = <optimized out>
        sp = <optimized out>
        freesize = <optimized out>
        __PRETTY_FUNCTION__ = "start_thread"
#4  0x015fe0ce in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130
No locals.
Backtrace stopped: Not enough registers or memory available to unwind further

Thread 17 (Thread 0xb58feb70 (LWP 13107)):
#0  0x001110c2 in ?? () from /lib/ld-linux.so.2
No symbol table info available.
#1  0x015ef40e in __GI___poll (fds=0xb4ab2160, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:87
        resultvar = <optimized out>
        oldtype = -516
        result = <optimized out>
#2  0x0173e34b in g_poll () from /lib/i386-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#3  0x0172f896 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#4  0x0172fc2a in g_main_context_iteration () from /lib/i386-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#5  0x002c4ada in QEventDispatcherGlib::processEvents (this=0x9097040, flags=...) at kernel/qeventdispatcher_glib.cpp:422
        d = 0x83606c0
        canWait = true
        savedFlags = {i = 0}
        result = <optimized out>
#6  0x002951dd in QEventLoop::processEvents (this=0xb58fe2c0, flags=...) at kernel/qeventloop.cpp:149
        d = 0xb4ab2100
#7  0x00295421 in QEventLoop::exec (this=0xb58fe2c0, flags=...) at kernel/qeventloop.cpp:201
        d = 0xb4ab2100
        app = 0xb58fe28c
#8  0x0019890b in QThread::exec (this=0x94afdb0) at thread/qthread.cpp:498
        d = 0x94c5810
        locker = {val = 155998304}
        eventLoop = {<QObject> = {_vptr.QObject = 0x3cd448, static staticMetaObject = {d = {superdata = 0x0, stringdata = 0x358580 "QObject", data = 0x358620, extradata = 0x3c83a0}}, d_ptr = {d = 0xb4ab2100}, static staticQtMetaObject = {d = {superdata = 0x0, stringdata = 0x3610e0 "Qt", data = 0x3649a0, extradata = 0x0}}}, static staticMetaObject = {d = {superdata = 0x3c8390, stringdata = 0x36a8c0 "QEventLoop", data = 0x36a8e0, extradata = 0x0}}}
        returnCode = <optimized out>
#9  0x04e60187 in Marble::GpsdThread::run (this=0x94afdb0) at /home/dennis/marble/src-git/src/plugins/positionprovider/gpsd/GpsdThread.cpp:40
No locals.
#10 0x0019b7b3 in QThreadPrivate::start (arg=0x94afdb0) at thread/qthread_unix.cpp:331
        __clframe = {__cancel_routine = 0x19a660 <QThreadPrivate::finish(void*)>, __cancel_arg = 0x94afdb0, __do_it = 1, __cancel_type = <optimized out>}
        thr = 0x94afdb0
        data = 0x80d1688
#11 0x016aed31 in start_thread (arg=0xb58feb70) at pthread_create.c:304
        __res = <optimized out>
        pd = 0xb58feb70
        now = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {23855092, 0, 4001536, -1248861112, 1999637464, -1121138511}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = <optimized out>
        robust = <optimized out>
        pagesize_m1 = <optimized out>
        sp = <optimized out>
        freesize = <optimized out>
        __PRETTY_FUNCTION__ = "start_thread"
#12 0x015fe0ce in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130
No locals.
Backtrace stopped: Not enough registers or memory available to unwind further

Thread 12 (Thread 0xb1efbb70 (LWP 13102)):
#0  clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:111
No locals.
#1  0x00000001 in ?? ()
No symbol table info available.
#2  0xb60ffb70 in ?? ()
No symbol table info available.
#3  0x00000000 in ?? ()
No symbol table info available.

Thread 11 (Thread 0xb26fcb70 (LWP 13101)):
#0  QMutex::lock (this=0x80a9c90) at thread/qmutex.cpp:151
        self = <optimized out>
        isLocked = <optimized out>
#1  0x00198a2f in QMutexLocker (m=0x80a9c90, this=0xb26fb95c) at thread/qmutex.h:102
No locals.
#2  QThread::exit (this=0xb3f00800, returnCode=0) at thread/qthread.cpp:530
        d = 0x80a9c40
        locker = {val = 5}
#3  0x00198ad3 in QThread::quit (this=0xb3f00800) at thread/qthread.cpp:550
No locals.
#4  0x00f1f5ec in QNetworkConfigurationManagerPrivate::~QNetworkConfigurationManagerPrivate (this=0xb3f007f0, __in_chrg=<optimized out>) at bearer/qnetworkconfigmanager_p.cpp:85
        locker = {val = 3018852353}
#5  0x00f1f752 in QNetworkConfigurationManagerPrivate::~QNetworkConfigurationManagerPrivate (this=0xb3f007f0, __in_chrg=<optimized out>) at bearer/qnetworkconfigmanager_p.cpp:86
No locals.
#6  0x00f1d1ab in connManager () at bearer/qnetworkconfigmanager.cpp:75
        x = 0xb3f007f0
#7  0x00f1d385 in QNetworkConfigurationManager::QNetworkConfigurationManager (this=0xb26fbb14, parent=0x0) at bearer/qnetworkconfigmanager.cpp:206
        priv = <optimized out>
#8  0x00eee569 in QNetworkAccessManager::createRequest (this=0xb3f0af90, op=QNetworkAccessManager::GetOperation, req=..., outgoingData=0x0) at access/qnetworkaccessmanager.cpp:1004
        manager = {<QObject> = {_vptr.QObject = 0xfcf4c8, static staticMetaObject = {d = {superdata = 0x0, stringdata = 0x358580 "QObject", data = 0x358620, extradata = 0x3c83a0}}, d_ptr = {d = 0xb3f0bdf0}, static staticQtMetaObject = {d = {superdata = 0x0, stringdata = 0x3610e0 "Qt", data = 0x3649a0, extradata = 0x0}}}, static staticMetaObject = {d = {superdata = 0x3c8390, stringdata = 0xf90960 "QNetworkConfigurationManager", data = 0xf90a40, extradata = 0x0}}}
        request = {d = {d = 0x14d080f}}
        url = {d = 0x2a9d89}
        reply = 0x1
        priv = 0xb26fbb14
        proxyList = {{p = {static shared_null = {ref = {_q_value = 1}, alloc = 0, begin = 0, end = 0, sharable = 1, array = {0x0}}, d = 0xb3f6f108}, d = 0xb3f6f108}}
#9  0x00eea788 in QNetworkAccessManager::get (this=0xb3f0af90, request=...) at access/qnetworkaccessmanager.cpp:690
No locals.
#10 0x04fcd27a in Marble::OsmNominatimRunner::startReverseGeocoding (this=0xb4ab1e80) at /home/dennis/marble/src-git/src/plugins/runner/nominatim/OsmNominatimRunner.cpp:112
        reply = 0xb3f00010
#11 0x04fcf54b in Marble::OsmNominatimRunner::qt_metacall (this=0xb4ab1e80, _c=QMetaObject::InvokeMetaMethod, _id=6, _a=0xb3f66378) at /home/dennis/marble/build-git/src/plugins/runner/nominatim/OsmNominatimRunner.moc:89
No locals.
#12 0x0029cb7d in metacall (argv=0xb3f66378, idx=15, cl=QMetaObject::InvokeMetaMethod, object=0xb4ab1e80) at kernel/qmetaobject.cpp:237
No locals.
#13 QMetaObject::metacall (object=0xb4ab1e80, cl=QMetaObject::InvokeMetaMethod, idx=15, argv=0xb3f66378) at kernel/qmetaobject.cpp:232
No locals.
#14 0x002a7685 in QMetaCallEvent::placeMetaCall (this=0xb3f664c0, object=0xb4ab1e80) at kernel/qobject.cpp:535
No locals.
#15 0x002aeb52 in QObject::event (this=0xb4ab1e80, e=0xb3f664c0) at kernel/qobject.cpp:1217
        mce = 0xb3f664c0
        currentSender = {sender = 0x0, signal = -1, ref = 1}
        previousSender = 0x0
#16 0x00528d84 in notify_helper (e=0xb3f664c0, receiver=0xb4ab1e80, this=0x80c6e80) at kernel/qapplication.cpp:4486
        consumed = <optimized out>
#17 QApplicationPrivate::notify_helper (this=0x80c6e80, receiver=0xb4ab1e80, e=0xb3f664c0) at kernel/qapplication.cpp:4458
No locals.
#18 0x0052e133 in QApplication::notify (this=0xb3f664c0, receiver=0xb4ab1e80, e=0xb3f664c0) at kernel/qapplication.cpp:3886
        res = true
#19 0x0029619e in QCoreApplication::notifyInternal (this=0xbffff558, receiver=0xb4ab1e80, event=0xb3f664c0) at kernel/qcoreapplication.cpp:787
        threadData = 0x9025a60
        returnValue = <optimized out>
        result = false
        cbdata = {0xb4ab1e80, 0xb3f664c0, 0xb26fbf5f}
        d = <optimized out>
#20 0x00299f93 in sendEvent (event=<optimized out>, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215
No locals.
#21 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x9025a60) at kernel/qcoreapplication.cpp:1428
        e = 0xb3f664c0
        r = 0xb4ab1e80
        locker = {val = 151149192}
        startOffset = 0
#22 0x0029a0ec in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0) at kernel/qcoreapplication.cpp:1321
        data = <optimized out>
#23 0x002c46a4 in sendPostedEvents () at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:220
No locals.
#24 postEventSourceDispatch (s=0xb3f01a30) at kernel/qeventdispatcher_glib.cpp:277
        source = 0xb3f01a30
#25 0x0172f25f in g_main_context_dispatch () from /lib/i386-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#26 0x0172f990 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#27 0x0172fc2a in g_main_context_iteration () from /lib/i386-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#28 0x002c4ada in QEventDispatcherGlib::processEvents (this=0x8e264b0, flags=...) at kernel/qeventdispatcher_glib.cpp:422
        d = 0x9025e88
        canWait = true
        savedFlags = {i = 0}
        result = <optimized out>
#29 0x002951dd in QEventLoop::processEvents (this=0xb26fc218, flags=...) at kernel/qeventloop.cpp:149
        d = 0xb3f665d8
#30 0x00295421 in QEventLoop::exec (this=0xb26fc218, flags=...) at kernel/qeventloop.cpp:201
        d = 0xb3f665d8
        app = 0xb26fc1bc
#31 0x04fcd08e in Marble::OsmNominatimRunner::reverseGeocoding (this=0xb4ab1e80, coordinates=...) at /home/dennis/marble/src-git/src/plugins/runner/nominatim/OsmNominatimRunner.cpp:100
        lon = 8.4157548558999995
        lat = 49.002245796899999
        url = {static null = {<No data fields>}, static shared_null = {ref = {_q_value = 1}, alloc = 0, size = 0, data = 0x80a9bd2, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, static shared_empty = {ref = {_q_value = 54}, alloc = 0, size = 0, data = 0x3cff9e, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, d = 0xb3f00468, static codecForCStrings = 0x0}
        base = {static null = {<No data fields>}, static shared_null = {ref = {_q_value = 1}, alloc = 0, size = 0, data = 0x80a9bd2, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, static shared_empty = {ref = {_q_value = 54}, alloc = 0, size = 0, data = 0x3cff9e, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, d = 0xb000d098, static codecForCStrings = 0x0}
        query = {static null = {<No data fields>}, static shared_null = {ref = {_q_value = 1}, alloc = 0, size = 0, data = 0x80a9bd2, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, static shared_empty = {ref = {_q_value = 54}, alloc = 0, size = 0, data = 0x3cff9e, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, d = 0xb3f155b0, static codecForCStrings = 0x0}
        eventLoop = {<QObject> = {_vptr.QObject = 0x3cd448, static staticMetaObject = {d = {superdata = 0x0, stringdata = 0x358580 "QObject", data = 0x358620, extradata = 0x3c83a0}}, d_ptr = {d = 0xb3f665d8}, static staticQtMetaObject = {d = {superdata = 0x0, stringdata = 0x3610e0 "Qt", data = 0x3649a0, extradata = 0x0}}}, static staticMetaObject = {d = {superdata = 0x3c8390, stringdata = 0x36a8c0 "QEventLoop", data = 0x36a8e0, extradata = 0x0}}}
#32 0x012d8c2c in Marble::ReverseGeocodingTask::runTask (this=0x97eadf8) at /home/dennis/marble/src-git/src/lib/RunnerTask.cpp:80
        runner = 0xb4ab1e80
#33 0x012d9172 in Marble::RunnerTask::run (this=0x97eadf8) at /home/dennis/marble/src-git/src/lib/RunnerTask.cpp:33
No locals.
#34 0x0018f651 in QThreadPoolThread::run (this=0xb6193ca8) at concurrent/qthreadpool.cpp:106
        r = 0x97eae00
        expired = <optimized out>
        locker = {val = 3065004664}
#35 0x0019b7b3 in QThreadPrivate::start (arg=0xb6193ca8) at thread/qthread_unix.cpp:331
        __clframe = {__cancel_routine = 0x19a660 <QThreadPrivate::finish(void*)>, __cancel_arg = 0xb6193ca8, __do_it = 1, __cancel_type = <optimized out>}
        thr = 0xb6193ca8
        data = 0x9025a60
#36 0x016aed31 in start_thread (arg=0xb26fcb70) at pthread_create.c:304
        __res = <optimized out>
        pd = 0xb26fcb70
        now = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {23855092, 0, 4001536, -1301298104, -1217393705, -1121138511}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = <optimized out>
        robust = <optimized out>
        pagesize_m1 = <optimized out>
        sp = <optimized out>
        freesize = <optimized out>
        __PRETTY_FUNCTION__ = "start_thread"
#37 0x015fe0ce in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130
No locals.
Backtrace stopped: Not enough registers or memory available to unwind further

Thread 10 (Thread 0xb36feb70 (LWP 13099)):
#0  0x001110c2 in ?? () from /lib/ld-linux.so.2
No symbol table info available.
#1  0x016b2e04 in pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_timedwait.S:236
No locals.
#2  0x0160bd54 in __pthread_cond_timedwait (cond=0xb6b04330, mutex=0xb6b04318, abstime=0xb36fe2b8) at forward.c:152
        __p = <optimized out>
#3  0x0019bc4e in wait (time=30000, this=0xb6b04318) at thread/qwaitcondition_unix.cpp:86
        tv = {tv_sec = 1326915066, tv_usec = 643756}
        ti = {tv_sec = 1326915096, tv_nsec = 643756000}
        code = <optimized out>
#4  QWaitCondition::wait (this=0xb6b0427c, mutex=0xb6b04278, time=30000) at thread/qwaitcondition_unix.cpp:160
        returnValue = 24
#5  0x0018f6e4 in QThreadPoolThread::run (this=0xb6193a70) at concurrent/qthreadpool.cpp:140
        r = 0x8f6d818
        expired = <optimized out>
        locker = {val = 3065004665}
#6  0x0019b7b3 in QThreadPrivate::start (arg=0xb6193a70) at thread/qthread_unix.cpp:331
        __clframe = {__cancel_routine = 0x19a660 <QThreadPrivate::finish(void*)>, __cancel_arg = 0xb6193a70, __do_it = 1, __cancel_type = <optimized out>}
        thr = 0xb6193a70
        data = 0xb6193940
#7  0x016aed31 in start_thread (arg=0xb36feb70) at pthread_create.c:304
        __res = <optimized out>
        pd = 0xb36feb70
        now = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {23855092, 0, 4001536, -1284512696, -1221588011, -1121138511}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = <optimized out>
        robust = <optimized out>
        pagesize_m1 = <optimized out>
        sp = <optimized out>
        freesize = <optimized out>
        __PRETTY_FUNCTION__ = "start_thread"
#8  0x015fe0ce in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130
No locals.
Backtrace stopped: Not enough registers or memory available to unwind further

Thread 7 (Thread 0xb48fcb70 (LWP 13097)):
#0  0x001110c2 in ?? () from /lib/ld-linux.so.2
No symbol table info available.
#1  0x016b2e04 in pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_timedwait.S:236
No locals.
#2  0x0160bd54 in __pthread_cond_timedwait (cond=0xb6b04330, mutex=0xb6b04318, abstime=0xb48fc2b8) at forward.c:152
        __p = <optimized out>
#3  0x0019bc4e in wait (time=30000, this=0xb6b04318) at thread/qwaitcondition_unix.cpp:86
        tv = {tv_sec = 1326915066, tv_usec = 908051}
        ti = {tv_sec = 1326915096, tv_nsec = 908051000}
        code = <optimized out>
#4  QWaitCondition::wait (this=0xb6b0427c, mutex=0xb6b04278, time=30000) at thread/qwaitcondition_unix.cpp:160
        returnValue = 24
#5  0x0018f6e4 in QThreadPoolThread::run (this=0x8f70c68) at concurrent/qthreadpool.cpp:140
        r = 0x8f7ab90
        expired = <optimized out>
        locker = {val = 3065004665}
#6  0x0019b7b3 in QThreadPrivate::start (arg=0x8f70c68) at thread/qthread_unix.cpp:331
        __clframe = {__cancel_routine = 0x19a660 <QThreadPrivate::finish(void*)>, __cancel_arg = 0x8f70c68, __do_it = 1, __cancel_type = <optimized out>}
        thr = 0x8f70c68
        data = 0x9002178
#7  0x016aed31 in start_thread (arg=0xb48fcb70) at pthread_create.c:304
        __res = <optimized out>
        pd = 0xb48fcb70
        now = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {23855092, 0, 4001536, -1265646520, 2003831770, -1121138511}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = <optimized out>
        robust = <optimized out>
        pagesize_m1 = <optimized out>
        sp = <optimized out>
        freesize = <optimized out>
        __PRETTY_FUNCTION__ = "start_thread"
#8  0x015fe0ce in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130
No locals.
Backtrace stopped: Not enough registers or memory available to unwind further

Thread 3 (Thread 0xb6affb70 (LWP 13093)):
#0  0x001110c2 in ?? () from /lib/ld-linux.so.2
No symbol table info available.
#1  0x015ef40e in __GI___poll (fds=0x8280400, nfds=2, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:87
        resultvar = <optimized out>
        oldtype = -516
        result = <optimized out>
#2  0x0173e34b in g_poll () from /lib/i386-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#3  0x0172f896 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#4  0x0172fc2a in g_main_context_iteration () from /lib/i386-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#5  0x002c4ada in QEventDispatcherGlib::processEvents (this=0x827f8d0, flags=...) at kernel/qeventdispatcher_glib.cpp:422
        d = 0x8280f18
        canWait = true
        savedFlags = {i = 0}
        result = <optimized out>
#6  0x002951dd in QEventLoop::processEvents (this=0xb6aff2b0, flags=...) at kernel/qeventloop.cpp:149
        d = 0x8282540
#7  0x00295421 in QEventLoop::exec (this=0xb6aff2b0, flags=...) at kernel/qeventloop.cpp:201
        d = 0x8282540
        app = 0xb6aff27c
#8  0x0019890b in QThread::exec (this=0xb6bd6448) at thread/qthread.cpp:498
        d = 0xb6bdfe78
        locker = {val = 3065904840}
        eventLoop = {<QObject> = {_vptr.QObject = 0x3cd448, static staticMetaObject = {d = {superdata = 0x0, stringdata = 0x358580 "QObject", data = 0x358620, extradata = 0x3c83a0}}, d_ptr = {d = 0x8282540}, static staticQtMetaObject = {d = {superdata = 0x0, stringdata = 0x3610e0 "Qt", data = 0x3649a0, extradata = 0x0}}}, static staticMetaObject = {d = {superdata = 0x3c8390, stringdata = 0x36a8c0 "QEventLoop", data = 0x36a8e0, extradata = 0x0}}}
        returnCode = <optimized out>
#9  0x00275e2d in QInotifyFileSystemWatcherEngine::run (this=0xb6bd6448) at io/qfilesystemwatcher_inotify.cpp:248
        sn = {<QObject> = {_vptr.QObject = 0x3cd568, static staticMetaObject = {d = {superdata = 0x0, stringdata = 0x358580 "QObject", data = 0x358620, extradata = 0x3c83a0}}, d_ptr = {d = 0x8282340}, static staticQtMetaObject = {d = {superdata = 0x0, stringdata = 0x3610e0 "Qt", data = 0x3649a0, extradata = 0x0}}}, static staticMetaObject = {d = {superdata = 0x3c8390, stringdata = 0x36bac0 "QSocketNotifier", data = 0x36bb00, extradata = 0x0}}, sockfd = 13, sntype = QSocketNotifier::Read, snenabled = true}
#10 0x0019b7b3 in QThreadPrivate::start (arg=0xb6bd6448) at thread/qthread_unix.cpp:331
        __clframe = {__cancel_routine = 0x19a660 <QThreadPrivate::finish(void*)>, __cancel_arg = 0xb6bd6448, __do_it = 1, __cancel_type = <optimized out>}
        thr = 0xb6bd6448
        data = 0xb6bdffb0
#11 0x016aed31 in start_thread (arg=0xb6affb70) at pthread_create.c:304
        __res = <optimized out>
        pd = 0xb6affb70
        now = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {23855092, 0, 4001536, -1229982648, 923798494, -1121138511}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = <optimized out>
        robust = <optimized out>
        pagesize_m1 = <optimized out>
        sp = <optimized out>
        freesize = <optimized out>
        __PRETTY_FUNCTION__ = "start_thread"
#12 0x015fe0ce in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130
No locals.
Backtrace stopped: Not enough registers or memory available to unwind further

Thread 2 (Thread 0xb74bab70 (LWP 13092)):
#0  0x001110c2 in ?? () from /lib/ld-linux.so.2
No symbol table info available.
#1  0x015ef40e in __GI___poll (fds=0x8357638, nfds=2, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:87
        resultvar = <optimized out>
        oldtype = -516
        result = <optimized out>
#2  0x0173e34b in g_poll () from /lib/i386-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#3  0x0172f896 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#4  0x0172fc2a in g_main_context_iteration () from /lib/i386-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#5  0x002c4ada in QEventDispatcherGlib::processEvents (this=0x8357570, flags=...) at kernel/qeventdispatcher_glib.cpp:422
        d = 0x835d378
        canWait = true
        savedFlags = {i = 0}
        result = <optimized out>
#6  0x002951dd in QEventLoop::processEvents (this=0xb74ba2b0, flags=...) at kernel/qeventloop.cpp:149
        d = 0x8359970
#7  0x00295421 in QEventLoop::exec (this=0xb74ba2b0, flags=...) at kernel/qeventloop.cpp:201
        d = 0x8359970
        app = 0xb74ba27c
#8  0x0019890b in QThread::exec (this=0x8355958) at thread/qthread.cpp:498
        d = 0x8355978
        locker = {val = 137714120}
        eventLoop = {<QObject> = {_vptr.QObject = 0x3cd448, static staticMetaObject = {d = {superdata = 0x0, stringdata = 0x358580 "QObject", data = 0x358620, extradata = 0x3c83a0}}, d_ptr = {d = 0x8359970}, static staticQtMetaObject = {d = {superdata = 0x0, stringdata = 0x3610e0 "Qt", data = 0x3649a0, extradata = 0x0}}}, static staticMetaObject = {d = {superdata = 0x3c8390, stringdata = 0x36a8c0 "QEventLoop", data = 0x36a8e0, extradata = 0x0}}}
        returnCode = <optimized out>
#9  0x00275e2d in QInotifyFileSystemWatcherEngine::run (this=0x8355958) at io/qfilesystemwatcher_inotify.cpp:248
        sn = {<QObject> = {_vptr.QObject = 0x3cd568, static staticMetaObject = {d = {superdata = 0x0, stringdata = 0x358580 "QObject", data = 0x358620, extradata = 0x3c83a0}}, d_ptr = {d = 0x835da80}, static staticQtMetaObject = {d = {superdata = 0x0, stringdata = 0x3610e0 "Qt", data = 0x3649a0, extradata = 0x0}}}, static staticMetaObject = {d = {superdata = 0x3c8390, stringdata = 0x36bac0 "QSocketNotifier", data = 0x36bb00, extradata = 0x0}}, sockfd = 11, sntype = QSocketNotifier::Read, snenabled = true}
#10 0x0019b7b3 in QThreadPrivate::start (arg=0x8355958) at thread/qthread_unix.cpp:331
        __clframe = {__cancel_routine = 0x19a660 <QThreadPrivate::finish(void*)>, __cancel_arg = 0x8355958, __do_it = 1, __cancel_type = <optimized out>}
        thr = 0x8355958
        data = 0x8354f58
#11 0x016aed31 in start_thread (arg=0xb74bab70) at pthread_create.c:304
        __res = <optimized out>
        pd = 0xb74bab70
        now = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {23855092, 0, 4001536, -1219779512, -5239843, -1121138511}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = <optimized out>
        robust = <optimized out>
        pagesize_m1 = <optimized out>
        sp = <optimized out>
        freesize = <optimized out>
        __PRETTY_FUNCTION__ = "start_thread"
#12 0x015fe0ce in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130
No locals.
Backtrace stopped: Not enough registers or memory available to unwind further

Thread 1 (Thread 0xb7fc6710 (LWP 13089)):
#0  0x0160bef7 in pthread_mutex_lock (mutex=0x80c9024) at forward.c:182
No locals.
#1  0x0172f0c3 in g_main_context_dispatch () from /lib/i386-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#2  0x0172f990 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#3  0x0172fc2a in g_main_context_iteration () from /lib/i386-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#4  0x002c4ada in QEventDispatcherGlib::processEvents (this=0x80c0478, flags=...) at kernel/qeventdispatcher_glib.cpp:422
        d = 0x80c7088
        canWait = true
        savedFlags = {i = 0}
        result = <optimized out>
#5  0x005e0e7a in QGuiEventDispatcherGlib::processEvents (this=0x80c0478, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
        d = 0x80c7088
        saved_flags = {i = 0}
        returnValue = false
#6  0x002951dd in QEventLoop::processEvents (this=0xbffff464, flags=...) at kernel/qeventloop.cpp:149
        d = 0x8e9a388
#7  0x00295421 in QEventLoop::exec (this=0xbffff464, flags=...) at kernel/qeventloop.cpp:201
        d = 0x8e9a388
        app = 0xbffff41c
#8  0x0029a19d in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1064
        threadData = 0x80c1128
        eventLoop = {<QObject> = {_vptr.QObject = 0x3cd448, static staticMetaObject = {d = {superdata = 0x0, stringdata = 0x358580 "QObject", data = 0x358620, extradata = 0x3c83a0}}, d_ptr = {d = 0x8e9a388}, static staticQtMetaObject = {d = {superdata = 0x0, stringdata = 0x3610e0 "Qt", data = 0x3649a0, extradata = 0x0}}}, static staticMetaObject = {d = {superdata = 0x3c8390, stringdata = 0x36a8c0 "QEventLoop", data = 0x36a8e0, extradata = 0x0}}}
        returnCode = <optimized out>
#9  0x00526924 in QApplication::exec () at kernel/qapplication.cpp:3760
No locals.
#10 0x0805a061 in main (argc=134912960, argv=0x80a9bc0) at /home/dennis/marble/src-git/src/qtmain.cpp:256
        graphicsString = {static null = {<No data fields>}, static shared_null = {ref = {_q_value = 1}, alloc = 0, size = 0, data = 0x80a9bd2, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, static shared_empty = {ref = {_q_value = 54}, alloc = 0, size = 0, data = 0x3cff9e, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, d = 0x80c2b30, static codecForCStrings = 0x0}
        app = {<QCoreApplication> = {<QObject> = {_vptr.QObject = 0xe71528, static staticMetaObject = {d = {superdata = 0x0, stringdata = 0x358580 "QObject", data = 0x358620, extradata = 0x3c83a0}}, d_ptr = {d = 0x80c6e80}, static staticQtMetaObject = {d = {superdata = 0x0, stringdata = 0x3610e0 "Qt", data = 0x3649a0, extradata = 0x0}}}, static staticMetaObject = {d = {superdata = 0x3c8390, stringdata = 0x36a960 "QCoreApplication", data = 0x36aa00, extradata = 0x0}}, static self = 0x0}, static staticMetaObject = {d = {superdata = 0x3cd4e0, stringdata = 0xc4d040 "QApplication", data = 0xc4d280, extradata = 0x0}}}
        marbleDataPath = {static null = {<No data fields>}, static shared_null = {ref = {_q_value = 1}, alloc = 0, size = 0, data = 0x80a9bd2, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, static shared_empty = {ref = {_q_value = 54}, alloc = 0, size = 0, data = 0x3cff9e, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, d = 0x80a9bc0, static codecForCStrings = 0x0}
        mapThemeId = {static null = {<No data fields>}, static shared_null = {ref = {_q_value = 1}, alloc = 0, size = 0, data = 0x80a9bd2, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, static shared_empty = {ref = {_q_value = 54}, alloc = 0, size = 0, data = 0x3cff9e, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, d = 0x80a9bc0, static codecForCStrings = 0x0}
        cmdLineSettings = {{d = 0x80a9be0, e = 0x80a9be0}}
        window = 0x811f828
        args = {<QList<QString>> = {{p = {static shared_null = {ref = {_q_value = 1}, alloc = 0, begin = 0, end = 0, sharable = 1, array = {0x0}}, d = 0x8163c38}, d = 0x8163c38}}, <No data fields>}
        graphicsSettings = <optimized out>
        lang = {static null = {<No data fields>}, static shared_null = {ref = {_q_value = 1}, alloc = 0, size = 0, data = 0x80a9bd2, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, static shared_empty = {ref = {_q_value = 54}, alloc = 0, size = 0, data = 0x3cff9e, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, d = 0x812ac38, static codecForCStrings = 0x0}
        translator = {<QObject> = {_vptr.QObject = 0x3cd628, static staticMetaObject = {d = {superdata = 0x0, stringdata = 0x358580 "QObject", data = 0x358620, extradata = 0x3c83a0}}, d_ptr = {d = 0x812f210}, static staticQtMetaObject = {d = {superdata = 0x0, stringdata = 0x3610e0 "Qt", data = 0x3649a0, extradata = 0x0}}}, static staticMetaObject = {d = {superdata = 0x3c8390, stringdata = 0x36bd40 "QTranslator", data = 0x36bd60, extradata = 0x0}}}
        dataPathIndex = <optimized out>
        distanceString = {static null = {<No data fields>}, static shared_null = {ref = {_q_value = 1}, alloc = 0, size = 0, data = 0x80a9bd2, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, static shared_empty = {ref = {_q_value = 54}, alloc = 0, size = 0, data = 0x3cff9e, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, d = 0x80a9bc0, static codecForCStrings = 0x0}
        profiles = {i = 0}
        coordinatesString = {static null = {<No data fields>}, static shared_null = {ref = {_q_value = 1}, alloc = 0, size = 0, data = 0x80a9bd2, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, static shared_empty = {ref = {_q_value = 54}, alloc = 0, size = 0, data = 0x3cff9e, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, d = 0x80a9bc0, static codecForCStrings = 0x0}
        measurement = <optimized out>
Comment 13 Dennis Nienhüser 2012-01-19 22:55:30 UTC
Git commit db8123f7d90f143703c85e61db153286b751e11b by Dennis Nienhüser.
Committed on 19/01/2012 at 23:47.
Pushed by nienhueser into branch 'KDE/4.8'.

Work around a bug in Qt 4.7 that leads to segfaults at startup.

See bug report and comments in the code for details. Thanks to
Bernhard for helping to track this down :)

M  +16   -0    src/lib/MarbleModel.cpp

http://commits.kde.org/marble/db8123f7d90f143703c85e61db153286b751e11b
Comment 14 Dennis Nienhüser 2012-01-19 23:16:38 UTC
Git commit b0f00d00d86f9e9bf0468eefcc098f8a3cb9b269 by Dennis Nienhüser.
Committed on 19/01/2012 at 23:47.
Pushed by nienhueser into branch 'master'.

Work around a bug in Qt 4.7 that leads to segfaults at startup.

See bug report and comments in the code for details. Thanks to
Bernhard for helping to track this down :)
(cherry picked from commit db8123f7d90f143703c85e61db153286b751e11b)

M  +16   -0    src/lib/MarbleModel.cpp

http://commits.kde.org/marble/b0f00d00d86f9e9bf0468eefcc098f8a3cb9b269
Comment 15 Bernhard Beschow 2012-01-20 15:52:35 UTC
Git commit 5194639c63837f5b404c31f1c24e0417c46685fe by Bernhard Beschow.
Committed on 20/01/2012 at 16:43.
Pushed by beschow into branch 'master'.

mention the Qt bug in the workaround for bug 288612

(cherry picked from commit 743899e82d1708b76f8e9d88ecabdd5c2c22fb22)

M  +7    -7    src/lib/MarbleModel.cpp

http://commits.kde.org/marble/5194639c63837f5b404c31f1c24e0417c46685fe
Comment 16 Dennis Nienhüser 2012-01-20 22:30:37 UTC
Git commit fd719f720a3fa7a0c599d0b6f06259e2ddca19b9 by Dennis Nienhüser, on behalf of Bernhard Beschow.
Committed on 16/01/2012 at 20:01.
Pushed by nienhueser into branch 'Touch/1.3'.

instantiate event loops in runner plugins rather than in RunnerTask and instantiate runners in background threads

Instantiating the event loops in the runner plugins rather than in RunnerTask resolves weired usage of QEventLoop: The synchronous runners were finished before QEventLoop::exec() was called. Somehow the finished signal of the runners still managed to quit the loop, such that exec() wouldn't block. Until Qt 4.8 we might just have been lucky...

Instantiating runners in the background thread avoids thread affinity issues wrt. to QEventLoop. In particular, QEventLoop instances would block a background thread forever because calling quit() or exit() wouldn't cause exec() to return.
FIXED-IN: 1.3.0
REVIEW: 103711

M  +9    -22   src/lib/MarbleRunnerManager.cpp
M  +57   -44   src/lib/RunnerTask.cpp
M  +33   -16   src/lib/RunnerTask.h
M  +7    -0    src/plugins/runner/hostip/HostipRunner.cpp
M  +14   -0    src/plugins/runner/nominatim/OsmNominatimRunner.cpp
M  +7    -0    src/plugins/runner/openrouteservice/OpenRouteServiceRunner.cpp
M  +8    -0    src/plugins/runner/yours/YoursRunner.cpp

http://commits.kde.org/marble/fd719f720a3fa7a0c599d0b6f06259e2ddca19b9