简体   繁体   English

调试时在Kubuntu中忙碌的过程

[英]Busy process in Kubuntu while debugging

I am trying to write my first Linux application using Qt Creator. 我正在尝试使用Qt Creator编写我的第一个Linux应用程序。 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. 这导致我的KDE会话冻结。 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. 几分钟后,桌面会话将自动终止,这将阻止重新启动整个PC。

So how can I debug a process that goes wild under Linux? 那么,如何调试在Linux下疯狂的进程呢? Why does it block the entire desktop and Qt Creator IDE and how can I prevent this from happening? 为什么它会阻止整个桌面和Qt Creator IDE,如何防止这种情况发生?

With this few informations, I would say QtCreator uses GDB and be sure that GDB do things well. 有了这些信息,我想说QtCreator使用GDB并确保GDB做得很好。 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). 通常,您的应用程序处于Linux分时调度中,Ubuntu将在一段时间后停止您的进程,该时间取决于您PC的容量(内存,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 (eg system code to kill it) thanks to /proc/sys/kernel/sched_rt_runtime_us... 请记住,如果您的应用程序启动实时线程并且将以100%使用PC的所有内核,则冻结是正常的,但是即使在这种情况下,Linux也会保留一些µs来运行其他代码(例如,系统代码)杀死它)多亏了/ proc / sys / kernel / sched_rt_runtime_us ...

If the behavior is similar to KUBUNTU bug, I advise you to see the system log files: 如果该行为类似于KUBUNTU错误,建议您查看系统日志文件:

/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 ! 希望这个能对您有所帮助 !

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM