Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: jan.kratochvil@redhat.com (Jan Kratochvil)
Cc: gdb-patches@sourceware.org, patches@linaro.org
Subject: Re: [rfc, gdbserver] Disable address space randomization
Date: Fri, 30 Sep 2011 15:08:00 -0000	[thread overview]
Message-ID: <201109301317.p8UDH8s5023472@d06av02.portsmouth.uk.ibm.com> (raw)
In-Reply-To: <20110929175714.GA18394@host1.jankratochvil.net> from "Jan Kratochvil" at Sep 29, 2011 07:57:14 PM

Jan Kratochvil wrote:
> On Wed, 21 Sep 2011 18:23:34 +0200, Ulrich Weigand wrote:
> > At this point this happens unconditionally, whenever the kernel
> > supports the personality system call.  If necessary, it would
> > be possible to make this configurable by adding a command line
> > argument to gdbserver ...
> 
> I do not find too great it cannot be disabled.  This makes inferior problems
> reproducibility worse.  There should be command-line option for legacy and/or
> remote command for extended mode but that is obvious.
> 
> Still it is probably better even unconditionally.

Well, I can certainly add a command-line option.  What would you say to e.g.
   --no-disable-randomization
(and possibly also --disable-randomization for completeness)?  I would still
think gdbserver ought to default to disabling randomization, just like GDB.

As to the remote command for extended mode, I'm not completely sure what
the best way to trigger that from within GDB should be.  Should we promote
"set disable-randomization" from being a Linux-specific command to the
generic level, and have its value passed to the target by remote.c?

As to the protocol level, maybe we should extend vRun to take flags
parameters, and make disable-randomization one of them?  Or else a new
QDisableRandomization packet that affects all subsequent vRun commands?
There doesn't appear to be a lot of precedence regarding such flags in
the remote protocol; I'd appreciate suggestions how to make this flexible
for future extensions ...

> > Tested on i386-linux.  Fixes a couple of test failures on Ubuntu.
> 
> I guess it has PIE by default?  I am aware some PIE corner cases need more
> fixes (and Fedora contains some more PIE patches even formerly posted but
> those patches are not well made).

I don't think PIE is related.  One failure fixed by the patch is this:

FAIL: gdb.mi/mi-var-cmd.exp: in-and-out-of-scope: in scope now

This test always fails with randomization since it assumes two runs of
the application stopping at the same place will lead to identical stack
frame IDs.  This is of course wrong if address space randomization
affects the stack ...

I seem to recall a second failure that was fixed, but I lost the logs
and cannot reproduce the effect now ... this may have just been some
transient failure, sorry.

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


  reply	other threads:[~2011-09-30 13:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-21 16:56 Ulrich Weigand
2011-09-29 18:12 ` Jan Kratochvil
2011-09-30 15:08   ` Ulrich Weigand [this message]
2011-09-30 19:32     ` Pedro Alves
2011-10-05 18:33       ` [rfc v2, rfa-doc] Disable address space randomization with remote targets Ulrich Weigand
2011-10-05 18:44         ` Eli Zaretskii
2011-10-07 12:08           ` Ulrich Weigand
2011-10-05 20:10         ` Tom Tromey
2011-10-06 13:25         ` Pedro Alves
2011-10-07 12:15           ` Ulrich Weigand

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=201109301317.p8UDH8s5023472@d06av02.portsmouth.uk.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=patches@linaro.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