malloc in gdb debug session returns inaccessible address after running some codes.
first break at the start of main function. everything is ok.
Breakpoint 9, main (argc=5, argv=0x7fffffffe418) at src/ose/sdv/ose_sdv/linux/main.c:557
557 char *cfgfile = NULL;
(gdb) call malloc(4)
$50 = 23293968
(gdb) x 23293968
0x1637010: 0x00000000
(gdb) c
after running some lines it begins to return inaccessible memory address which is start at 0xffffffff~
Program received signal SIGINT, Interrupt.0x00007ffff70c1f4d in read () from /lib64/libc.so.6
(gdb) call malloc(4)
$52 = -1811110576
(gdb) x -1811110576
0xffffffff940ca550: Cannot access memory at address 0xffffffff940ca550
i'm using a 64bit linux os.
i cannot find the exact line of code that causes this.
The line after which malloc begins to like this is always change.
No exception occurred during runtime and the program runs as expected. I am not sure what is wrong here.