There is a segmentation fault error when I close the program. It looks like it fails at the point when destructor of main class calls delete ui;.
It doesn't really give more info which ui element could already be deleted, so what can you advise for troubleshooting in such case?
I'm using the latest, 4.7.3 version.
warning: HEAP[NESA.exe]:
warning: Invalid Address specified to RtlFreeHeap( 003E0000, 0022FE1C )
Program received signal SIGTRAP, Trace/breakpoint trap.
0x7c90120f in ntdll!DbgUiConnectToDbg () from C:\WINDOWS\system32\ntdll.dll
(gdb) backtrace
#0 0x7c90120f in ntdll!DbgUiConnectToDbg () from C:\WINDOWS\system32\ntdll.dll
#1 0x7c96ee31 in ntdll!RtlpNtMakeTemporaryKey () from C:\WINDOWS\system32\ntdll.dll
#2 0x7c96f26e in ntdll!RtlpNtMakeTemporaryKey () from C:\WINDOWS\system32\ntdll.dll
#3 0x7c970456 in ntdll!RtlpNtMakeTemporaryKey () from C:\WINDOWS\system32\ntdll.dll
#4 0x7c94bafc in ntdll!LdrFindEntryForAddress () from C:\WINDOWS\system32\ntdll.dll
#5 0x003e0000 in ?? ()
#6 0x7c91a1ba in ntdll!RtlpUnWaitCriticalSection () from C:\WINDOWS\system32\ntdll.dll
#7 0x77c2c2de in msvcrt!free () from C:\WINDOWS\system32\msvcrt.dll
#8 0x003e0000 in ?? ()
#9 0x6a2c1768 in ZN7QObject5eventEP6QEvent () from c:\Qt\Desktop\Qt\4.7.3\mingw\bin\QtCore4.dll
#10 0x6515961e in ZN7QWidget5eventEP6QEvent () from c:\Qt\Desktop\Qt\4.7.3\mingw\bin\QtGui4.dll
#11 0x654ab1c8 in ZN11QMainWindow5eventEP6QEvent () from c:\Qt\Desktop\Qt\4.7.3\mingw\bin\QtGui4.dll
#12 0x6510fa38 in ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent ()
from c:\Qt\Desktop\Qt\4.7.3\mingw\bin\QtGui4.dll
#13 0x65118382 in ZN12QApplication6notifyEP7QObjectP6QEvent () from c:\Qt\Desktop\Qt\4.7.3\mingw\bin\QtGui4.dll
#14 0x6a2b419c in ZN16QCoreApplication14notifyInternalEP7QObjectP6QEvent ()
from c:\Qt\Desktop\Qt\4.7.3\mingw\bin\QtCore4.dll
#15 0x6a2b6f8c in ZN23QCoreApplicationPrivate16sendPostedEventsEP7QObjectiP11QThreadData ()
from c:\Qt\Desktop\Qt\4.7.3\mingw\bin\QtCore4.dll
#16 0x6a2d6cee in ZN21QEventDispatcherWin3221registerEventNotifierEP17QWinEventNotifier ()
from c:\Qt\Desktop\Qt\4.7.3\mingw\bin\QtCore4.dll
#17 0x7e418734 in USER32!GetDC () from C:\WINDOWS\system32\user32.dll
#18 0x00000000 in ?? ()
warning: HEAP[NESA.exe]:
warning: Invalid Address specified to RtlFreeHeap( 003E0000, 0022FE1C )
Program received signal SIGTRAP, Trace/breakpoint trap.
0x7c90120f in ntdll!DbgUiConnectToDbg () from C:\WINDOWS\system32\ntdll.dll
(gdb) backtrace
#0 0x7c90120f in ntdll!DbgUiConnectToDbg () from C:\WINDOWS\system32\ntdll.dll
#1 0x7c96ee31 in ntdll!RtlpNtMakeTemporaryKey () from C:\WINDOWS\system32\ntdll.dll
#2 0x7c96f26e in ntdll!RtlpNtMakeTemporaryKey () from C:\WINDOWS\system32\ntdll.dll
#3 0x7c970456 in ntdll!RtlpNtMakeTemporaryKey () from C:\WINDOWS\system32\ntdll.dll
#4 0x7c94bafc in ntdll!LdrFindEntryForAddress () from C:\WINDOWS\system32\ntdll.dll
#5 0x003e0000 in ?? ()
#6 0x7c91a1ba in ntdll!RtlpUnWaitCriticalSection () from C:\WINDOWS\system32\ntdll.dll
#7 0x77c2c2de in msvcrt!free () from C:\WINDOWS\system32\msvcrt.dll
#8 0x003e0000 in ?? ()
#9 0x6a2c1768 in ZN7QObject5eventEP6QEvent () from c:\Qt\Desktop\Qt\4.7.3\mingw\bin\QtCore4.dll
#10 0x6515961e in ZN7QWidget5eventEP6QEvent () from c:\Qt\Desktop\Qt\4.7.3\mingw\bin\QtGui4.dll
#11 0x654ab1c8 in ZN11QMainWindow5eventEP6QEvent () from c:\Qt\Desktop\Qt\4.7.3\mingw\bin\QtGui4.dll
#12 0x6510fa38 in ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent ()
from c:\Qt\Desktop\Qt\4.7.3\mingw\bin\QtGui4.dll
#13 0x65118382 in ZN12QApplication6notifyEP7QObjectP6QEvent () from c:\Qt\Desktop\Qt\4.7.3\mingw\bin\QtGui4.dll
#14 0x6a2b419c in ZN16QCoreApplication14notifyInternalEP7QObjectP6QEvent ()
from c:\Qt\Desktop\Qt\4.7.3\mingw\bin\QtCore4.dll
#15 0x6a2b6f8c in ZN23QCoreApplicationPrivate16sendPostedEventsEP7QObjectiP11QThreadData ()
from c:\Qt\Desktop\Qt\4.7.3\mingw\bin\QtCore4.dll
#16 0x6a2d6cee in ZN21QEventDispatcherWin3221registerEventNotifierEP17QWinEventNotifier ()
from c:\Qt\Desktop\Qt\4.7.3\mingw\bin\QtCore4.dll
#17 0x7e418734 in USER32!GetDC () from C:\WINDOWS\system32\user32.dll
#18 0x00000000 in ?? ()
To copy to clipboard, switch view to plain text mode
Added after 18 minutes:
OK, I have started to comment out some new parts of the code, and it looks like I have accidentally called setAttribute(Qt::WA_DeleteOnClose, true); for my main class. So I started to find the reason of it with google and found out that the class should be created on the heap instead of stack. I thought that it could mean that I should have had to create an object of the class in main.cpp instead of declaring it as a fix variable, so I was going to try that. Voila! It worked (and of course, removing setAttribute(Qt::WA_DeleteOnClose, true); also works the vice-versa way).
I leave this thread here for future newbies .
Bookmarks