Author Topic: Finding Sigsev  (Read 219 times)

Offline spflanze

  • Multiple posting newcomer
  • *
  • Posts: 50
Finding Sigsev
« on: June 01, 2018, 06:05:28 am »
I have a Sigsev error that appears in a not always reproducible way. The stack trace:
Quote
#0 0x773d0ed6   ntdll!RtlCompactHeap() (C:\Windows\system32\ntdll.dll:??)
#1 0x762d00   ?? () (??:??)
#2 0x77441877   ntdll!RtlpNtEnumerateSubKey() (C:\Windows\system32\ntdll.dll:??)
#3 0x773fa8fe   ntdll!RtlUlonglongByteSwap() (C:\Windows\system32\ntdll.dll:??)
#4 0x820000   ?? () (??:??)
#5 0x773a2c45   ntdll!RtlQueryPerformanceCounter() (C:\Windows\system32\ntdll.dll:??)
#6 0x76ee98cd   msvcrt!free() (C:\Windows\syswow64\msvcrt.dll:??)
#7 0x820000   ?? () (??:??)
#8 0x6aee6262   wxRegionRefData::~wxRegionRefData() () (C:\wxWidgets-3.0.3\lib\gcc_dll\wxmsw30u_gcc_custom.dll:??)
#9 0x28e1f0   ?? () (??:??)
#10 0x6a3bfe27   wxWindow::MSWHandleMessage(long*, unsigned int, unsigned int, long) () (C:\wxWidgets-3.0.3\lib\gcc_dll\wxmsw30u_gcc_custom.dll:??)
#11 0x6a3a9ae0   wxWindow::MSWWindowProc(unsigned int, unsigned int, long) () (C:\wxWidgets-3.0.3\lib\gcc_dll\wxmsw30u_gcc_custom.dll:??)
 
This stack trace length of 11 is not long enough to show where in my program SigSev happened. Is there a way to lengthen this trace?

I have attempted to follow the instructions in this video to find where SigSev happened:
https://www.youtube.com/watch?v=bfWxAG1vUM4
Accordingly, I have in "Settings => Compiler => Selected compiler" set to "GNU GCC Compiler".
In the "Compiler Flags" tab I have "Produce debugging symbols [-g]" checked.

In "Settings => Compiler => Debugger" I have in the Default debugger's Argument field entered "-core".

I still do not see the line of code where the SigSev happens indicated. Is there anything more to be done? That is as far as I know to do to follow those directions in the video.

Stepping through the program does not seem to work. SigSev never seems to happen when I do that.

This is what I get in the Debugger tab:
Quote
[debug]> info locals
[debug]No symbol table info available.
[debug]>>>>>>cb_gdb:
[debug]> info args
[debug]No symbol table info available.
[debug]>>>>>>cb_gdb:
[debug]> bt 30
[debug]#0  0x77340ed6 in ntdll!RtlCompactHeap () from C:\Windows\system32\ntdll.dll
[debug]#1  0x02072d00 in ?? ()
[debug]#2  0x773b1877 in ntdll!RtlpNtEnumerateSubKey () from C:\Windows\system32\ntdll.dll
[debug]#3  0x7736a8fe in ntdll!RtlUlonglongByteSwap () from C:\Windows\system32\ntdll.dll
[debug]#4  0x00870000 in ?? ()
[debug]#5  0x77312c45 in ntdll!RtlQueryPerformanceCounter () from C:\Windows\system32\ntdll.dll
[debug]#6  0x751198cd in msvcrt!free () from C:\Windows\syswow64\msvcrt.dll
[debug]#7  0x00870000 in ?? ()
[debug]#8  0x6aee6262 in wxRegionRefData::~wxRegionRefData() () from C:\wxWidgets-3.0.3\lib\gcc_dll\wxmsw30u_gcc_custom.dll
[debug]#9  0x0028e1f0 in ?? ()
[debug]#10 0x6a3bfe27 in wxWindow::MSWHandleMessage(long*, unsigned int, unsigned int, long) () from C:\wxWidgets-3.0.3\lib\gcc_dll\wxmsw30u_gcc_custom.dll
[debug]#11 0x6a3a9ae0 in wxWindow::MSWWindowProc(unsigned int, unsigned int, long) () from C:\wxWidgets-3.0.3\lib\gcc_dll\wxmsw30u_gcc_custom.dll
[debug]>>>>>>cb_gdb:
[debug]> quit
[debug]error return ../../gdb-7.6.1/gdb/windows-nat.c:1275 was 5

Debugger finished with status 0

« Last Edit: June 02, 2018, 01:36:03 am by spflanze »

Offline BlueHazzard

  • Lives here!
  • ****
  • Posts: 1919
Re: Finding Sigsev
« Reply #1 on: June 03, 2018, 11:41:57 pm »
have you tried to rerun after sigseg?
Have you the possibility to run the prog in a linux environment? (valgrind is your friend)

Quote
Accordingly, I have in "Settings => Compiler => Selected compiler" set to "GNU GCC Compiler".
In the "Compiler Flags" tab I have "Produce debugging symbols [-g]" checked.
This is bad practice: Always set the compiler flags in Project->Build options->Select the target on the right-> Add the compiler setting in the compiler tab
Remember to make a rebuild after changing the compiler settings. If you are in doubt post a full rebuild log here

Quote
Stepping through the program does not seem to work. SigSev never seems to happen when I do that.
indication of non initialized variable or wrong loop, because you do not run the whole program at the step by step things, so place a break point in front of loops and check if the execute without error.