How to solve SIGSEGV fault error?

Greetings all,

I have problems with a program, which builds successfully (0 errors/warnings), but crashes on running. GDB (Gnu Debugger) and then bt (backtrace) produces this output:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
[New Thread 3900.0x538]

Program received signal SIGSEGV, Segmentation fault.
0x777ec159 in ntdll!RtlDecodeSystemPointer ()
   from C:\Windows\SysWOW64\ntdll.dll
(gdb)


(gdb) bt
#0  0x777e3c28 in ntdll!RtlQueryPerformanceCounter ()
   from C:\Windows\SysWOW64\ntdll.dll
#1  0x00000028 in ?? ()
#2  0x00870000 in ?? ()
#3  0x777ec1ed in ntdll!RtlDecodeSystemPointer ()
   from C:\Windows\SysWOW64\ntdll.dll
#4  0x777ec13e in ntdll!RtlDecodeSystemPointer ()
   from C:\Windows\SysWOW64\ntdll.dll
#5  0x777e3541 in ntdll!RtlQueryPerformanceCounter ()
   from C:\Windows\SysWOW64\ntdll.dll
#6  0x00000010 in ?? ()
#7  0x00000028 in ?? ()
#8  0x008700c4 in ?? ()
#9  0x77881dd3 in ntdll!RtlpNtEnumerateSubKey ()
   from C:\Windows\SysWOW64\ntdll.dll
#10 0x7783b586 in ntdll!RtlUlonglongByteSwap ()
   from C:\Windows\SysWOW64\ntdll.dll
#11 0x00870000 in ?? ()
#12 0x777e3541 in ntdll!RtlQueryPerformanceCounter ()
   from C:\Windows\SysWOW64\ntdll.dll
#13 0x00000010 in ?? ()
#14 0x00000000 in ?? ()
(gdb)


How can I find the cause for this error and solve it?

cheers T
Last edited on
Are you able to reproduce the problem?

If so you should place debug outputs in your code, so that you get closer to the problem and where it crashes.

This looks like a corrupt stack which would hint to an out of bounds access/write.
Thank you for your response. Yes, sorry for being short in my problem description.
This is the original code with main(): https://sourceforge.net/p/libosmscout/code/ci/master/tree/Demos/src/DrawMapCairo.cpp

The line where the problem starts is this:

 
osmscout::DatabaseRef database(new osmscout::Database(databaseParameter)); 


It is first time "new" appears in code, so it seems first time program gets to handle memory, it turns into a problem. But same code compiled with a makefile works just fine. When I try to build it in CodeBlocks IDE (msys2 mingw32) this problem occurs.
Topic archived. No new replies allowed.