Big trouble with KIO::NetAccess::enter_loop()

Michael Brade brade at kde.org
Sun Apr 25 16:19:04 BST 2004


On Wednesday 31 March 2004 13:25, Waldo Bastian wrote:
> On Wed March 31 2004 12:41, Michael Brade wrote:
> > I guess the exit_loop call is never reached (in
> > NetAccess::slotResult())...
>
> Guessing doesn't help. Better add some debug info there to see if it gets
> called. What is the QEvent::loopLevel () when it gets called? Does this
> match the loop level that you had when you started the NetAccess call? You
> may want to abort if it doesn't match and generate a backtrace.
Puh, took long enough but finally I triggered the problem again. I've put the 
following in NetAccess:

--- netaccess.cpp       28 Aug 2003 20:50:44 -0000      1.47
+++ netaccess.cpp       25 Apr 2004 15:11:33 -0000
@@ -396,15 +396,19 @@ void qt_leave_modal( QWidget *widget );

 void NetAccess::enter_loop()
 {
+  kdDebug() << k_funcinfo << "#### LOOP: level before: " << qApp->loopLevel() 
<< endl;
   QWidget dummy(0,0,WType_Dialog | WShowModal);
   dummy.setFocusPolicy( QWidget::NoFocus );
   qt_enter_modal(&dummy);
   qApp->enter_loop();
   qt_leave_modal(&dummy);
+  kdDebug() << k_funcinfo << "#### LOOP: level after: " << qApp->loopLevel() 
<< endl;
 }

 void NetAccess::slotResult( KIO::Job * job )
 {
+  kdDebug() << k_funcinfo << "#### LOOP: level before: " << qApp->loopLevel() 
<< endl;
+  kdDebug() << kdBacktrace() << endl;
   bJobOK = !job->error();
   if ( !bJobOK )
   {
@@ -415,6 +419,7 @@ void NetAccess::slotResult( KIO::Job * j
   if ( job->isA("KIO::StatJob") )
     m_entry = static_cast<KIO::StatJob *>(job)->statResult();
   qApp->exit_loop();
+  kdDebug() << k_funcinfo << "#### LOOP: level after: " << qApp->loopLevel() 
<< endl;
 }

> My guess is that NetAccess::slotResult gets called from another event-loop
> (e.g. due to a messagebox or *horror* the QClipboard event loop) and that
> the exit_loop call then terminates the wrong event-loop and subsequently
> never returns the event-loop started by NetAccess.
Below's the debug output, is it of any help to you? For some reason it does 
not include why the slotResult is not called again :( However, since bt 
mentions the event filters, could it be that a popup menu that was/is about 
to be shown the reason?

newton:~ $ kio (KIOJob): kio_uiserver registered
knotes: [void KIO::NetAccess::enter_loop()] #### LOOP: level before: 1
knotes: [void KIO::NetAccess::enter_loop()] #### LOOP: level before: 2
knotes: [void KIO::NetAccess::slotResult(KIO::Job*)] #### LOOP: level before: 
3
knotes: [
0: /opt/kde-3/lib/libkdecore.so.4(_Z11kdBacktracei+0x38) [0x40a266be]
1: /opt/kde-3/lib/libkdecore.so.4(_Z11kdBacktracev+0x26) [0x40a26976]
2: /opt/kde-3/lib/libkio.so.4(_ZN3KIO9NetAccess10slotResultEPNS_3JobE+0x17b) 
[0x4046419b]
3: /opt/kde-3/lib/libkio.so.4(_ZN3KIO9NetAccess9qt_invokeEiP8QUObject+0x99) 
[0x40464c99]
4: /opt/qt-3/lib/libqt-mt.so.3
(_ZN7QObject15activate_signalEP15QConnectionListP8QUObject+0x14c) 
[0x4128e47c]
5: /opt/kde-3/lib/libkio.so.4(_ZN3KIO3Job6resultEPS0_+0x9a) [0x40449bda]
6: /opt/kde-3/lib/libkio.so.4(_ZN3KIO3Job10emitResultEv+0x7c) [0x40430cec]
7: /opt/kde-3/lib/libkio.so.4(_ZN3KIO3Job12removeSubjobEPS0_+0x4b) 
[0x40430aeb]
8: /opt/kde-3/lib/libkio.so.4(_ZN3KIO11FileCopyJob10slotResultEPNS_3JobE+0xdc) 
[0x4043a0ac]
9: /opt/kde-3/lib/libkio.so.4(_ZN3KIO11FileCopyJob9qt_invokeEiP8QUObject+0xbd) 
[0x4044c38d]
10: /opt/qt-3/lib/libqt-mt.so.3
(_ZN7QObject15activate_signalEP15QConnectionListP8QUObject+0x14c) 
[0x4128e47c]
11: /opt/kde-3/lib/libkio.so.4(_ZN3KIO3Job6resultEPS0_+0x9a) [0x40449bda]
12: /opt/kde-3/lib/libkio.so.4(_ZN3KIO3Job10emitResultEv+0x7c) [0x40430cec]
13: /opt/kde-3/lib/libkio.so.4(_ZN3KIO9SimpleJob12slotFinishedEv+0x3e) 
[0x404327fe]
14: /opt/kde-3/lib/libkio.so.4(_ZN3KIO9SimpleJob9qt_invokeEiP8QUObject+0x8d) 
[0x4044a65d]
15: /opt/kde-3/lib/libkio.so.4
(_ZN3KIO13DirectCopyJob9qt_invokeEiP8QUObject+0x43) [0x4044aef3]
16: /opt/qt-3/lib/libqt-mt.so.3
(_ZN7QObject15activate_signalEP15QConnectionListP8QUObject+0x14c) 
[0x4128e47c]
17: /opt/qt-3/lib/libqt-mt.so.3(_ZN7QObject15activate_signalEi+0xb4) 
[0x4128e2a4]
18: /opt/kde-3/lib/libkio.so.4(_ZN3KIO14SlaveInterface8finishedEv+0x2e) 
[0x40425e2e]
19: /opt/kde-3/lib/libkio.so.4
(_ZN3KIO14SlaveInterface8dispatchEiRK9QMemArrayIcE+0xc22) [0x40422eb2]
20: /opt/kde-3/lib/libkio.so.4(_ZN3KIO14SlaveInterface8dispatchEv+0x70) 
[0x40422090]
21: /opt/kde-3/lib/libkio.so.4(_ZN3KIO5Slave8gotInputEv+0x28) [0x4041ef18]
22: /opt/kde-3/lib/libkio.so.4(_ZN3KIO5Slave9qt_invokeEiP8QUObject+0x98) 
[0x404217d8]
23: /opt/qt-3/lib/libqt-mt.so.3
(_ZN7QObject15activate_signalEP15QConnectionListP8QUObject+0x14c) 
[0x4128e47c]
24: /opt/qt-3/lib/libqt-mt.so.3(_ZN7QObject15activate_signalEii+0xed) 
[0x4128e5dd]
25: /opt/qt-3/lib/libqt-mt.so.3(_ZN15QSocketNotifier9activatedEi+0x32) 
[0x415d16d2]
26: /opt/qt-3/lib/libqt-mt.so.3(_ZN15QSocketNotifier5eventEP6QEvent+0x50) 
[0x412aab60]
27: /opt/qt-3/lib/libqt-mt.so.3
(_ZN12QApplication14internalNotifyEP7QObjectP6QEvent+0xbf) [0x4123208f]
28: /opt/qt-3/lib/libqt-mt.so.3
(_ZN12QApplication6notifyEP7QObjectP6QEvent+0x11e) [0x4123168e]
29: /opt/kde-3/lib/libkdecore.so.4
(_ZN12KApplication6notifyEP7QObjectP6QEvent+0x539) [0x40a17b69]
30: /opt/qt-3/lib/libqt-mt.so.3
(_ZN10QEventLoop23activateSocketNotifiersEv+0xea) [0x41221ada]
31: /opt/qt-3/lib/libqt-mt.so.3(_ZN10QEventLoop13processEventsEj+0x413) 
[0x411db593]
32: /opt/qt-3/lib/libqt-mt.so.3(_ZN10QEventLoop9enterLoopEv+0xe8) [0x412443f8]
33: /opt/qt-3/lib/libqt-mt.so.3(_ZN12QApplication10enter_loopEv+0x21) 
[0x41232341]
34: /opt/kde-3/lib/libkio.so.4(_ZN3KIO9NetAccess10enter_loopEv+0x1a1) 
[0x40463901]
35: /opt/kde-3/lib/libkio.so.4
(_ZN3KIO9NetAccess16filecopyInternalERK4KURLS3_ibbP7QWidgetb+0xc3) 
[0x40462ca3]
36: /opt/kde-3/lib/libkio.so.4
(_ZN3KIO9NetAccess9file_copyERK4KURLS3_ibbP7QWidget+0xb0) [0x40461d10]
37: knotes [0x8084b32]
38: knotes [0x808247c]
39: knotes [0x8064435]
40: knotes [0x806507a]
41: /opt/qt-3/lib/libqt-mt.so.3
(_ZN7QObject15activate_signalEP15QConnectionListP8QUObject+0x14c) 
[0x4128e47c]
42: /opt/qt-3/lib/libqt-mt.so.3(_ZN7QObject15activate_signalEi+0xb4) 
[0x4128e2a4]
43: knotes [0x806eeae]
44: knotes [0x806b0d8]
45: knotes [0x806ea22]
46: /opt/qt-3/lib/libqt-mt.so.3(_ZN7QObject16activate_filtersEP6QEvent+0x6e) 
[0x4128bdae]
47: /opt/qt-3/lib/libqt-mt.so.3(_ZN7QObject5eventEP6QEvent+0xbc) [0x4128bcdc]
48: /opt/qt-3/lib/libqt-mt.so.3(_ZN7QWidget5eventEP6QEvent+0x2f) [0x412c443f]
49: /opt/qt-3/lib/libqt-mt.so.3(_ZN9QTextEdit5eventEP6QEvent+0x3d) 
[0x413e7abd]
50: /opt/qt-3/lib/libqt-mt.so.3
(_ZN12QApplication14internalNotifyEP7QObjectP6QEvent+0xbf) [0x4123208f]
51: /opt/qt-3/lknotes:
knotes: [void KIO::NetAccess::slotResult(KIO::Job*)] #### LOOP: level after: 3
knotes: [void KIO::NetAccess::enter_loop()] #### LOOP: level after: 2

Cheers,
-- 
Michael Brade;                 KDE Developer, Student of Computer Science
  |-mail: echo brade !#|tr -d "c oh"|s\e\d 's/e/\@/2;s/$/.org/;s/bra/k/2'
  °--web: http://www.kde.org/people/michaelb.html

KDE 3: The Next Generation in Desktop Experience
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20040425/c0195a6a/attachment.sig>


More information about the kde-core-devel mailing list