今天多线程服务器端程序使用Qt基本构架已经完成,在调试调试过程中,发现很多警告:
compile output显示:
&"warning: GDB: Failed to set controlling terminal: /346/227/240/346/225/210/347/232/204/345/217/202/346/225/260/n"
.dynamic section for "/usr/lib/libfreetype.so.6" is not at the expected address
difference appears to be caused by prelink, adjusting expectations
.dynamic section for "/lib/libgobject-2.0.so.0" is not at the expected address
difference appears to be caused by prelink, adjusting expectations
.dynamic section for "/usr/lib/libSM.so.6" is not at the expected address
difference appears to be caused by prelink, adjusting expectations
.dynamic section for "/usr/lib/libICE.so.6" is not at the expected address
difference appears to be caused by prelink, adjusting expectations
.dynamic section for "/usr/lib/libXrender.so.1" is not at the expected address
difference appears to be caused by prelink, adjusting expectations
.dynamic section for "/usr/lib/libXext.so.6" is not at the expected address
difference appears to be caused by prelink, adjusting expectations
.dynamic section for "/usr/lib/libX11.so.6" is not at the expected address
difference appears to be caused by prelink, adjusting expectations
由于反复调试,发现这个警告并不是程序本身引起的,关于GDB在设置控制终端时造成的,完全是由于调试器引起的,尽管我目前使用的是linux操作系统,但是我使用qtCreator集成开发环境,因为我比较懒,linux上使用命令行调试效率太低,但是qtcreator使用的调试器依然是GDB,只不过对于我们程序员来说可视化而已,因为我目前用的是feodra12,所以我估计这个与系统版本有关系,网上有人遇到类似问题:
With the current CVS version, if the user specifies a different terminal
for the inferior to run on, GDB doesn't set it as the inferior's
controlling terminal.
This leads to some problems. For instance, the inferior will not
get SIGINT sent to the terminal. Also, if the inferior is GDB itself,
the following message is shown in the inferior GDB's debugging session:
[tcsetpgrp failed in terminal_inferior: Inappropriate ioctl for device]
The attached patch makes GDB set the inferior's controlling terminal,
fixing both of the symptoms above. If the user specifies a different
inferior terminal, GDB will now create a new session right after forking
to run the inferior, and use the TIOCSCTTY ioctl to set the controlling
terminal.
基于这种情况,我觉得升级系统也许是明智之举,yum -y update,升级后发现问题不再出现,所以我认为fedora12 在刚刚发布的更新包中,
已经认识到这个bug。