This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug gdb/17785] GDB ignores "disable-randomization" setting once its set to off once
- From: "xdje42 at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Sat, 03 Jan 2015 18:14:56 +0000
- Subject: [Bug gdb/17785] GDB ignores "disable-randomization" setting once its set to off once
- Auto-submitted: auto-generated
- References: <bug-17785-4717 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=17785
Doug Evans <xdje42 at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |xdje42 at gmail dot com
--- Comment #1 from Doug Evans <xdje42 at gmail dot com> ---
Repro instructions please.
Looking at the code (linux_nat_create_inferior) I see it doesn't protect itself
from an error thrown by to_create_inferior. Maybe to_create_inferior can't
throw an error (in which case no protection is needed) but that'd be a bit
fragile. OTOH, even if personality didn't get restored, the next time through
should turn on ADDR_NO_RANDOMIZE if disable_randomization is set.
Thus it's hard reason about this bug without reproduction instructions.
Got repro?
I tried the following, and could not reproduce the problem:
bash$ gdb hello.x64
...
(gdb) set confirm off
(gdb) show disable
Disabling randomization of debuggee's virtual address space is on.
(gdb) start
Temporary breakpoint 1 at 0x400764: file hello.cc, line 6.
Starting program: /home/dje/hello.x64
Temporary breakpoint 1, main () at hello.cc:6
6 std::cout << "hello\n";
(gdb) p $rsp
$1 = (void *) 0x7fffffffe1c0
(gdb) start
Temporary breakpoint 2 at 0x400764: file hello.cc, line 6.
Starting program: /home/dje/hello.x64
Temporary breakpoint 2, main () at hello.cc:6
6 std::cout << "hello\n";
(gdb) p $rsp
$2 = (void *) 0x7fffffffe1c0
(gdb) set disable off
(gdb) start
Temporary breakpoint 3 at 0x400764: file hello.cc, line 6.
Starting program: /home/dje/hello.x64
Temporary breakpoint 3, main () at hello.cc:6
6 std::cout << "hello\n";
(gdb) p $rsp
$3 = (void *) 0x7fffe7de8020
(gdb) start
Temporary breakpoint 4 at 0x400764: file hello.cc, line 6.
Starting program: /home/dje/hello.x64
Temporary breakpoint 4, main () at hello.cc:6
6 std::cout << "hello\n";
(gdb) p $rsp
$4 = (void *) 0x7fff2fbd7fe0
(gdb) set disable on
(gdb) start
Temporary breakpoint 5 at 0x400764: file hello.cc, line 6.
Starting program: /home/dje/hello.x64
Temporary breakpoint 5, main () at hello.cc:6
6 std::cout << "hello\n";
(gdb) p $rsp
$5 = (void *) 0x7fffffffe1c0
(gdb) start
Temporary breakpoint 6 at 0x400764: file hello.cc, line 6.
Starting program: /home/dje/hello.x64
Temporary breakpoint 6, main () at hello.cc:6
6 std::cout << "hello\n";
(gdb) p $rsp
$6 = (void *) 0x7fffffffe1c0
(gdb)
--
You are receiving this mail because:
You are on the CC list for the bug.