public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/30074] New: FAIL: gdb.threads/schedlock.exp: schedlock=on: cmd=continue: stop all threads (with lock) (timeout)
@ 2023-02-03 12:16 vries at gcc dot gnu.org
  2023-02-05 18:30 ` [Bug gdb/30074] " vries at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: vries at gcc dot gnu.org @ 2023-02-03 12:16 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 30074
           Summary: FAIL: gdb.threads/schedlock.exp: schedlock=on:
                    cmd=continue: stop all threads (with lock) (timeout)
           Product: gdb
           Version: unknown
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

Occasionally, I run into:
...
(gdb) PASS: gdb.threads/schedlock.exp: schedlock=on: cmd=continue: set
scheduler-locking on
continue^M
Continuing.^M
PASS: gdb.threads/schedlock.exp: schedlock=on: cmd=continue: continue (with
lock)
[Thread 0x7ffff746e700 (LWP 1339) exited]^M
No unwaited-for children left.^M
(gdb) Quit^M
(gdb) FAIL: gdb.threads/schedlock.exp: schedlock=on: cmd=continue: stop all
threads (with lock) (timeout)
...

For now, it's hard to reproduce, but happened last two times I did a full
testsuite run.

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

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

* [Bug gdb/30074] FAIL: gdb.threads/schedlock.exp: schedlock=on: cmd=continue: stop all threads (with lock) (timeout)
  2023-02-03 12:16 [Bug gdb/30074] New: FAIL: gdb.threads/schedlock.exp: schedlock=on: cmd=continue: stop all threads (with lock) (timeout) vries at gcc dot gnu.org
@ 2023-02-05 18:30 ` vries at gcc dot gnu.org
  2023-02-06 10:33 ` [Bug testsuite/30074] " vries at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: vries at gcc dot gnu.org @ 2023-02-05 18:30 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
I think this is a problem of the processor running too fast, so this loop:
...
    /* Don't run forever.  Run just short of it :)  */
    while (*myp > 0)
      {
        /* schedlock.exp: main loop.  */
        MAYBE_CALL_SOME_FUNCTION(); (*myp) ++;
      }
...
just finishes and the thread exits. 

Increasing the amount of iterations by doing:
...
-    int *myp = (int *) &args[my_number];                                       
+    unsigned int *myp = (int *) &args[my_number];                             
                   ...
already seems to fix things (is the correct thing to do anyway, given that the
declared type of *args is unsigned int).

But I think a more structural fix is required, to make sure things will work
for an even faster processor.

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

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

* [Bug testsuite/30074] FAIL: gdb.threads/schedlock.exp: schedlock=on: cmd=continue: stop all threads (with lock) (timeout)
  2023-02-03 12:16 [Bug gdb/30074] New: FAIL: gdb.threads/schedlock.exp: schedlock=on: cmd=continue: stop all threads (with lock) (timeout) vries at gcc dot gnu.org
  2023-02-05 18:30 ` [Bug gdb/30074] " vries at gcc dot gnu.org
@ 2023-02-06 10:33 ` vries at gcc dot gnu.org
  2023-02-06 11:52 ` cvs-commit at gcc dot gnu.org
  2023-02-06 11:55 ` vries at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: vries at gcc dot gnu.org @ 2023-02-06 10:33 UTC (permalink / raw)
  To: gdb-prs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|gdb                         |testsuite

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

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

* [Bug testsuite/30074] FAIL: gdb.threads/schedlock.exp: schedlock=on: cmd=continue: stop all threads (with lock) (timeout)
  2023-02-03 12:16 [Bug gdb/30074] New: FAIL: gdb.threads/schedlock.exp: schedlock=on: cmd=continue: stop all threads (with lock) (timeout) vries at gcc dot gnu.org
  2023-02-05 18:30 ` [Bug gdb/30074] " vries at gcc dot gnu.org
  2023-02-06 10:33 ` [Bug testsuite/30074] " vries at gcc dot gnu.org
@ 2023-02-06 11:52 ` cvs-commit at gcc dot gnu.org
  2023-02-06 11:55 ` vries at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-02-06 11:52 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom de Vries <vries@sourceware.org>:

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

commit 9af467b82406614deb46151f838c336a7c8604db
Author: Tom de Vries <tdevries@suse.de>
Date:   Mon Feb 6 12:52:50 2023 +0100

    [gdb/testsuite] Fix gdb.threads/schedlock.exp on fast cpu

    Occasionally, I run into:
    ...
    (gdb) PASS: gdb.threads/schedlock.exp: schedlock=on: cmd=continue: \
      set scheduler-locking on
    continue^M
    Continuing.^M
    PASS: gdb.threads/schedlock.exp: schedlock=on: cmd=continue: \
      continue (with lock)
    [Thread 0x7ffff746e700 (LWP 1339) exited]^M
    No unwaited-for children left.^M
    (gdb) Quit^M
    (gdb) FAIL: gdb.threads/schedlock.exp: schedlock=on: cmd=continue: \
      stop all threads (with lock) (timeout)
    ...

    What happens is that this loop which is supposed to run "just short of
forever":
    ...
        /* Don't run forever.  Run just short of it :)  */
        while (*myp > 0)
          {
            /* schedlock.exp: main loop.  */
            MAYBE_CALL_SOME_FUNCTION(); (*myp) ++;
          }
    ...
    finishes after 0x7fffffff iterations (when a signed wrap occurs), which on
my
    system takes only about 1.5 seconds.

    Fix this by:
    - changing the pointed-at type of myp from signed to unsigned, which makes
the
      wrap defined behaviour (and which also make the loop run twice as long,
      which is already enough to make it impossible for me to reproduce the
FAIL.
      But let's try to solve this more structurally).
    - changing the pointed-at type of myp from int to long long, making the
wrap
      unlikely.
    - making sure the loop runs forever, by setting the loop condition to 1.
    - making sure the loop still contains different lines (as far as debug info
is
      concerned) by incrementing a volatile counter in the loop.
    - making sure the program doesn't run forever in case of trouble, by adding
an
      "alarm (30)".

    Tested on x86_64-linux.

    PR testsuite/30074
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30074

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

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

* [Bug testsuite/30074] FAIL: gdb.threads/schedlock.exp: schedlock=on: cmd=continue: stop all threads (with lock) (timeout)
  2023-02-03 12:16 [Bug gdb/30074] New: FAIL: gdb.threads/schedlock.exp: schedlock=on: cmd=continue: stop all threads (with lock) (timeout) vries at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-02-06 11:52 ` cvs-commit at gcc dot gnu.org
@ 2023-02-06 11:55 ` vries at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: vries at gcc dot gnu.org @ 2023-02-06 11:55 UTC (permalink / raw)
  To: gdb-prs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.1
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Tom de Vries <vries at gcc dot gnu.org> ---
Fixed.

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

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

end of thread, other threads:[~2023-02-06 11:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-03 12:16 [Bug gdb/30074] New: FAIL: gdb.threads/schedlock.exp: schedlock=on: cmd=continue: stop all threads (with lock) (timeout) vries at gcc dot gnu.org
2023-02-05 18:30 ` [Bug gdb/30074] " vries at gcc dot gnu.org
2023-02-06 10:33 ` [Bug testsuite/30074] " vries at gcc dot gnu.org
2023-02-06 11:52 ` cvs-commit at gcc dot gnu.org
2023-02-06 11:55 ` 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).