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

List:       konq-bugs
Subject:    Re: Bug#29902: qt multithread kioslave (http,ftp,imap) segfault
From:       Waldo Bastian <bastian () kde ! org>
Date:       2001-07-31 22:03:48
[Download RAW message or body]

On Tuesday 31 July 2001 02:44 pm, elmer@linking.ee wrote:
> On Sat, 28 Jul 2001, Rik Hemsley wrote:
> > Using qt-mt is EXPERIMENTAL. Please recompile with the non-mt version
> > of Qt and try again, unless you want to debug this yourself or are
> > willing to at least spend some time tracking down the problem.
>
> I could track the problem, but how do I attach a debugger to kioslave ?

That's described in kdebase/kioslave/DEBUG.howto, included here for your 
convenience.

Cheers,
Waldo

This document describes how you can debug an io-slave with gdb.

How does an io-slave get started?

Your application request 'klauncher' via DCOP for a slave. If 'klauncher' 
does 
not have an idle slave ready, it will ask kdeinit to start a new one.
kdeinit forks and dlopens the library that contains the io-slave.
Then it calls kdemain() or, if that is not present, main() in the library.

Due to the above sequence it is rather hard to get an io-slave in your
debugger. But wait there is hope. You can start klauncher in such a way
that slaves for a certain protocol are started in debug mode.

E.g. to start all 'http' slaves in debug mode, you type:

	KDE_SLAVE_DEBUG_WAIT=http kdeinit

This will restart 'kdeinit' and 'klauncher'.

When your application now requests a http slave, the slave will be started
by kdeinit, but before it calls kdemain() (cq. main()) it will suspend the
slave by sending it a SIGSTOP signal.

In the terminal from which you started kdeinit you will get the following
message:

kdeinit: Suspending process
kdeinit: 'gdb kdeinit 16779' to debug
kdeinit: 'kill -SIGCONT 16779' to continue

You can now debug your slave by typing (or pasting) 'gdb kdeinit 16779' in
a terminal. If you don't want to debug a slave you can let it continue by
sending it a SIGCONT by typing 'kill -SIGCONT 16779'.

Be aware that slaves will not be killed while they are suspended.

Once you have started gdb, you can set e.g. breakpoints and then resume the 
slave by typing 'continue'. The debugger will return immediate with a message 
that a SIGSTOP has been received so you will have to type 'continue' a second 
time.

Happy debugging.

-- 
Andrei Sakharov, Exiled 1980-1986, USSR, http://www.aip.org/history/sakharov/
Dmitry Sklyarov, Detained 2001-????, USA, http://www.elcomsoft.com/

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

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