Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Philippe Waroquiers <philippe.waroquiers@skynet.be>
To: Pedro Alves <palves@redhat.com>,
	"Metzger, Markus T" <markus.t.metzger@intel.com>,
	GDB <gdb@sourceware.org>
Subject: Re: exec-file-mismatch and native-gdbserver testing
Date: Sun, 17 May 2020 20:15:30 +0200	[thread overview]
Message-ID: <d9b8d60b89f850aa992d595913b2bd3c20cd6678.camel@skynet.be> (raw)
In-Reply-To: <af939e9d-1ef4-28e1-17da-65d36a89433b@redhat.com>

On Sun, 2020-05-17 at 18:47 +0100, Pedro Alves wrote:
> On 5/17/20 6:24 AM, Philippe Waroquiers via Gdb wrote:
> > For some specific scenarios, it might have an impact,
> > such as the user wanting to debug a copy of the file to avoid
> > 'Text file busy', maybe some interaction with setuid/setgid, ... ?
> 
> These seem like rarer scenarios, which would cause warnings/errors
> anyway if you pick the wrong executable?

For sure, these scenarios are unusual, but it might be better
that the user knows what happens.  GDB silently deciding to use
another (physical) file than what the process really executes
is maybe not ideal.

E.g. I am wondering if the below will be visible and cause
an (understandable) warning/error/behaviour for the user:
If the user has debugged a first process with orig_exe,
then the user copied orig_exe to copy_orig_exe, and then GDB is
attached to a process that runs copy_orig_exe, the user does not expect
to have orig_exe protected/accessed anymore, and so might change it
or remove it or ..., while GDB still use orig_exe instead of copy_orig_exe.

So, I was wondering if such a case of equal build ID
but different (local?) file names are not worth a warning.

> 
> I'm thinking, if we support build ID validation, do we really want
> to fallback to filename validation?  It seems to me that it causes
> more false positives than desirable.
You mean that the filename comparison is useless (or even harmful)
if we found the build ID in the files ?
Effectively, if build ID are different but filenames are equal,
that is likely a false positive 'file are matching'
(only possible in remote debugging setup I suppose).

Philippe




  reply	other threads:[~2020-05-17 18:15 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-08 14:02 Metzger, Markus T
2020-04-08 20:54 ` Philippe Waroquiers
2020-04-09  6:30   ` Metzger, Markus T
2020-05-08 10:30     ` Metzger, Markus T
2020-05-08 21:25       ` Philippe Waroquiers
2020-05-16 20:10 ` Pedro Alves
2020-05-17  5:24   ` Philippe Waroquiers
2020-05-17 17:47     ` Pedro Alves
2020-05-17 18:15       ` Philippe Waroquiers [this message]
2020-05-17 19:50         ` Pedro Alves
2020-05-17 20:11           ` Philippe Waroquiers
2020-05-17 21:19             ` Pedro Alves
2020-05-17 21:43               ` Philippe Waroquiers
2020-05-17 21:58                 ` Pedro Alves
2020-05-18 10:35                   ` Philippe Waroquiers
2020-05-18 14:05                     ` Pedro Alves

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=d9b8d60b89f850aa992d595913b2bd3c20cd6678.camel@skynet.be \
    --to=philippe.waroquiers@skynet.be \
    --cc=gdb@sourceware.org \
    --cc=markus.t.metzger@intel.com \
    --cc=palves@redhat.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