wikipedia runner crasher, was: Re: runners: same .so, different configs?

Sebastian Kügler sebas at kde.org
Sun Nov 1 02:33:02 CET 2009


Hi,

On Tuesday 27 October 2009 16:22:48 Sebastian Kügler wrote:
> I'm planning to merge the wikipedia search plugin into KDE for 4.4. The
>  plugin is basically a MediaWiki search class, with its URL pointed to
>  Wikipedia.

I'm getting crashers in the wikipedia runner, and I feel like hitting a wall when 
trying to sort it out. Maybe someone here can give me some pointers.

The wikipedia runner works async. In match(), we start a mediawiki query, we catch 
the finished() signal and pass the result as matches. 
Since this doesn't work with KRunner's threading, we're essentially blocking on the 
query (it's run in its own thread anyway) by starting a nested event loop and 
quitting it after results are in. It seems to be worse when using KIO's 
AccessManager.

I've tried different variants, a QMutex to lock access to the shared class for 
example, but nothing would really help. Can anyone tell me how I can fix this in the 
right way?

I only sometimes get a backtrace, it's attached, code is here:
http://websvn.kde.org/trunk/playground/base/plasma/runners/wikipedia/wikipedia.cpp?view=markup

Thanks,
-- 
sebas

 http://www.kde.org | http://vizZzion.org |  GPG Key ID: 9119 0EF9 
-------------- next part --------------
Application: Run Command Interface (krunner), signal: Segmentation fault
[Current thread is 1 (Thread 0xb481a760 (LWP 4220))]

Thread 6 (Thread 0xa9089b70 (LWP 4221)):
#0  0xb7fc3430 in __kernel_vsyscall ()
#1  0xb5aefe15 in pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_wait.S:122
#2  0xb5b69fd7 in QWaitConditionPrivate::wait (this=0x8a81dd0, mutex=0x8a88638, time=4294967295) at thread/qwaitcondition_unix.cpp:87
#3  QWaitCondition::wait (this=0x8a81dd0, mutex=0x8a88638, time=4294967295) at thread/qwaitcondition_unix.cpp:159
#4  0xb6d1b16c in ThreadWeaver::WeaverImpl::blockThreadUntilJobsAreBeingAssigned (this=0x8a81db8, th=0x8a70c78) at /home/sebas/kdesvn/src/kdelibs/threadweaver/Weaver/WeaverImpl.cpp:365
#5  0xb6d1f012 in ThreadWeaver::WorkingHardState::waitForAvailableJob (this=0x8a6db20, th=0x8a70c78) at /home/sebas/kdesvn/src/kdelibs/threadweaver/Weaver/WorkingHardState.cpp:80
#6  0xb6d1b0eb in ThreadWeaver::WeaverImpl::waitForAvailableJob (this=0x8a81db8, th=0x8a70c78) at /home/sebas/kdesvn/src/kdelibs/threadweaver/Weaver/WeaverImpl.cpp:356
#7  0xb6d1efb6 in ThreadWeaver::WorkingHardState::applyForWork (this=0x8a6db20, th=0x8a70c78) at /home/sebas/kdesvn/src/kdelibs/threadweaver/Weaver/WorkingHardState.cpp:71
#8  0xb6d1b0c4 in ThreadWeaver::WeaverImpl::applyForWork (this=0x8a81db8, th=0x8a70c78, previous=0x8a89780) at /home/sebas/kdesvn/src/kdelibs/threadweaver/Weaver/WeaverImpl.cpp:351
#9  0xb6d1c94d in ThreadWeaver::ThreadRunHelper::run (this=0xa9089284, parent=0x8a81db8, th=0x8a70c78) at /home/sebas/kdesvn/src/kdelibs/threadweaver/Weaver/Thread.cpp:87
#10 0xb6d1cce1 in ThreadWeaver::Thread::run (this=0x8a70c78) at /home/sebas/kdesvn/src/kdelibs/threadweaver/Weaver/Thread.cpp:142
#11 0xb5b69013 in QThreadPrivate::start (arg=0x8a70c78) at thread/qthread_unix.cpp:244
#12 0xb5aeb80e in start_thread (arg=0xa9089b70) at pthread_create.c:300
#13 0xb57957ee in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

Thread 5 (Thread 0xa8888b70 (LWP 4222)):
#0  0xb7fc3430 in __kernel_vsyscall ()
#1  0xb5aefe15 in pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_wait.S:122
#2  0xb5b69fd7 in QWaitConditionPrivate::wait (this=0x8a81dd0, mutex=0x8a88638, time=4294967295) at thread/qwaitcondition_unix.cpp:87
#3  QWaitCondition::wait (this=0x8a81dd0, mutex=0x8a88638, time=4294967295) at thread/qwaitcondition_unix.cpp:159
#4  0xb6d1b16c in ThreadWeaver::WeaverImpl::blockThreadUntilJobsAreBeingAssigned (this=0x8a81db8, th=0x8bec5c8) at /home/sebas/kdesvn/src/kdelibs/threadweaver/Weaver/WeaverImpl.cpp:365
#5  0xb6d1f012 in ThreadWeaver::WorkingHardState::waitForAvailableJob (this=0x8a6db20, th=0x8bec5c8) at /home/sebas/kdesvn/src/kdelibs/threadweaver/Weaver/WorkingHardState.cpp:80
#6  0xb6d1b0eb in ThreadWeaver::WeaverImpl::waitForAvailableJob (this=0x8a81db8, th=0x8bec5c8) at /home/sebas/kdesvn/src/kdelibs/threadweaver/Weaver/WeaverImpl.cpp:356
#7  0xb6d1efb6 in ThreadWeaver::WorkingHardState::applyForWork (this=0x8a6db20, th=0x8bec5c8) at /home/sebas/kdesvn/src/kdelibs/threadweaver/Weaver/WorkingHardState.cpp:71
#8  0xb6d1b0c4 in ThreadWeaver::WeaverImpl::applyForWork (this=0x8a81db8, th=0x8bec5c8, previous=0x8978238) at /home/sebas/kdesvn/src/kdelibs/threadweaver/Weaver/WeaverImpl.cpp:351
#9  0xb6d1c94d in ThreadWeaver::ThreadRunHelper::run (this=0xa8888284, parent=0x8a81db8, th=0x8bec5c8) at /home/sebas/kdesvn/src/kdelibs/threadweaver/Weaver/Thread.cpp:87
#10 0xb6d1cce1 in ThreadWeaver::Thread::run (this=0x8bec5c8) at /home/sebas/kdesvn/src/kdelibs/threadweaver/Weaver/Thread.cpp:142
#11 0xb5b69013 in QThreadPrivate::start (arg=0x8bec5c8) at thread/qthread_unix.cpp:244
#12 0xb5aeb80e in start_thread (arg=0xa8888b70) at pthread_create.c:300
#13 0xb57957ee in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

Thread 4 (Thread 0xa8087b70 (LWP 4223)):
#0  0xb7fc3430 in __kernel_vsyscall ()
#1  0xb5787ba6 in *__GI___poll (fds=0xb5808ff4, nfds=1, timeout=1350) at ../sysdeps/unix/sysv/linux/poll.c:87
#2  0xb4d5e53b in g_poll () from /lib/libglib-2.0.so.0
#3  0xb4d5155b in ?? () from /lib/libglib-2.0.so.0
#4  0xb4d51853 in g_main_context_iteration () from /lib/libglib-2.0.so.0
#5  0xb5c7ef5f in QEventDispatcherGlib::processEvents (this=0x8c6dd50, flags=...) at kernel/qeventdispatcher_glib.cpp:409
#6  0xb5c563a9 in QEventLoop::processEvents (this=0xa80870b4, flags=) at kernel/qeventloop.cpp:149
#7  0xb5c56582 in QEventLoop::exec (this=0xa80870b4, flags=...) at kernel/qeventloop.cpp:197
#8  0xa98e86f2 in Wikipedia::match (this=0x8bb9948, context=...) at /home/sebas/kdesvn/src/playground-plasma/runners/wikipedia/wikipedia.cpp:79
#9  0xb6dd6433 in Plasma::AbstractRunner::performMatch (this=0x8bb9948, localContext=...) at /home/sebas/kdesvn/src/kdelibs/plasma/abstractrunner.cpp:161
#10 0xb6e78428 in Plasma::FindMatchesJob::run (this=0x8c98628) at /home/sebas/kdesvn/src/kdelibs/plasma/private/runnerjobs.cpp:158
#11 0xb6d1d796 in ThreadWeaver::JobRunHelper::runTheJob (this=0xa80871fc, th=0x8c30410, job=0x8c98628) at /home/sebas/kdesvn/src/kdelibs/threadweaver/Weaver/Job.cpp:106
#12 0xb6d1da13 in ThreadWeaver::Job::execute (this=0x8c98628, th=0x8c30410) at /home/sebas/kdesvn/src/kdelibs/threadweaver/Weaver/Job.cpp:135
#13 0xb6d1c99a in ThreadWeaver::ThreadRunHelper::run (this=0xa8087284, parent=0x8a81db8, th=0x8c30410) at /home/sebas/kdesvn/src/kdelibs/threadweaver/Weaver/Thread.cpp:95
#14 0xb6d1cce1 in ThreadWeaver::Thread::run (this=0x8c30410) at /home/sebas/kdesvn/src/kdelibs/threadweaver/Weaver/Thread.cpp:142
#15 0xb5b69013 in QThreadPrivate::start (arg=0x8c30410) at thread/qthread_unix.cpp:244
#16 0xb5aeb80e in start_thread (arg=0xa8087b70) at pthread_create.c:300
#17 0xb57957ee in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

Thread 3 (Thread 0xa7886b70 (LWP 4224)):
#0  0xb4dcee06 in *__GI_clock_gettime (clock_id=-1260572684, tp=0xa7885dc8) at ../sysdeps/unix/clock_gettime.c:100
#1  0xb5c7c77b in qt_gettime () at kernel/qcore_unix.cpp:109
#2  0xb5c81045 in QTimerInfoList::updateCurrentTime (this=0x8c2991c) at kernel/qeventdispatcher_unix.cpp:340
#3  0xb5c7f05e in timerSourceCheckHelper (src=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:150
#4  0xb4d50cc1 in g_main_context_check () from /lib/libglib-2.0.so.0
#5  0xb4d5146c in ?? () from /lib/libglib-2.0.so.0
#6  0xb4d51853 in g_main_context_iteration () from /lib/libglib-2.0.so.0
#7  0xb5c7ef5f in QEventDispatcherGlib::processEvents (this=0x8af1188, flags=...) at kernel/qeventdispatcher_glib.cpp:409
#8  0xb5c563a9 in QEventLoop::processEvents (this=0xa78860b4, flags=) at kernel/qeventloop.cpp:149
#9  0xb5c56582 in QEventLoop::exec (this=0xa78860b4, flags=...) at kernel/qeventloop.cpp:197
#10 0xa98e86f2 in Wikipedia::match (this=0x8bb9948, context=...) at /home/sebas/kdesvn/src/playground-plasma/runners/wikipedia/wikipedia.cpp:79
#11 0xb6dd6433 in Plasma::AbstractRunner::performMatch (this=0x8bb9948, localContext=...) at /home/sebas/kdesvn/src/kdelibs/plasma/abstractrunner.cpp:161
#12 0xb6e78428 in Plasma::FindMatchesJob::run (this=0x8c98258) at /home/sebas/kdesvn/src/kdelibs/plasma/private/runnerjobs.cpp:158
#13 0xb6d1d796 in ThreadWeaver::JobRunHelper::runTheJob (this=0xa78861fc, th=0x8c296b0, job=0x8c98258) at /home/sebas/kdesvn/src/kdelibs/threadweaver/Weaver/Job.cpp:106
#14 0xb6d1da13 in ThreadWeaver::Job::execute (this=0x8c98258, th=0x8c296b0) at /home/sebas/kdesvn/src/kdelibs/threadweaver/Weaver/Job.cpp:135
#15 0xb6d1c99a in ThreadWeaver::ThreadRunHelper::run (this=0xa7886284, parent=0x8a81db8, th=0x8c296b0) at /home/sebas/kdesvn/src/kdelibs/threadweaver/Weaver/Thread.cpp:95
#16 0xb6d1cce1 in ThreadWeaver::Thread::run (this=0x8c296b0) at /home/sebas/kdesvn/src/kdelibs/threadweaver/Weaver/Thread.cpp:142
#17 0xb5b69013 in QThreadPrivate::start (arg=0x8c296b0) at thread/qthread_unix.cpp:244
#18 0xb5aeb80e in start_thread (arg=0xa7886b70) at pthread_create.c:300
#19 0xb57957ee in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

Thread 2 (Thread 0xa6d9bb70 (LWP 4225)):
#0  0xb7fc3430 in __kernel_vsyscall ()
#1  0xb5af0142 in pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_timedwait.S:179
#2  0xb5b69f5f in QWaitConditionPrivate::wait (this=0x8cbc93c, mutex=0x8cbc938, time=30000) at thread/qwaitcondition_unix.cpp:85
#3  QWaitCondition::wait (this=0x8cbc93c, mutex=0x8cbc938, time=30000) at thread/qwaitcondition_unix.cpp:159
#4  0xb5b60966 in QThreadPoolThread::run (this=0x8bef218) at concurrent/qthreadpool.cpp:140
#5  0xb5b69013 in QThreadPrivate::start (arg=0x8bef218) at thread/qthread_unix.cpp:244
#6  0xb5aeb80e in start_thread (arg=0xa6d9bb70) at pthread_create.c:300
#7  0xb57957ee in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130
The current source language is "auto; currently c".

Thread 1 (Thread 0xb481a760 (LWP 4220)):
[KCrash Handler]
#6  mem2chunk_check (mem=0xfdd46228, magic_p=<value optimized out>) at hooks.c:166
#7  0xb5735c38 in free_check (mem=0x8d46268, caller=0xb5b63e5d) at hooks.c:279
#8  0xb5738806 in *__GI___libc_free (mem=0xf4ffffc8) at malloc.c:3677
#9  0xb5b63e5d in qFree (ptr=0x8d46268) at global/qmalloc.cpp:60
#10 0xb5c03102 in ~QByteArray (this=0x8d45900) at ../../include/QtCore/../../src/corelib/tools/qbytearray.h:382
#11 QTextStreamPrivate::flushWriteBuffer (this=0x8d45900) at io/qtextstream.cpp:705
#12 0xb5c0392d in ~QTextStream (this=0x8d458e0, __in_chrg=<value optimized out>) at io/qtextstream.cpp:1145
#13 0xb5348d8d in ~Stream (this=0x8d458e0, __in_chrg=<value optimized out>) at /home/sebas/kdesvn/qt-copy/include/QtCore/../../src/corelib/io/qdebug.h:64
#14 0xb5348e23 in ~QDebug (this=0xbfd8de38, __in_chrg=<value optimized out>) at /home/sebas/kdesvn/qt-copy/include/QtCore/../../src/corelib/io/qdebug.h:88
#15 0xb535650d in KIO::ConnectionServer::listenForRemote (this=0x8d1b788) at /home/sebas/kdesvn/src/kdelibs/kio/kio/connection.cpp:568
#16 0xb543aeed in SlavePrivate (this=0x8d1a7a8, protocol=...) at /home/sebas/kdesvn/src/kdelibs/kio/kio/slave.cpp:88
#17 0xb5438f9c in Slave (this=0x8d1b718, protocol=..., parent=0x0) at /home/sebas/kdesvn/src/kdelibs/kio/kio/slave.cpp:157
#18 0xb5439dd9 in KIO::Slave::createSlave (protocol=..., url=..., error=@0xbfd8dffc, error_text=...) at /home/sebas/kdesvn/src/kdelibs/kio/kio/slave.cpp:385
#19 0xb54323a3 in KIO::SchedulerPrivate::createSlave (this=0x8bcd3f8, protInfo=0x8bce928, job=0x8d177f8, url=...) at /home/sebas/kdesvn/src/kdelibs/kio/kio/scheduler.cpp:676
#20 0xb5431935 in KIO::SchedulerPrivate::startJobScheduled (this=0x8bcd3f8, protInfo=0x8bce928) at /home/sebas/kdesvn/src/kdelibs/kio/kio/scheduler.cpp:534
#21 0xb54310bd in KIO::SchedulerPrivate::startStep (this=0x8bcd3f8) at /home/sebas/kdesvn/src/kdelibs/kio/kio/scheduler.cpp:425
#22 0xb5434309 in KIO::Scheduler::qt_metacall (this=0x8bcd478, _c=QMetaObject::InvokeMetaMethod, _id=6, _a=0xbfd8e1ac) at /home/sebas/kdesvn/build/kdelibs/kio/scheduler.moc:108
#23 0xb5c5c44a in QMetaObject::metacall (object=0x8bcd478, cl=148136808, idx=10, argv=0xbfd8e1ac) at kernel/qmetaobject.cpp:237
#24 0xb5c6a201 in QMetaObject::activate (sender=0x8bcd3fc, m=0xb5d135c4, local_signal_index=0, argv=0x0) at kernel/qobject.cpp:3395
#25 0xb5cb2407 in QTimer::timeout (this=0x8bcd3fc) at .moc/release-shared/moc_qtimer.cpp:134
#26 0xb5c70ebe in QTimer::timerEvent (this=0x8bcd3fc, e=0xbfd8e670) at kernel/qtimer.cpp:271
#27 0xb5c66d14 in QObject::event (this=0x8bcd3fc, e=0xbfd8e670) at kernel/qobject.cpp:1210
#28 0xb610d49c in QApplicationPrivate::notify_helper (this=0x8971e68, receiver=0x8bcd3fc, e=0xbfd8e670) at kernel/qapplication.cpp:4251
#29 0xb611691d in QApplication::notify (this=0x896f3a0, receiver=0x8bcd3fc, e=0xbfd8e670) at kernel/qapplication.cpp:3676
#30 0xb6a9c4c0 in KApplication::notify (this=0x896f3a0, receiver=0x8bcd3fc, event=0xbfd8e670) at /home/sebas/kdesvn/src/kdelibs/kdeui/kernel/kapplication.cpp:302
#31 0xb5c57b28 in QCoreApplication::notifyInternal (this=0x896f3a0, receiver=0x8bcd3fc, event=0xbfd8e670) at kernel/qcoreapplication.cpp:704
#32 0xb5c82826 in QCoreApplication::sendEvent (this=0x897e134) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215
#33 QTimerInfoList::activateTimers (this=0x897e134) at kernel/qeventdispatcher_unix.cpp:603
#34 0xb5c7f267 in timerSourceDispatch (source=0x897dca8) at kernel/qeventdispatcher_glib.cpp:184
#35 idleTimerSourceDispatch (source=0x897dca8) at kernel/qeventdispatcher_glib.cpp:231
#36 0xb4d4de78 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#37 0xb4d51720 in ?? () from /lib/libglib-2.0.so.0
#38 0xb4d51853 in g_main_context_iteration () from /lib/libglib-2.0.so.0
#39 0xb5c7ef25 in QEventDispatcherGlib::processEvents (this=0x897b610, flags=...) at kernel/qeventdispatcher_glib.cpp:407
#40 0xb61b2de5 in QGuiEventDispatcherGlib::processEvents (this=0x897b610, flags=...) at kernel/qguieventdispatcher_glib.cpp:202
#41 0xb5c563a9 in QEventLoop::processEvents (this=0xbfd8e934, flags=) at kernel/qeventloop.cpp:149
#42 0xb5c56582 in QEventLoop::exec (this=0xbfd8e934, flags=...) at kernel/qeventloop.cpp:197
#43 0xb5c58569 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:981
#44 0xb610d537 in QApplication::exec () at kernel/qapplication.cpp:3590
#45 0xb7f8b1a6 in kdemain (argc=1, argv=0xbfd8ead4) at /home/sebas/kdesvn/src/kdebase/workspace/krunner/main.cpp:65
#46 0x080487f9 in main (argc=1, argv=0xbfd8ead4) at /home/sebas/kdesvn/build/kdebase/workspace/krunner/krunner_dummy.cpp:3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 489 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20091101/eb5692ab/attachment-0001.sig 


More information about the Plasma-devel mailing list