public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Simon Marchi <simon.marchi@ericsson.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Restore behavior of disabling address randomization by default on GDBserver
Date: Wed, 22 Aug 2018 16:14:00 -0000	[thread overview]
Message-ID: <1ad11ede-9a61-5ead-921a-bf2c1c1a6358@redhat.com> (raw)
In-Reply-To: <1534953958-13064-1-git-send-email-simon.marchi@ericsson.com>

On 08/22/2018 05:05 PM, Simon Marchi wrote:
> 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).

Thanks for fixing this!

This is OK, but please double-check the patch/commit, since it
seems to include the same hunk twice.  Kind of looks like
the fix diff made it to the commit log?

> 
> 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];
> 
Thanks,
Pedro Alves

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

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-22 16:06 Simon Marchi
2018-08-22 16:14 ` Pedro Alves [this message]
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=1ad11ede-9a61-5ead-921a-bf2c1c1a6358@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@ericsson.com \
    /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).