public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/31238] New: FAIL: gdb.python/py-inferior.exp: test repr of an invalid thread
@ 2024-01-12 14:35 vries at gcc dot gnu.org
  2024-01-12 14:35 ` [Bug gdb/31238] " vries at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2024-01-12 14:35 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 31238
           Summary: FAIL: gdb.python/py-inferior.exp: test repr of an
                    invalid thread
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

On aarch64-linux fedora 39, I run into:
...
(gdb) PASS: gdb.python/py-inferior.exp: continue to breakpoint: cont to Break
here.
python print(last_thread)^M
<gdb.InferiorThread id=1.1 target-id="Thread 0xfffff7fb4020 (LWP 962837)">^M
(gdb) FAIL: gdb.python/py-inferior.exp: test repr of an invalid thread
...

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug gdb/31238] FAIL: gdb.python/py-inferior.exp: test repr of an invalid thread
  2024-01-12 14:35 [Bug gdb/31238] New: FAIL: gdb.python/py-inferior.exp: test repr of an invalid thread vries at gcc dot gnu.org
@ 2024-01-12 14:35 ` vries at gcc dot gnu.org
  2024-01-12 14:36 ` vries at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2024-01-12 14:35 UTC (permalink / raw)
  To: gdb-prs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aburgess at redhat dot com

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug gdb/31238] FAIL: gdb.python/py-inferior.exp: test repr of an invalid thread
  2024-01-12 14:35 [Bug gdb/31238] New: FAIL: gdb.python/py-inferior.exp: test repr of an invalid thread vries at gcc dot gnu.org
  2024-01-12 14:35 ` [Bug gdb/31238] " vries at gcc dot gnu.org
@ 2024-01-12 14:36 ` vries at gcc dot gnu.org
  2024-01-12 14:53 ` vries at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2024-01-12 14:36 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
Created attachment 15296
  --> https://sourceware.org/bugzilla/attachment.cgi?id=15296&action=edit
gdb.log

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug gdb/31238] FAIL: gdb.python/py-inferior.exp: test repr of an invalid thread
  2024-01-12 14:35 [Bug gdb/31238] New: FAIL: gdb.python/py-inferior.exp: test repr of an invalid thread vries at gcc dot gnu.org
  2024-01-12 14:35 ` [Bug gdb/31238] " vries at gcc dot gnu.org
  2024-01-12 14:36 ` vries at gcc dot gnu.org
@ 2024-01-12 14:53 ` vries at gcc dot gnu.org
  2024-01-12 16:19 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2024-01-12 14:53 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom de Vries from comment #0)
> On aarch64-linux fedora 39, I run into:

Also fails for me on x86_64-linux openSUSE Leap 15.4.

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug gdb/31238] FAIL: gdb.python/py-inferior.exp: test repr of an invalid thread
  2024-01-12 14:35 [Bug gdb/31238] New: FAIL: gdb.python/py-inferior.exp: test repr of an invalid thread vries at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2024-01-12 14:53 ` vries at gcc dot gnu.org
@ 2024-01-12 16:19 ` cvs-commit at gcc dot gnu.org
  2024-01-12 16:21 ` aburgess at redhat dot com
  2024-01-12 18:05 ` [Bug testsuite/31238] " vries at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-01-12 16:19 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #3 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Andrew Burgess <aburgess@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=98138c62cd7f721af132f9b24f274332fd8bf079

commit 98138c62cd7f721af132f9b24f274332fd8bf079
Author: Andrew Burgess <aburgess@redhat.com>
Date:   Fri Jan 12 16:08:14 2024 +0000

    gdb/testsuite: fix failure in gdb.python/py-inferior.exp

    After this commit:

      commit 1925bba80edd37c2ef90ef1d2c599dfc2fc17f72
      Date:   Thu Jan 4 10:01:24 2024 +0000

          gdb/python: add gdb.InferiorThread.__repr__() method

    failures were reported for gdb.python/py-inferior.exp.

    The test grabs a gdb.InferiorThread object representing an inferior
    thread, and then, later in the test, expects this Python object to
    become invalid when the inferior thread has exited.

    The gdb.InferiorThread object was obtained from the list returned by
    calling gdb.Inferior.threads().

    The mistake I made in the original commit was to assume that the order
    of the threads returned from gdb.Inferior.threads() somehow reflected
    the thread creation order.  Specifically, I was expecting the main
    thread to be first in the list, and "other" threads to appear ... not
    first.

    However, the gdb.Inferior.threads() function creates a list and
    populates it from a map.  The order of the threads in the returned
    list has no obvious relationship to the thread creation order, and can
    vary from host to host.

    On my machine the ordering was as I expected, so the test passed for
    me.  For others the ordering was not as expected, and it just happened
    that we ended up recording the gdb.InferiorThread for the main thread.

    As the main thread doesn't exit (until the test is over), the
    gdb.InferiorThread object never became invalid, and the test failed.

    Fixed in this commit by taking more care to correctly find a non-main
    thread.  I do this by recording the main thread early on (when there
    is only one inferior thread), and then finding any thread that is not
    this main thread.

    Then, once all of the secondary threads have exited, I know that the
    second InferiorThread object I found should now be invalid.

    The test still passes for me, and I believe this should fix the issue
    for everyone else too.

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

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug gdb/31238] FAIL: gdb.python/py-inferior.exp: test repr of an invalid thread
  2024-01-12 14:35 [Bug gdb/31238] New: FAIL: gdb.python/py-inferior.exp: test repr of an invalid thread vries at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2024-01-12 16:19 ` cvs-commit at gcc dot gnu.org
@ 2024-01-12 16:21 ` aburgess at redhat dot com
  2024-01-12 18:05 ` [Bug testsuite/31238] " vries at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: aburgess at redhat dot com @ 2024-01-12 16:21 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #4 from Andrew Burgess <aburgess at redhat dot com> ---
Tom,

I'll leave you to close this bug once you've confirmed the fix is working.  The
test was always passing for me, but I think the fix I pushed should resolve the
problem.

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug testsuite/31238] FAIL: gdb.python/py-inferior.exp: test repr of an invalid thread
  2024-01-12 14:35 [Bug gdb/31238] New: FAIL: gdb.python/py-inferior.exp: test repr of an invalid thread vries at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2024-01-12 16:21 ` aburgess at redhat dot com
@ 2024-01-12 18:05 ` vries at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2024-01-12 18:05 UTC (permalink / raw)
  To: gdb-prs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |15.1
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
          Component|gdb                         |testsuite

--- Comment #5 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Andrew Burgess from comment #4)
> Tom,
> 
> I'll leave you to close this bug once you've confirmed the fix is working. 
> The test was always passing for me, but I think the fix I pushed should
> resolve the problem.

It passes for me now on both systems, thanks for fixing this.

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-01-12 18:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-12 14:35 [Bug gdb/31238] New: FAIL: gdb.python/py-inferior.exp: test repr of an invalid thread vries at gcc dot gnu.org
2024-01-12 14:35 ` [Bug gdb/31238] " vries at gcc dot gnu.org
2024-01-12 14:36 ` vries at gcc dot gnu.org
2024-01-12 14:53 ` vries at gcc dot gnu.org
2024-01-12 16:19 ` cvs-commit at gcc dot gnu.org
2024-01-12 16:21 ` aburgess at redhat dot com
2024-01-12 18:05 ` [Bug testsuite/31238] " vries at gcc dot gnu.org

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).