public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Luis Machado <luis.machado@arm.com>
To: Tom Tromey <tromey@adacore.com>
Cc: Tom Tromey via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH 0/3] Fix "attach" infinite loop
Date: Mon, 18 Dec 2023 11:33:48 +0000	[thread overview]
Message-ID: <4645db1f-0101-4880-acf7-7fea744889fe@arm.com> (raw)
In-Reply-To: <4f321ae7-f625-499d-9061-30c8d779c5d5@arm.com>

On 12/18/23 09:50, Luis Machado wrote:
> On 12/15/23 19:33, Tom Tromey wrote:
>> Luis> I'm getting the following on aarch64-linux Ubuntu 22.04:
>>
>> Luis> FAIL: gdb.threads/attach-many-short-lived-threads.exp: iter 1: break at break_fn: 1 (the program is no longer running)
>> Luis> FAIL: gdb.threads/attach-many-short-lived-threads.exp: iter 1: break at break_fn: 2 (the program is no longer running)
>> Luis> FAIL: gdb.threads/attach-many-short-lived-threads.exp: iter 1: break at break_fn: 3 (the program is no longer running)
>> Luis> FAIL: gdb.threads/attach-many-short-lived-threads.exp: iter 1: reset timer in the inferior
>> Luis> FAIL: gdb.threads/attach-many-short-lived-threads.exp: iter 1: detach (the program is no longer running)
>>
>> Tom> I was able to reproduce this, I'll take a look.
>>
>> Well, I can't reproduce this any more -- I managed to make it fail once,
>> when I wrote that email, but not again.  I wonder if this is one of the
>> intermittent failure tests?
>>
>> If it fails consistently for you, maybe sending the gdb.log would help.
>> Not sure though.
>>
>> Tom
> 
> Sure. Let me check what the current situation is.

The most important bit seems to be this fragment:

--

(gdb) file /binutils-gdb-arm64-focal/gdb/testsuite/outputs/gdb.threads/attach-many-short-lived-threads/attach-many-short-lived-threads^M
Reading symbols from /binutils-gdb-arm64-focal/gdb/testsuite/outputs/gdb.threads/attach-many-short-lived-threads/attach-many-short-lived-threads...
(gdb) builtin_spawn /binutils-gdb-arm64-focal/gdb/testsuite/outputs/gdb.threads/attach-many-short-lived-threads/attach-many-short-lived-threads
attach 1545611
Attaching to program: /binutils-gdb-arm64-focal/gdb/testsuite/outputs/gdb.threads/attach-many-short-lived-threads/attach-many-short-lived-threads, process 1545611
Cannot attach to lwp 1609323: Operation not permitted (1)
(gdb) PASS: gdb.threads/attach-many-short-lived-threads.exp: iter 1: attach     
info threads
No threads.
(gdb) PASS: gdb.threads/attach-many-short-lived-threads.exp: iter 1: no new threads
set breakpoint always-inserted on
(gdb) PASS: gdb.threads/attach-many-short-lived-threads.exp: iter 1: set breakpoint always-inserted on
break break_fn
Breakpoint 1 at 0xd64: file /binutils-gdb-arm64-focal/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.threads/attach-many-short-lived-threads.c, line 57.
(gdb) PASS: gdb.threads/attach-many-short-lived-threads.exp: iter 1: break break_fn
continue
The program is not being run.
(gdb) FAIL: gdb.threads/attach-many-short-lived-threads.exp: iter 1: break at break_fn: 1 (the program is no longer running)

--

We spawn the process and try to attach to it, but it (supposedly) fails. I see the test seems
to assume the attaching succeeded even though ptrace returned EPERM.

There seems to be some kernel-related issue here, as I see the failures for a 5.11-based
machine but don't see it for a 5.15-based one.

Are we missing XFAIL-ing the test when we see the ptrace attach failure?

  reply	other threads:[~2023-12-18 11:34 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-03 17:56 Tom Tromey
2023-10-03 17:56 ` [PATCH 1/3] Minor cleanup in linux_proc_attach_tgid_threads Tom Tromey
2023-10-04  1:29   ` Simon Marchi
2023-10-03 17:56 ` [PATCH 2/3] Use gdb_dir_up " Tom Tromey
2023-10-04  1:30   ` Simon Marchi
2023-10-03 17:56 ` [PATCH 3/3] Bail out of "attach" if a thread cannot be traced Tom Tromey
2023-10-04  1:29   ` Simon Marchi
2023-10-04 14:14     ` Tom Tromey
2023-10-04 17:38       ` Simon Marchi
2023-12-01 17:41 ` [PATCH 0/3] Fix "attach" infinite loop Tom Tromey
2023-12-04 14:25   ` Luis Machado
2023-12-05 19:27     ` Tom Tromey
2023-12-15 19:33       ` Tom Tromey
2023-12-18  9:50         ` Luis Machado
2023-12-18 11:33           ` Luis Machado [this message]
2023-12-18 14:30             ` Tom Tromey
2023-12-18 15:10               ` Luis Machado
2024-01-02 19:14                 ` Carl Love

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=4645db1f-0101-4880-acf7-7fea744889fe@arm.com \
    --to=luis.machado@arm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@adacore.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).