[QScintilla] Crash when using QScintilla with IBus

Yuya Nishihara yuya at tcha.org
Sun Jun 26 17:09:11 BST 2011


Luca Beltrame wrote:
> for non-Latin input I use routinely IBus, an Input Method Editor (IME)
> written in Python (http://code.google.com/p/ibus). Recently I started to
> experience crashes in eric4, every time the completion popup appeared.
> What I noticed was that the crash only happened when IBus was running, If
> I turned it off, everything would work as normal.

Hi, I had mostly the same problem. QScintilla crashes when popup closed,
on the attached script.
It only happens with QT_IM_MODULE=ibus, but 100% reproducible.

(gdb) run scicompletion.py 
Starting program: /usr/bin/python scicompletion.py
...
... immediately after popup closed ...
Program received signal SIGSEGV, Segmentation fault.
QCoreApplication::notifyInternal (this=0xbed730, receiver=0xca0870, event=0x7fffffffc710) at kernel/qcoreapplication.cpp:719
(gdb) bt
#0  QCoreApplication::notifyInternal (this=0xbed730, receiver=0xca0870, event=0x7fffffffc710) at kernel/qcoreapplication.cpp:719
#1  0x00007fffed9bb8ea in sendEvent (this=<value optimized out>, event=...) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215
#2  QInputContext::sendEvent (this=<value optimized out>, event=...) at inputmethod/qinputcontext.cpp:280
#3  0x00007fffed9bb898 in QInputContext::sendEvent (this=0x10fe400, event=...) at inputmethod/qinputcontext.cpp:271
#4  0x00007fffe2501bf2 in IBusInputContext::displayPreeditText(IBus::Pointer<IBus::Text> const&, unsigned int, bool) ()
   from /usr/lib/qt4/plugins/inputmethods/libqtim-ibus.so
#5  0x00007fffe2505b38 in IBusInputContext::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib/qt4/plugins/inputmethods/libqtim-ibus.so
#6  0x00007fffef9e611a in QMetaObject::activate (sender=0x1105150, m=<value optimized out>, local_signal_index=<value optimized out>, argv=0x7fffffffcc40)
    at kernel/qobject.cpp:3278
#7  0x00007fffe0b82d34 in IBus::InputContext::updatePreeditText(IBus::Pointer<IBus::Text> const&, unsigned int, bool) () from /usr/lib/libibus-qt.so.1
#8  0x00007fffe0b7207b in IBus::InputContext::slotUpdatePreeditText(QDBusVariant const&, unsigned int, bool) () from /usr/lib/libibus-qt.so.1
#9  0x00007fffe0b8301b in IBus::InputContext::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib/libibus-qt.so.1
#10 0x00007fffef9e611a in QMetaObject::activate (sender=0x10f8c00, m=<value optimized out>, local_signal_index=<value optimized out>, argv=0x7fffffffcda0)
    at kernel/qobject.cpp:3278
#11 0x00007fffe0b81354 in IBusInputContextProxy::UpdatePreeditText(QDBusVariant const&, unsigned int, bool) () from /usr/lib/libibus-qt.so.1
#12 0x00007fffe0b8198e in IBusInputContextProxy::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib/libibus-qt.so.1
#13 0x00007fffe70ab331 in QDBusConnectionPrivate::deliverCall (this=0x10ff470, object=0x10f8c00, msg=..., metaTypes=..., slotIdx=22)
    at qdbusintegrator.cpp:941
#14 0x00007fffe70b486f in QDBusCallDeliveryEvent::placeMetaCall (this=<value optimized out>, object=<value optimized out>) at qdbusintegrator_p.h:103
#15 0x00007fffef9e9cca in QObject::event (this=0x10f8c00, e=<value optimized out>) at kernel/qobject.cpp:1217
#16 0x00007fffed411784 in notify_helper (this=0x95f240, receiver=0x10f8c00, e=0x1111ed0) at kernel/qapplication.cpp:4467
#17 QApplicationPrivate::notify_helper (this=0x95f240, receiver=0x10f8c00, e=0x1111ed0) at kernel/qapplication.cpp:4439
#18 0x00007fffed416611 in QApplication::notify (this=0xbed730, receiver=0x10f8c00, e=0x1111ed0) at kernel/qapplication.cpp:4346
#19 0x00007fffee37303b in ?? () from /usr/lib/pymodules/python2.6/PyQt4/QtGui.so
#20 0x00007fffef9d35bc in QCoreApplication::notifyInternal (this=0xbed730, receiver=0x10f8c00, event=0x1111ed0) at kernel/qcoreapplication.cpp:731
#21 0x00007fffef9d6978 in sendEvent (receiver=0x0, event_type=0, data=0x95f3e0) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215
#22 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x95f3e0) at kernel/qcoreapplication.cpp:1372
#23 0x00007fffef9fdc63 in sendPostedEvents (s=<value optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:220
#24 postEventSourceDispatch (s=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:277
#25 0x00007fffeec8a4a3 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#26 0x00007fffeec8ac80 in ?? () from /lib/libglib-2.0.so.0
...

It crashed at ++threadData->loopLevel of QCoreApplication::notifyInternal.

>     703 bool QCoreApplication::notifyInternal(QObject *receiver, QEvent *event)
>     704 {
>     705     // Make it possible for Qt Jambi and QSA to hook into events even
>     706     // though QApplication is subclassed...
>     707     bool result = false;
>     708     void *cbdata[] = { receiver, event, &result };
>     709     if (QInternal::activateCallbacks(QInternal::EventNotifyCallback, cbdata)) {
>     710         return result;
>     711     }
>     712
>     713     // Qt enforces the rule that events can only be sent to objects in
>     714     // the current thread, so receiver->d_func()->threadData is
>     715     // equivalent to QThreadData::current(), just without the function
>     716     // call overhead.
>     717     QObjectPrivate *d = receiver->d_func();
>     718     QThreadData *threadData = d->threadData;
>     719     ++threadData->loopLevel;

(gdb) p threadData
$1 = (QThreadData *) 0x4f000002
(gdb) p threadData->loopLevel
Cannot access memory at address 0x4f000016

It seems threadData has been damaged? Possibly, the receiver may be invalid.
The receiver is the current focusWidget.

(gdb) frame 2
#2  QInputContext::sendEvent (this=<value optimized out>, event=...) at inputmethod/qinputcontext.cpp:280

>     266 void QInputContext::sendEvent(const QInputMethodEvent &event)
>     267 {
>     268     // route events over input context parents to make chaining possible.
>     269     QInputContext *p = qobject_cast<QInputContext *>(parent());
>     270     if (p) {
>     271         p->sendEvent(event);
>     272         return;
>     273     }
>     274
>     275     QWidget *focus = focusWidget();
>     276     if (!focus)
>     277         return;
>     278
>     279     QInputMethodEvent e(event);
>     280     QApplication::sendEvent(focus, &e);
>     281 }

I use debian sid (amd64).

libqscintilla2-5                 2.4.3-2+b1
libqtcore4                       4:4.7.3-3
python-qscintilla2               2.4.3-2+b1
python-qt4                       4.8.3-2+b1

I hope the above backtrace contains some hints.

Regards,
Yuya
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scicompletion.py
Type: text/x-python
Size: 391 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/qscintilla/attachments/20110627/f13d284f/attachment.py>


More information about the QScintilla mailing list