Suppose there is a certain ./a.out (obtained from C), which displays the address returned by the first malloc (of course, the same actions are always performed on the way to it).
With each launch, we see different numbers
- This is a feature of Linux (it can also be implemented on other systems) to run the program so that the stack, heap and area for mapping files are located at random addresses).
But if you look in gdb or run this ./a.out in valgrind, you will see the same address.
The question is how to run (without apt-get install valgrind) ./a.out so that the print address is always the same?