public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "xdje42 at gmail dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug gdb/17785] GDB ignores "disable-randomization" setting once its set to off once
Date: Sat, 03 Jan 2015 18:14:00 -0000	[thread overview]
Message-ID: <bug-17785-4717-trVZAs0hsQ@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-17785-4717@http.sourceware.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.


  reply	other threads:[~2015-01-03 18:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-03 15:34 [Bug gdb/17785] New: " dman79 at gmail dot com
2015-01-03 18:14 ` xdje42 at gmail dot com [this message]
2015-01-05  7:22 ` [Bug gdb/17785] " dman79 at gmail dot com
2015-01-05 17:13 ` xdje42 at gmail dot com
2022-03-06 17:49 ` tromey at sourceware dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-17785-4717-trVZAs0hsQ@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).