public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug testsuite/29726] [gdb] FAIL: gdb.server/connect-with-no-symbol-file.exp: sysroot=: action=delete: connection to GDBserver succeeded
Date: Thu, 27 Oct 2022 09:04:23 +0000	[thread overview]
Message-ID: <bug-29726-4717-hqfgwSl6RZ@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-29726-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=29726

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |luis.machado at arm dot com

--- Comment #5 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom de Vries from comment #0)
> This doesn't look like a gdb bug, but I have no idea yet what it could be.

I think I understand what's going on.

We're using remote_spawn instead of remote_exec to do chmod 000, and never wait
for it.

So, we know for sure that the chmod 000 has started, but we don't know when it
actually will have effect, which explains the failure I saw: it could have
lingered until after the copy that was supposed to restore the permission.

So, the non-intrusive way to fix this is to wait for the chmod 000 pid before
moving on to the next scenario.

OTOH, it's possible that using remote_spawn is a mistake, and remote_exec was
meant.

In the original submission (
https://sourceware.org/pipermail/gdb-patches/2016-February/131420.html ) we
had:
...
+if {[file exists $binfile]} {
+    system "chmod 000 $binfile"
+}
...
but after a review comment "Seems like this won't work with remote-host
testing?" it was changed to:
...
+       } elseif { $action == "permission" } {
+         remote_spawn target "chmod 000 $binfile"
+       }
...
which was committed.

Then there was a patch to fix behaviour with remote-gdbserver-on-localhost,
which would have gone with remote_exec:
...
+proc make_inaccessible { file } {
+    remote_exec host "chmod 000 $file"
+    remote_exec target "chmod 000 $file"
+}
...

Taking all this into account, I think the use of remote_spawn was a mistake.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2022-10-27  9:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-27  7:19 [Bug testsuite/29726] New: " vries at gcc dot gnu.org
2022-10-27  7:21 ` [Bug testsuite/29726] " vries at gcc dot gnu.org
2022-10-27  7:45 ` vries at gcc dot gnu.org
2022-10-27  8:17 ` vries at gcc dot gnu.org
2022-10-27  8:33 ` vries at gcc dot gnu.org
2022-10-27  9:04 ` vries at gcc dot gnu.org [this message]
2022-10-27  9:26 ` luis.machado at arm dot com
2022-10-27 14:56 ` [Bug testsuite/29726] [gdb/testsuite] " vries at gcc dot gnu.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-29726-4717-hqfgwSl6RZ@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).