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

List:       kdevelop-bugs
Subject:    [Bug 94206] New: kdevelop blocks application at start while debugging and hangs (with minimal exampl
From:       kdevelop-bugs-admin () barney ! cs ! uni-potsdam ! de
Date:       2004-12-01 8:30:40
Message-ID: 20041201093038.94206.te () profzone ! ch
[Download RAW message or body]

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
        
http://bugs.kde.org/show_bug.cgi?id=94206        
           Summary: kdevelop blocks application at start while debugging and
                    hangs (with minimal example)
           Product: kdevelop
           Version: CVS
          Platform: unspecified
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: NOR
         Component: general
        AssignedTo: kdevelop-bugs kdevelop org
        ReportedBy: te profzone ch


Version:           CVS (using KDE 3.3.0, SuSE)
Compiler:          gcc version 3.3.4 (pre 3.3.5 20040809)
OS:                Linux (i686) release 2.6.8-24.3-default

After click on "start in debugger", the gdb output shows:

------ snip ------
gdb /home/drzoom/Entwicklung/kdevelopthreadbug/bin/kdevelopthreadbug -fullname -nx \
-quiet (gdb) set edit off 
(gdb) set confirm off 
Using host libthread_db library "/lib/tls/libthread_db.so.1".
(gdb) 
(gdb) 
(gdb) set print static-members off 
(gdb) tty /dev/pts/2 
(gdb) set width 0 
(gdb) set height 0 
(gdb) set stop-on 0 
(gdb) handle SIG32 pass nostop noprint 
(gdb) handle SIG43 pass nostop noprint 
(gdb) set print asm-demangle off 
(gdb) set output-radix 16 
(gdb) cd /home/drzoom/Entwicklung/kdevelopthreadbug/bin 
(gdb) run 
[Thread debugging using libthread_db enabled]
warning: 
Unable to set global thread event mask: generic error

(gdb) backtrace 
[New Thread 1085896896 (LWP 6146)]
------ snip ------

At this point, the application and the debugger in kdevelop hangs, but all step and \
run buttons are enabled. Any click on the buttons has no effect.

A click on "stop" returns to normal mode, but the application process in the \
backgound isn't closed.

My settings after creating a "hello world!" qmake project (example code below) are:
"Project Options"->"Debugger"

[No] Display Static members
[No] Display demangled names (there is a translation error in the german translation)
[No] Try settings breakpoints on library loading
[Yes] Enable floating toolbar
[Yes] Enable seperate terminal for application IO

Set "Try settings breakpoints on library loading" to "Yes" results in a little bit \
different output and behaviour:

---- snip -----
gdb /home/drzoom/Entwicklung/kdevelopthreadbug/bin/kdevelopthreadbug -fullname -nx \
-quiet (gdb) set edit off 
(gdb) set confirm off 
Using host libthread_db library "/lib/tls/libthread_db.so.1".
(gdb) 
(gdb) 
(gdb) set print static-members off 
(gdb) tty /dev/pts/4 
(gdb) set width 0 
(gdb) set height 0 
(gdb) set stop-on 1 
(gdb) handle SIG32 pass nostop noprint 
(gdb) handle SIG43 pass nostop noprint 
(gdb) set print asm-demangle on 
(gdb) set output-radix 16 
(gdb) cd /home/drzoom/Entwicklung/kdevelopthreadbug/bin 
(gdb) run 
[Thread debugging using libthread_db enabled]
warning: 
Unable to set global thread event mask: generic error

(gdb) backtrace 
[New Thread 1085896896 (LWP 6245)]
Stopped due to shared library event
#0  0x4000d650 in _dl_debug_state () from /lib/ld-linux.so.2
#1  0x4000299c in dl_main () from /lib/ld-linux.so.2
#2  0x40010601 in _dl_sysdep_start () from /lib/ld-linux.so.2
#3  0x40001350 in _dl_start () from /lib/ld-linux.so.2
#4  0x400007a7 in _start () from /lib/ld-linux.so.2
(gdb) info thread 
  1 Thread 1085896896 (LWP 6245)  0x4000d650 in _dl_debug_state () from \
/lib/ld-linux.so.2 (gdb) frame 0 
#0  0x4000d650 in _dl_debug_state () from /lib/ld-linux.so.2
----- snip -----

Here the application is stopped, but i didn't set any breakpoint. After a click on \
"Run" the application continues:

----- snip -----
(gdb) continue 
[Switching to Thread 1085896896 (LWP 6245)]
Stopped due to shared library event
(gdb) continue 
Stopped due to shared library event
(gdb) continue 
Stopped due to shared library event
(gdb) continue 
Stopped due to shared library event
(gdb) continue 
----- snip -----

I have no output, neither from a thread nor from the main function when i insert a \
qDebug statement.


The example code:
I created a qmake "hello world!" program, and changed the code in the main.cpp file \
to:

----- example -----
#include <qapplication.h>
#include <qthread.h>

class WaitThread : public QThread
{
public:
	virtual void run()
	{
		qDebug( "Thread started" );
		sleep( 10 );
		qDebug( "Thread done" );
		exit();
	}
};

int main(int argc, char *argv[])
{
	QApplication app( argc, argv );
	WaitThread* w = 0;

	for( int x = 0; x < 10; x++ )
	{
		w = new WaitThread();
		w->start();
	}

	app.exec();
}
----- example -----


A workaround: Set a breakpoint at the begin of the program. Wait until this \
breakpoint is reached. Then click on "Run" to start the program. A side effect in my \
example is: The threads aren't started after that. I have no clue why.

The threads aren't started on a plain "gdb" too. I'm using GDB version 6.2.1. When i \
start the theards "step-by-step" then all threads are started correct.

Any ideas about that?


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

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