This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v10] Add pretty printers for the NPTL lock types


On 07/18/2016 08:50 PM, Martin Galvan wrote:
Changes from v9:

Besides that, I've added a few more checks to the test harness. We now check for a minimum Pexpect
version (4) and a minimum gdb version (7.7), as well as if gdb actually has Python support. I also
discarded the custom gdb prompt since we're not reading a .gdbinit anymore. Notice gdb 7.7 still
has the RegexpCollectionPrettyPrinter bug fixed for 7.8; if you're using a gdb older than 7.8 you
should fix it before running the tests (the README points out the gdb commit that fixes it).
As a note: gdb is installed on all my machines in a version > 7.8. Thus I could not test this checks.

I run the tests on a machine without pexpect => UNSUPPORTED:
The out-files contain the hint of missing pexpect. Ok.

I run the tests on a machine with pexpect version 3.1 => UNSUPPORTED:
The out-files contain the hint of missing the correct pexpect version. Ok.

I run the tests on a machine (fedora23 i686, s390x, s390) with pexpect version 4.0.1 => FAIL:
The out-file is empty, but on terminal the tests dump:
Traceback (most recent call last):
  File "test-mutexattr-printers.py", line 22, in <module>
    from test_printers_common import *
File "/home/stli/glibcDir/glibc/scripts/test_printers_common.py", line 67, in <module>
    gdb_version = (int(match.group(1)), int(match.group(2)))
AttributeError: 'NoneType' object has no attribute 'group'

re.search  does not find the gdb-version string and is returning None.
On e.g. Fedora, gdb --version prints:
GNU gdb (GDB) Fedora 7.10-23.fc23
Copyright (C) 2015 Free Software Foundation, Inc.
...


As for the issues Stefan was seeing, I've tried this myself using gdb 7.10 and couldn't reproduce
them. It seems that in your case gdb.lookup_type isn't finding the struct types representing the attributes.
One thing that might be causing the issue is your libpthread.so not being compiled with debugging symbols.
 From what I saw, the DWARF DIEs describing the attr structs come from libpthread, not the test programs.
Could you check if your libpthread is stripped, and if so re-compile it with debugging symbols?

If I remove the check for correct gdb-version as these machines (i686, s390x, s390 fedora 23) have correct gdb, pexpect version and glibc is built without debug-info:
FAIL: nptl/test-condattr-printers; out-file:
Error: Response does not match the expected pattern.
Command: print *attr
Expected pattern: pthread_condattr_t
Response: Python Exception <class 'gdb.error'> No struct type named pthread_condattr.:
Python Exception <class 'gdb.error'> No struct type named pthread_condattr.:
$3 = {__size = "\000\000\000", __align = 0}
(gdb)

FAIL: nptl/test-mutexattr-printers
FAIL: nptl/test-rwlockattr-printers



If glibc is built on i686 fedora 23 with debug-info:
FAIL: nptl/test-condattr-printers; out-file:
Error: Response does not match the expected pattern.
Command: print *condvar
Expected pattern: Shared = Yes
Response: $6 = pthread_cond_t = {Threads waiting for this condvar = 0,
Clock ID = CLOCK_REALTIME, Shared = No, Mutex = Cannot access memory at address 0xffffffff
(gdb)


If glibc is built on s390x (64bit) fedora 23 with debug-info:
All nptl pretty-printer tests succeed.

If glibc is built on s390 (31bit) fedora 23 with debug-info:
FAIL: nptl/test-condattr-printers;
The out-file contains the same error as on 32bit intel.




Is this the intention, that glibc has to be build with debug-information in order to get no test fails?

Bye
Stefan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]