陳 力*_*陳 力 17 c linux gdb libc aslr
Breakpoint 1, 0x00007ffff7de8060 in __libc_start_main () from /usr/lib/libc.so.6
(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /home/firstlove/projects/org-ioslide/example/a.out
Breakpoint 1, 0x00007ffff7de8060 in __libc_start_main () from /usr/lib/libc.so.6
(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /home/firstlove/projects/org-ioslide/example/a.out
Breakpoint 1, 0x00007ffff7de8060 in __libc_start_main () from /usr/lib/libc.so.6
(gdb) Quit
(gdb) quit
A debugging session is active.
Inferior 1 [process 16372] will be killed.
Quit anyway? (y or n) y
firstlove-pc% cat /proc/sys/kernel/randomize_va_space
2
Run Code Online (Sandbox Code Playgroud)
IIUC,ASLR应该随机分配所有地址,包括其中之一libc.so
,但我发现地址__libc_start_main()
总是0x00007ffff7de8060
在我的Linux机器上,为什么?怎么了?
Mar*_*lli 26
当您在 中运行程序时gdb
,会gdb
尝试通过禁用地址随机化来帮助您进行调试。您可以使用以下命令启用它(从程序的下一次运行开始生效):
set disable-randomization off
Run Code Online (Sandbox Code Playgroud)