Busy process in Kubuntu while debugging

58 Views Asked by At

I am trying to write my first Linux application using Qt Creator. Sometimes, during debugging, I am writing code that causes my application to go in some kind of endless loop.

This causes my KDE session to freeze. It seems to be impossible to stop/pause the process using the debugger or by any other means. After some minutes the desktop session is terminated automatically which prevents restarting the entire PC.

So how can I debug a process that goes wild under Linux? Why does it block the entire desktop and Qt Creator IDE and how can I prevent this from happening?

1

There are 1 best solutions below

0
On

With this few informations, I would say QtCreator uses GDB and be sure that GDB do things well. Normally your application is in linux time-sharing scheduling and Ubuntu will stop your process after a period, this period is depends on capacity of your PC (memory, nbr cpu-core). Keep in mind that it is normal to freeze if your application start realtime threads and will use all the cores of your PC at 100%, but even if you are in this case, linux have reserved some µs to run other code (e.g. system code to kill it) thanks to /proc/sys/kernel/sched_rt_runtime_us...

If the behavior is similar to KUBUNTU bug, I advise you to see the system log files:

/var/log/syslog
~/.xsession-errors
/var/log/Xorg.0.log (for the current session)
/var/log/Xorg.0.log.old (for previous session)
/var/log/?dm.log (gdm for gnome, kdm for KDE)

Hope this will help you !