[Bug gdb/22556] New: Regression: gdb.threads/names.exp with --target_board=native-gdbserver

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug gdb/22556] New: Regression: gdb.threads/names.exp with --target_board=native-gdbserver

maiku.fabian at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22556

            Bug ID: 22556
           Summary: Regression: gdb.threads/names.exp with
                    --target_board=native-gdbserver
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: palves at redhat dot com
  Target Milestone: ---

I've seeing an odd regression in gdb.threads/names.exp (at least) when testing
against --target_board=native-gdbserver

~~~
 Thread 1 "main" hit Breakpoint 1, all_threads_ready () at
src/gdb/testsuite/gdb.threads/names.c:51
 51      }
 (gdb) info threads
   Id   Target Id         Frame
 * 1    Thread 4090.4090 "main" () all_threads_ready () at
/home/pedro/gdb/mygit/cxx-convertion/src/gdb/testsuite/gdb.threads/names.c:51
   2    Thread 4090.4093 "carrot" () pthread_barrier_wait () at
../sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S:71
   3    Thread 4090.4094 "potato" () pthread_barrier_wait () at
../sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S:71
   4    Thread 4090.4095 "celery" () pthread_barrier_wait () at
../sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S:71
 (gdb) FAIL: gdb.threads/names.exp: list threads
~~~

Notice the spurious "()" in

  "main" () all_threads_ready ()
         ^^

Testing against the native target doesn't show that:

 (gdb) info threads
   Id   Target Id         Frame
 * 1    Thread 0x7ffff7fc1700 (LWP 4439) "main" all_threads_ready () at
/home/pedro/gdb/mygit/cxx-convertion/src/gdb/testsuite/gdb.threads/names.c:51
   2    Thread 0x7ffff74fa700 (LWP 4443) "carrot" pthread_barrier_wait () at
../sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S:71
   3    Thread 0x7ffff6cf9700 (LWP 4444) "potato" pthread_barrier_wait () at
../sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S:71
   4    Thread 0x7ffff64f8700 (LWP 4445) "celery" pthread_barrier_wait () at
../sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S:71
 (gdb) PASS: gdb.threads/names.exp: list threads

Seems recent-ish -- I don't see the failure in the logs of a testrun from Oct
19.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug gdb/22556] Regression: gdb.threads/names.exp with --target_board=native-gdbserver

maiku.fabian at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22556

Pedro Alves <palves at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |8.1

--- Comment #1 from Pedro Alves <palves at redhat dot com> ---
Setting milestone so we don't forget.  (I'm not looking at this right now.)

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug gdb/22556] Regression: gdb.threads/names.exp with --target_board=native-gdbserver

maiku.fabian at gmail dot com
In reply to this post by maiku.fabian at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22556

--- Comment #2 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Simon Marchi <[hidden email]>:

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

commit a933405894161c8b15f675c48d077b7f7d6aabf2
Author: Simon Marchi <[hidden email]>
Date:   Mon Dec 11 21:05:30 2017 -0500

    remote: Return NULL extra_info/name if they are empty

    Commit

      remote: C++ify thread_item and threads_listing_context
      21fe1c752e254167d953fa8c846280f63a3a5290

    broke the test gdb.threads/names.exp.  The problem is that since we now
    use an std::string to hold the extra_info, an empty string is returned
    by target_extra_thread_info to print_thread_info_1 when the remote stub
    didn't send any extra info, instead of NULL before.  Because of that,
    print_thread_info_1 prints the extra info between parentheses, which
    results in some spurious empty parentheses.

      Expected: * 1    Thread 22752.22752 "main" all_threads_ready () at ...
      Actual  : * 1    Thread 22752.22752 "main" () all_threads_ready () a ...

    Since the bug was introduced by a behavior change in the remote target,
    I chose to fix it on the remote target side by making it return NULL
    when the extra string is empty.  This will avoid possibly changing the
    behavior of the common code and affecting other targets.

    The name field has the same problem.  If a remote stub returns no thread
    names, remote_thread_name will return an empty string instead of NULL,
    so print_thread_info_1 will show empty quotes ("") instead of nothing.

    gdb/ChangeLog:

        PR gdb/22556
        * remote.c (remote_thread_name): Return NULL if name is empty.
        (remote_threads_extra_info): Return NULL if extra info is empty.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug gdb/22556] Regression: gdb.threads/names.exp with --target_board=native-gdbserver

maiku.fabian at gmail dot com
In reply to this post by maiku.fabian at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22556

Simon Marchi <simon.marchi at ericsson dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |simon.marchi at ericsson dot com
         Resolution|---                         |FIXED

--- Comment #3 from Simon Marchi <simon.marchi at ericsson dot com> ---
Fixed by the above commit.

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