[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: synchronization problem in libkhtml while doing a form submit
From:       Yarram Sunil Kumar <sunilyv () yahoo-inc ! com>
Date:       2004-07-14 15:45:24
Message-ID: 40F55244.9080009 () yahoo-inc ! com
[Download RAW message or body]

Zack Rusin wrote:

>On Tuesday 06 July 2004 12:01, Yarram Sunil Kumar wrote:
>  
>
>>I am writing an application that embeds libkhtml. In this application
>>i am trying to capture the form submit data after fetching the page.
>>
>>  I wanted to this  synchronously, first fetch the page and then do
>>the form submit and i dont want to do this in any slot.  I am using
>>QWaitCondition object for synchronization.  For this i have written
>>openURL slot,  formSubmit slot and documetComplete slot. Also running
>>the kapplication eventloop in separate worker thread (if i run it as
>>main thread i cannot do form submit after getting the page)
>>
>>i got the following error:-
>>Very strange! got a DCOPReply opcode, but we were not waiting for a
>>reply!
>>    
>>
>
>"In Qt, one thread is always the GUI or event thread. This is the thread 
>that creates a QApplication object and calls QApplication::exec(). This 
>is also the initial thread that calls main() at program start. This 
>thread is the only thread that is allowed to perform GUI operations, 
>including generating and receiving events from the window system. Qt 
>does not support creating QApplication and running the event loop (with 
>QApplication::exec()) in a secondary thread. You must create the 
>QApplication object and call QApplication::exec() from the main() 
>function in your program.". You try to exec in a different thread. I'm 
>afraid that you'll have to reread both Qt and KDE documentation if you 
>want to get it working.
>
>Zack
>
>  
>
     I have changed my code and running the QApplication::exec()  in 
main thread. There are other worker threads that does fetching (calls 
openURL).
Each thread reads a list of urls and fetches them sequentially.

The application sometimes crashes or gives "Xlib: unexpected async reply 
(sequence 0x533a)!" or "Very strange! got a DCOPReply opcode, but we 
were not waiting for a reply!". I am attaching my code with this mail. 
Please take a look at it.

The crash stack looks as:-
Program received signal SIGSEGV, Segmentation fault.
0x2205303e in KIO::Connection::sendnow () from /usr/local/lib/libkio.so.6
(gdb) where
#0  0x2205303e in KIO::Connection::sendnow () from /usr/local/lib/libkio.so.6
#1  0x22052cf4 in KIO::Connection::send () from /usr/local/lib/libkio.so.6
#2  0x22048f86 in KIO::Slave::send () from /usr/local/lib/libkio.so.6
#3  0x220551fe in KIO::SimpleJob::start () from /usr/local/lib/libkio.so.6
#4  0x2205818a in KIO::TransferJob::start () from /usr/local/lib/libkio.so.6
#5  0x2205036a in KIO::Scheduler::startJobScheduled () from /usr/local/lib/libkio.so.6
#6  0x2204f83f in KIO::Scheduler::startStep () from /usr/local/lib/libkio.so.6
#7  0x2205287c in KIO::Scheduler::qt_invoke () from /usr/local/lib/libkio.so.6
#8  0x2125b0b4 in QObject::activate_signal () from /usr/X11R6/lib/libqt-mt.so.3
#9  0x2125afb1 in QObject::activate_signal () from /usr/X11R6/lib/libqt-mt.so.3
#10 0x214f4ee0 in QTimer::timeout () from /usr/X11R6/lib/libqt-mt.so.3
#11 0x212752db in QTimer::event () from /usr/X11R6/lib/libqt-mt.so.3
#12 0x212163eb in QApplication::internalNotify () from /usr/X11R6/lib/libqt-mt.so.3
#13 0x21216028 in QApplication::notify () from /usr/X11R6/lib/libqt-mt.so.3
#14 0x21c6218f in KApplication::notify () from /usr/local/lib/libkdecore.so.6
#15 0x212090e6 in QEventLoop::activateTimers () from /usr/X11R6/lib/libqt-mt.so.3
#16 0x211d190c in QEventLoop::processEvents () from /usr/X11R6/lib/libqt-mt.so.3
#17 0x212241be in QEventLoop::enterLoop () from /usr/X11R6/lib/libqt-mt.so.3
#18 0x21224116 in QEventLoop::exec () from /usr/X11R6/lib/libqt-mt.so.3
#19 0x2121656d in QApplication::exec () from /usr/X11R6/lib/libqt-mt.so.3
#20 0x100888d in main () at kjscript.cpp:504



Thanks,
Sunil.



["mykhtml.tar.gz" (application/gzip)]

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic