Memory Randomization in Linux
By default, gdb disables address space randomization on Linux, overriding whatever value the kernel.randomize_va_space
sysctl variable may have.
The gdb command set disable-randomization off
will turn this feature off, and any debugging targets created by gdb afterwards will have ASLR either on or off depending on the value of kernel.randomize_va_space
.