Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@ericsson.com>
To: <gdb-patches@sourceware.org>
Cc: Simon Marchi <simon.marchi@ericsson.com>
Subject: [PATCH] Restore behavior of disabling address randomization by default on GDBserver
Date: Wed, 22 Aug 2018 16:06:00 -0000	[thread overview]
Message-ID: <1534953958-13064-1-git-send-email-simon.marchi@ericsson.com> (raw)

Commit

  c12a508 ("Add client_state struct.")

inadvertently changed the default behavior of GDBserver wrt address
randomization.  The old disable_randomization global variable was
initialized to 1, whereas the corresponding field in the client_state
structure is initialized to 0.

This fixes

  make check TESTS="gdb.base/jit-simple.exp" RUNTESTFLAGS="--target_board=native-gdbserver"
  make check TESTS="gdb.base/execl-update-breakpoints.exp" RUNTESTFLAGS="--target_board=native-gdbserver"

Note that the execl-update-breakpoints.exp would only fail on systems
where the toolchain emits position-independent executables by default
(otherwise the main executable position is never randomized, so the
value of disable_randomization didn't matter).

gdb/gdbserver/ChangeLog:

	PR gdb/23374
	PR gdb/23375
	* server.h (struct client_state) <disable_randomization>:
	Initialize to 1.

diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h index
8e197ee..5e41e2f 100644 --- a/gdb/gdbserver/server.h +++
b/gdb/gdbserver/server.h @@ -176,7 +176,7 @@ struct client_state

   /* Whether we should attempt to disable the operating system's address
      space randomization feature before starting an inferior.  */
-  int disable_randomization = 0;
+  int disable_randomization = 1;

   int pass_signals[GDB_SIGNAL_LAST];
   int program_signals[GDB_SIGNAL_LAST];
---
 gdb/gdbserver/server.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h
index 8e197ee..5e41e2f 100644
--- a/gdb/gdbserver/server.h
+++ b/gdb/gdbserver/server.h
@@ -176,7 +176,7 @@ struct client_state
 
   /* Whether we should attempt to disable the operating system's address
      space randomization feature before starting an inferior.  */
-  int disable_randomization = 0;
+  int disable_randomization = 1;
 
   int pass_signals[GDB_SIGNAL_LAST];
   int program_signals[GDB_SIGNAL_LAST];
-- 
2.7.4


             reply	other threads:[~2018-08-22 16:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-22 16:06 Simon Marchi [this message]
2018-08-22 16:14 ` Pedro Alves
2018-08-22 17:38   ` Simon Marchi
2018-08-26  9:51     ` Joel Brobecker
2018-08-26 15:01       ` Simon Marchi

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=1534953958-13064-1-git-send-email-simon.marchi@ericsson.com \
    --to=simon.marchi@ericsson.com \
    --cc=gdb-patches@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