You are not logged in.

#1 2014-10-20 22:11:06

Quantum
Member
Registered: 2013-07-13
Posts: 12

App Crashes When Setting Preferences

This app I'm trying to debug has only one problem: It crashes when I try to save any Preferences setting. Make any change to Preferences and OK, and it instantlycrashes. Run my app manually and it gives no error at the crash:

$ /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
$

cmake compile:

[ 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 )

This is knetconfig.cpp: http://pastebin.com/Su0PawFg

This seems to be my point of failure when trying to change a Preference:

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 +++
~$ 

Offline

#2 2014-10-22 22:17:00

Quantum
Member
Registered: 2013-07-13
Posts: 12

Re: App Crashes When Setting Preferences

I find that even when I right-click and About, then close About it crashes my app. How would I narrow this down?

Offline

#3 2014-10-23 16:13:03

Quantum
Member
Registered: 2013-07-13
Posts: 12

Re: App Crashes When Setting Preferences

Anyone here?

Offline

#4 2014-10-23 17:57:07

mrunion
Member
From: Jonesborough, TN
Registered: 2007-01-26
Posts: 1,938
Website

Re: App Crashes When Setting Preferences

1) Don't bump your own posts.
2) You might try linking ALL your source code to this thread. But FWIW, it sounds like you have a problem with a pointer -- referencing/dereferencing something that you think is there that is not, etc.


Matt

"It is very difficult to educate the educated."

Offline

#5 2014-10-23 19:32:04

Quantum
Member
Registered: 2013-07-13
Posts: 12

Re: App Crashes When Setting Preferences

Running it with xtrace, I right-click and About, which comes up fine, but when I Close that, it crashes thus:

000:>:06b4: Event PropertyNotify(28) window=0x06a00099 atom=0x15d("_NET_WM_USER_TIME") time=0x0311b0bd state=Deleted(0x01)
000:>:06b4: Event PropertyNotify(28) window=0x06a00099 atom=0x44("WM_TRANSIENT_FOR") time=0x0311b0bd state=Deleted(0x01)
000:>:06b4: Event PropertyNotify(28) window=0x06a00099 atom=0x1e6("_QTCURVE_OPACITY_") time=0x0311b0bd state=Deleted(0x01)
000:>:06b4: Event PropertyNotify(28) window=0x06a00099 atom=0x1e5("_QTCURVE_BGND_") time=0x0311b0bd state=Deleted(0x01)
000:>:06b4: Event PropertyNotify(28) window=0x06a00099 atom=0x1b0("_NET_STARTUP_ID") time=0x0311b0bd state=Deleted(0x01)
000:>:06b4: Event PropertyNotify(28) window=0x06a00099 atom=0x151("_NET_WM_ICON") time=0x0311b0bd state=Deleted(0x01)
000:>:06b4: Event PropertyNotify(28) window=0x06a00099 atom=0x183("XdndAware") time=0x0311b0bd state=Deleted(0x01)
000:>:06b4: Event PropertyNotify(28) window=0x06a00099 atom=0x18b("_MOTIF_DRAG_RECEIVER_INFO") time=0x0311b0bd state=Deleted(0x01)
000:>:06b4: Event PropertyNotify(28) window=0x06a00099 atom=0x14f("_NET_WM_NAME") time=0x0311b0bd state=Deleted(0x01)
000:>:06b4: Event PropertyNotify(28) window=0x06a00099 atom=0x134("WM_CLIENT_LEADER") time=0x0311b0bd state=Deleted(0x01)
000:>:06b4: Event PropertyNotify(28) window=0x06a00099 atom=0x152("_NET_WM_PID") time=0x0311b0bd state=Deleted(0x01)
000:>:06b4: Event PropertyNotify(28) window=0x06a00099 atom=0x160("_NET_WM_WINDOW_TYPE") time=0x0311b0bd state=Deleted(0x01)
000:>:06b4: Event PropertyNotify(28) window=0x06a00099 atom=0x145("_MOTIF_WM_HINTS") time=0x0311b0bd state=Deleted(0x01)
000:>:06b4: Event PropertyNotify(28) window=0x06a00099 atom=0x12b("WM_PROTOCOLS") time=0x0311b0bd state=Deleted(0x01)
000:>:06b4: Event PropertyNotify(28) window=0x06a00099 atom=0x27("WM_NAME") time=0x0311b0bd state=Deleted(0x01)
000:>:06b4: Event PropertyNotify(28) window=0x06a00099 atom=0x128("WM_LOCALE_NAME") time=0x0311b0bd state=Deleted(0x01)
000:>:06b4: Event PropertyNotify(28) window=0x06a00099 atom=0x43("WM_CLASS") time=0x0311b0bd state=Deleted(0x01)
000:>:06b4: Event PropertyNotify(28) window=0x06a00099 atom=0x23("WM_HINTS") time=0x0311b0bd state=Deleted(0x01)
000:>:06b4: Event PropertyNotify(28) window=0x06a00099 atom=0x28("WM_NORMAL_HINTS") time=0x0311b0bd state=Deleted(0x01)
000:>:06b4: Event PropertyNotify(28) window=0x06a00099 atom=0x24("WM_CLIENT_MACHINE") time=0x0311b0bd state=Deleted(0x01)
000:>:06b4: Event PropertyNotify(28) window=0x06a00099 atom=0x22("WM_COMMAND") time=0x0311b0bd state=Deleted(0x01)
000:>:06b4: Event PropertyNotify(28) window=0x06a0004a atom=0x18b("_MOTIF_DRAG_RECEIVER_INFO") time=0x0311b0bd state=NewValue(0x00)
000:>:06b4: Event DestroyNotify(17) event=0x06a0004a window=0x06a0004a
000:>:06b4: Event PropertyNotify(28) window=0x06a0004a atom=0x151("_NET_WM_ICON") time=0x0311b0bd state=Deleted(0x01)
000:>:06b4: Event PropertyNotify(28) window=0x06a0004a atom=0x183("XdndAware") time=0x0311b0bd state=Deleted(0x01)
000:>:06b4: Event PropertyNotify(28) window=0x06a0004a atom=0x18b("_MOTIF_DRAG_RECEIVER_INFO") time=0x0311b0bd state=Deleted(0x01)
000:>:06b4: Event PropertyNotify(28) window=0x06a0004a atom=0x134("WM_CLIENT_LEADER") time=0x0311b0bd state=Deleted(0x01)
000:>:06b4: Event PropertyNotify(28) window=0x06a0004a atom=0x1cf(unrecognized atom) time=0x0311b0bd state=Deleted(0x01)
000:>:06b4: Event PropertyNotify(28) window=0x06a0004a atom=0x152("_NET_WM_PID") time=0x0311b0bd state=Deleted(0x01)
000:>:06b4: Event PropertyNotify(28) window=0x06a0004a atom=0x160("_NET_WM_WINDOW_TYPE") time=0x0311b0bd state=Deleted(0x01)
000:>:06b4: Event PropertyNotify(28) window=0x06a0004a atom=0x145("_MOTIF_WM_HINTS") time=0x0311b0bd state=Deleted(0x01)
000:>:06b4: Event PropertyNotify(28) window=0x06a0004a atom=0x12b("WM_PROTOCOLS") time=0x0311b0bd state=Deleted(0x01)
000:>:06b4: Event PropertyNotify(28) window=0x06a0004a atom=0x27("WM_NAME") time=0x0311b0bd state=Deleted(0x01)
000:>:06b4: Event PropertyNotify(28) window=0x06a0004a atom=0x128("WM_LOCALE_NAME") time=0x0311b0bd state=Deleted(0x01)
000:>:06b4: Event PropertyNotify(28) window=0x06a0004a atom=0x43("WM_CLASS") time=0x0311b0bd state=Deleted(0x01)
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
$ 

No idea where to look.

I'm in the process of posting my source.

Offline

#6 2014-10-23 19:51:09

Quantum
Member
Registered: 2013-07-13
Posts: 12

Re: App Crashes When Setting Preferences

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

Last edited by Quantum (2014-10-23 19:55:18)

Offline

#7 2014-10-23 23:28:54

cmtptr
Member
Registered: 2008-09-01
Posts: 135

Re: App Crashes When Setting Preferences

Compile it with debug symbols and run it in gdb.  It will tell you exactly where and why it crashed.

Offline

#8 2014-10-25 17:26:24

Quantum
Member
Registered: 2013-07-13
Posts: 12

Re: App Crashes When Setting Preferences

Thanks, I thought so too, but when I run, right-click the app and About the About comes up, but when I hit Close it crashes like this:

/usr/local/src/knetbuild# gdb knet
GNU gdb (Debian 7.7.1+dfsg-3) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from knet...done.
(gdb) run
Starting program: /usr/local/src/knetbuild/knet 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
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
[Inferior 1 (process 24933) exited normally]
(gdb) bt
No stack.
(gdb) 

The app definitely crashes when I hit close.  And "no stack"?  Could the problem with gdb be that I'm using cmake?

Offline

#9 2014-10-25 20:47:41

cmtptr
Member
Registered: 2008-09-01
Posts: 135

Re: App Crashes When Setting Preferences

No.  I'm starting to wonder what you mean by "it crashes."  To me, it looks like your program simply exits.

Might be time to start employing good old-fashioned printf debugging.  It's a good skill to learn to use effectively.

Last edited by cmtptr (2014-10-25 20:48:31)

Offline

Board footer

Powered by FluxBB