这个我试图调试的应用程序只有一个问题:我尝试设置首选项设置后崩溃了。对“首选项”进行任何更改,它会崩溃。手动运行它在崩溃时没有错误:
$ /usr/local/src/knet/knet
QPainter::begin: Paint device returned engine == 0, type: 2
QPainter::begin: Paint device returned engine == 0, type: 2
QPainter::begin: Paint device returned engine == 0, type: 2
QSystemTrayIcon::setVisible: No Icon set
$
当我用strace运行它时非常活跃,所以我无法在消息的泥沼中缩小原因。我真正拥有的唯一线索是在cmake编译期间出错:
[ 40%] Building CXX object CMakeFiles/knet.dir/knetconfig.o
/usr/local/src/knet/knetconfig.cpp:192:56: warning: unused parameter ‘configFile’ [-Wunused-parameter]
void KnetConfig::writeNameOfConfigFile( const QString& configFile )
这是knetconfig.cpp: http://pastebin.com/Su0PawFg
编辑:这似乎是我的失败点:
recvmsg(6, {msg_name(0)=NULL, msg_iov(1)=[{"\34\0\255\10J\0\300\v\213\1\0\0\271\233\271\16\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 576
poll([{fd=6, events=POLLIN}], 1, 4294967295) = 1 ([{fd=6, revents=POLLIN}])
recvmsg(6, {msg_name(0)=NULL, msg_iov(1)=[{"\1\1\274\10\0\0\0\0R\0\300\t\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 4096}], msg_controllen=0, msg_flags=0}, 0) = 32
recvmsg(6, 0x7fffc90cf1a0, 0) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=6, events=POLLIN|POLLOUT}], 1, 4294967295) = 1 ([{fd=6, revents=POLLOUT}])
writev(6, [{"O\7\2\0\1\0\300\v<\0\2\0\0\0\300\v+\1\1\0", 20}, {NULL, 0}, {"", 0}], 3) = 20
poll([{fd=6, events=POLLIN}], 1, 4294967295) = 1 ([{fd=6, revents=POLLIN}])
recvmsg(6, {msg_name(0)=NULL, msg_iov(1)=[{"\1\1\277\10\0\0\0\0R\0\300\t\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 4096}], msg_controllen=0, msg_flags=0}, 0) = 32
recvmsg(6, 0x7fffc90cf180, 0) = -1 EAGAIN (Resource temporarily unavailable)
recvmsg(6, 0x7fffc90cf180, 0) = -1 EAGAIN (Resource temporarily unavailable)
shutdown(6, SHUT_RDWR) = 0
close(6) = 0
write(8, "\1\v\1\0\1\0\0\0\0\0\0\0\0\0\0\0", 16) = 16
close(8) = 0
write(3, "\1\0\0\0\0\0\0\0", 8) = 8
open("/sys/devices/system/cpu/online", O_RDONLY|O_CLOEXEC) = 6
read(6, "0-7\n", 8192) = 4
close(6) = 0
write(3, "\1\0\0\0\0\0\0\0", 8) = 8
write(3, "\1\0\0\0\0\0\0\0", 8) = 8
sendmsg(7, {msg_name(0)=NULL, msg_iov(2)=[{"l\1\1\1D\0\0\0\v\0\0\0\177\0\0\0\1\1o\0\25\0\0\0/org/fre"..., 144}, {"?\0\0\0type='signal',interface='org"..., 68}], msg_controllen=0, msg_flags=0}, MSG_NOSIGNAL) = 212
msync(0x7f6624d95000, 10547304, MS_ASYNC|MS_INVALIDATE) = 0
munmap(0x7f6624d95000, 10547304) = 0
sendmsg(7, {msg_name(0)=NULL, msg_iov(2)=[{"l\1\1\1d\0\0\0\f\0\0\0\177\0\0\0\1\1o\0\25\0\0\0/org/fre"..., 144}, {"_\0\0\0type='signal',path='/KGlobal"..., 100}], msg_controllen=0, msg_flags=0}, MSG_NOSIGNAL) = 244
close(7) = 0
write(5, "@", 1) = 1
close(5) = 0
close(4) = 0
rt_sigaction(SIGCHLD, NULL, {0x7f6637867350, [], SA_RESTORER|SA_SIGINFO|SA_NOCLDSTOP, 0x7f6636b740f0}, 8) = 0
rt_sigaction(SIGCHLD, {SIG_DFL, [], SA_RESTORER, 0x7f6636b740f0}, NULL, 8) = 0
exit_group(0) = ?
+++ exited with 0 +++
~$
使用xtrace运行它,我右键单击并关闭,这很好,但是当我关闭它时,它崩溃了:
000:>:06b4: Event PropertyNotify(28) window=0x06a0004a atom=0x23("WM_HINTS") time=0x0311b0bd state=Deleted(0x01)
000:>:06b4: Event PropertyNotify(28) window=0x06a0004a atom=0x28("WM_NORMAL_HINTS") time=0x0311b0bd state=Deleted(0x01)
000:>:06b4: Event PropertyNotify(28) window=0x06a0004a atom=0x24("WM_CLIENT_MACHINE") time=0x0311b0bd state=Deleted(0x01)
000:>:06b4: Event PropertyNotify(28) window=0x06a0004a atom=0x22("WM_COMMAND") time=0x0311b0bd state=Deleted(0x01)
000:>:06b4:32: Reply to GetInputFocus: revert-to=PointerRoot(0x01) focus=0x02c00052
000:<:06b5: 8: Request(79): FreeColormap cmap=0x06a00001
000:<:06b6: 8: Request(60): FreeGC gc=0x06a00000
000:<:06b7: 4: Request(43): GetInputFocus
000:>:06b7:32: Reply to GetInputFocus: revert-to=PointerRoot(0x01) focus=0x02c00052
$
以下是我的所有来源:
CMakeLists.txt - https://pastee.org/bux2z
frames.cpp - https://pastee.org/25yys
frames.h - https://pastee.org/qx9n2
knet.cpp - https://pastee.org/zqrss
knet.h - https://pastee.org/p5eap
knetconfig.cpp - https://pastee.org/q3sjp
knetconfig.h - https://pastee.org/dv5ka
main.cpp - https://pastee.org/5jkzq
parser.cpp - https://pastee.org/e7s4z
parser.h - https://pastee.org/58rsc
prefsdialog.ui - https://pastee.org/7yyj
prefsdialogimpl.cpp - https://pastee.org/t4qc8
prefsdialogimpl.h - https://pastee.org/2f32c
resources.h - https://pastee.org/ttdpq
statsframe.cpp - https://pastee.org/vx5fu
statsframe.h - https://pastee.org/rm8s2
utils.cpp - https://pastee.org/y3sm6
utils.h - https://pastee.org/z8ra2