created a new win2016 azure vm. just to do learning on c++. I get segmentation fault running any program, compiles ok. Ok next step is add ram then reinstall cygwin. This worked fine on a azure windows 11.
armadmin@compiler /usr/code
$ gdb a
GNU gdb (GDB) (Cygwin 13.2-1) 13.2
Copyright (C) 2023 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-pc-cygwin”.
Type “show configuration” for configuration details.
For bug reporting instructions, please see:
https://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 a…
(gdb) run
Starting program: /usr/code/a
[New Thread 7036.0xd18]
[New Thread 7036.0xda4]
Thread 1 “a” received signal SIGSEGV, Segmentation fault.
0x00000003fc049cd6 in cygstdc++-6!_ZNSo6sentryC1ERSo ()
from /usr/bin/cygstdc++-6.dll
(gdb) core filename
A program is being debugged already. Kill it? (y or n) n
Program not killed.
(gdb) next
Single stepping until exit from function cygstdc++-6!_ZNSo6sentryC1ERSo,
which has no line number information.
[New Thread 7036.0×1300]
0x00007ffe19e03d63 in KERNELBASE!DebugBreak ()
from /cygdrive/c/Windows/System32/KERNELBASE.dll
(gdb) next
Single stepping until exit from function KERNELBASE!DebugBreak,
which has no line number information.
0x00007ffdd6876307 in cygwin1!.assert () from /usr/bin/cygwin1.dll
(gdb) next
Single stepping until exit from function cygwin1!__assert,
which has no line number information.
0x00007ffdd688f42b in secure_getenv () from /usr/bin/cygwin1.dll
(gdb) next
Single stepping until exit from function secure_getenv,
which has no line number information.
0x00007ffe1cb1ab2d in ntdll!.chkstk ()
from /cygdrive/c/Windows/SYSTEM32/ntdll.dll
(gdb) next
Single stepping until exit from function ntdll!__chkstk,
which has no line number information.
0x00007ffe1caa49d3 in ntdll!RtlImageNtHeaderEx ()
from /cygdrive/c/Windows/SYSTEM32/ntdll.dll
(gdb) next
Single stepping until exit from function ntdll!RtlImageNtHeaderEx,
which has no line number information.
0x00007ffe1cb19c9a in ntdll!KiUserExceptionDispatcher ()
from /cygdrive/c/Windows/SYSTEM32/ntdll.dll
(gdb) next
Single stepping until exit from function ntdll!KiUserExceptionDispatcher,
which has no line number information.
Thread 1 “a” received signal SIGSEGV, Segmentation fault.
0x00000003fc049cd6 in cygstdc++-6!_ZNSo6sentryC1ERSo ()
from /usr/bin/cygstdc++-6.dll
(gdb) next
Single stepping until exit from function cygstdc++-6!_ZNSo6sentryC1ERSo,
which has no line number information.
Thread 1 “a” received signal SIGSEGV, Segmentation fault.
0x00000003fc049cd6 in cygstdc++-6!_ZNSo6sentryC1ERSo ()
from /usr/bin/cygstdc++-6.dll
(gdb) next
Single stepping until exit from function cygstdc++-6!_ZNSo6sentryC1ERSo,
which has no line number information.
Thread 1 “a” received signal SIGSEGV, Segmentation fault.
0x00000003fc049cd6 in cygstdc++-6!_ZNSo6sentryC1ERSo ()
from /usr/bin/cygstdc++-6.dll
(gdb) next
Single stepping until exit from function cygstdc++-6!_ZNSo6sentryC1ERSo,
which has no line number information.
Thread 1 “a” received signal SIGSEGV, Segmentation fault.
0x00000003fc049cd6 in cygstdc++-6!_ZNSo6sentryC1ERSo ()
from /usr/bin/cygstdc++-6.dll
(gdb) next
Single stepping until exit from function cygstdc++-6!_ZNSo6sentryC1ERSo,
which has no line number information.
Thread 1 “a” received signal SIGSEGV, Segmentation fault.
0x00000003fc049cd6 in cygstdc++-6!_ZNSo6sentryC1ERSo ()
from /usr/bin/cygstdc++-6.dll
(gdb) next
Single stepping until exit from function cygstdc++-6!_ZNSo6sentryC1ERSo,
which has no line number information.
Thread 1 “a” received signal SIGSEGV, Segmentation fault.
0x00000003fc049cd6 in cygstdc++-6!_ZNSo6sentryC1ERSo ()
from /usr/bin/cygstdc++-6.dll
(gdb) next
Single stepping until exit from function cygstdc++-6!_ZNSo6sentryC1ERSo,
which has no line number information.
Thread 1 “a” received signal SIGSEGV, Segmentation fault.
0x00000003fc049cd6 in cygstdc++-6!_ZNSo6sentryC1ERSo ()
from /usr/bin/cygstdc++-6.dll
(gdb)
*****
new host, new cygwin, more memory. now works fine
gdb supposed to look like this:
(gdb) run
Starting program: /usr/code/super
[New Thread 900.0×348]
[New Thread 900.0xb10]
[New Thread 900.0×914]
Hello
[Thread 900.0xfb4 exited with code 0]
[Thread 900.0xb10 exited with code 0]
[Thread 900.0×914 exited with code 0]
[Inferior 1 (process 900) exited normally]
(gdb)
Copyright 2025 Rod Deluhery