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: [PING][PATCH v9] Add pretty printers for the NPTL lock types


On 07/11/2016 04:44 AM, Siddhesh Poyarekar wrote:
On Sun, Jul 10, 2016 at 09:17:16PM +0200, Aurelien Jarno wrote:
What are the requirements on the gdb side for this to work? I have gdb
version 7.11.1 and all the pretty printers tests fail this way:

| Error: Response does not match the expected pattern.
| Command: print *rwlock
| Expected pattern: pthread_rwlock_t
| Response: $1 = {__data = {__lock = 0, __nr_readers = 0, __readers_wakeup = 0,
|     __writer_wakeup = 0, __nr_readers_queued = 0, __nr_writers_queued = 0,
|     __writer = 0, __shared = 0, __rwelision = 0 '\000',
|     __pad1 = "\000\000\000\000\000\000", __pad2 = 0, __flags = 0},
|   __size = '\000' <repeats 55 times>, __align = 0}
| gdb-test%

You need to add:

python
import sys
sys.path.insert(0, '/path/to/glibc/build/nptl')
end

source /path/to/glibc/nptl/nptl-printers.py
add-auto-load-safe-path /path/to/glibc/build/nptl_db

to your gdbinit for it to work.  Martin, I think you need to fix this
up using Pedro's suggestion sooner.  If you're not going to be able to
do it in time then I'll revert the patch until the next release.

Also note that the output of the tests appear on stdout instead of being
saved on the corresponding .out file.

This also needs to be fixed.

Siddhesh


Hi,

I also have trouble with these tests on s390x:
env python test-mutex-printer.py test-mutex-printer.c /path-to-build/pretty-printers/test-mutex-printer

Exception AttributeError: "'spawn' object has no attribute 'closed'" in <bound method spawn.__del__ of <pexpect.spawn object at 0x7f8c3b030410>> ignored
Traceback (most recent call last):
  File "test-mutex-printer.py", line 22, in <module>
    from test_common import *
File "/home/stli/glibcDir/glibc/pretty-printers/test_common.py", line 76, in <module>
    gdb = pexpect.spawn(GDB, echo=False, timeout=timeout)
TypeError: __init__() got an unexpected keyword argument 'echo'


After deleting "echo=False" in <src>/pretty-printers/test_common.py:76
and preparing ~/.gdbinit like Siddhesh wrote above.
Now gdb is starting and the pretty-printers are installed:
(gdb) info pretty-printer
global pretty-printers:
  builtin
    mpx_bound128
  glibc pthread locks
    pthread_cond_t
    pthread_condattr_t
    pthread_mutex_t
    pthread_mutexattr_t
    pthread_rwlock_t
    pthread_rwlockattr_t


Afterwards running make check fails with e.g.:
Python Exception <class 'gdb.error'> No struct type named pthread_mutexattr.

Furthermore there are Failures with "Expected pattern: xyz ID = 1"

See logfile for "make subdirs=pretty-printers check" output.
But keep in mind that I've deleted the "echo=False" argument.
Can you give me advice what to do?!

Bye
Stefan
/usr/bin/make -r PARALLELMFLAGS="" -C /home3/stli/glibcDir/glibc objdir=`pwd` check
make[1]: Entering directory `/home3/stli/glibcDir/glibc'
/usr/bin/make  subdir=pretty-printers -C pretty-printers ..=../ tests
make[2]: Entering directory `/home3/stli/glibcDir/glibc/pretty-printers'
env python test-mutex-attributes.py test-mutex-attributes.c /home3/stli/glibcDir/glibc-20160711-build/pretty-printers/test-mutex-attributes; \
../scripts/evaluate-test.sh pretty-printers/test-mutex-attributes-pp $? false false > /home3/stli/glibcDir/glibc-20160711-build/pretty-printers/test-mutex-attributes-pp.test-result
Error: Response does not match the expected pattern.
Command: print *attr
Expected pattern: pthread_mutexattr_t
Response: print *attr
Python Exception <class 'gdb.error'> No struct type named pthread_mutexattr.: 
Python Exception <class 'gdb.error'> No struct type named pthread_mutexattr.: 
$1 = {__size = "\000\000\000\002", __align = 2}
gdb-test% 
env python test-mutex-printer.py test-mutex-printer.c /home3/stli/glibcDir/glibc-20160711-build/pretty-printers/test-mutex-printer; \
../scripts/evaluate-test.sh pretty-printers/test-mutex-printer-pp $? false false > /home3/stli/glibcDir/glibc-20160711-build/pretty-printers/test-mutex-printer-pp.test-result
Error: Response does not match the expected pattern.
Command: print *mutex
Expected pattern: Owner ID = 1
Response: print *mutex
$7 = pthread_mutex_t = {Type = Normal, 
  Status = Locked, possibly with no waiters, Owner ID = 45402, Robust = No, 
  Shared = No, Protocol = None}
gdb-test% 
env python test-condvar-attributes.py test-condvar-attributes.c /home3/stli/glibcDir/glibc-20160711-build/pretty-printers/test-condvar-attributes; \
../scripts/evaluate-test.sh pretty-printers/test-condvar-attributes-pp $? false false > /home3/stli/glibcDir/glibc-20160711-build/pretty-printers/test-condvar-attributes-pp.test-result
Error: Response does not match the expected pattern.
Command: print *attr
Expected pattern: pthread_condattr_t
Response: print *attr
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-test% 
env python test-condvar-printer.py test-condvar-printer.c /home3/stli/glibcDir/glibc-20160711-build/pretty-printers/test-condvar-printer; \
../scripts/evaluate-test.sh pretty-printers/test-condvar-printer-pp $? false false > /home3/stli/glibcDir/glibc-20160711-build/pretty-printers/test-condvar-printer-pp.test-result
env python test-rwlock-attributes.py test-rwlock-attributes.c /home3/stli/glibcDir/glibc-20160711-build/pretty-printers/test-rwlock-attributes; \
../scripts/evaluate-test.sh pretty-printers/test-rwlock-attributes-pp $? false false > /home3/stli/glibcDir/glibc-20160711-build/pretty-printers/test-rwlock-attributes-pp.test-result
Error: Response does not match the expected pattern.
Command: print *attr
Expected pattern: pthread_rwlockattr_t
Response: print *attr
Python Exception <class 'gdb.error'> No struct type named pthread_rwlockattr.: 
Python Exception <class 'gdb.error'> No struct type named pthread_rwlockattr.: 
$3 = {__size = "\000\000\000\000\000\000\000", __align = 0}
gdb-test% 
env python test-rwlock-printer.py test-rwlock-printer.c /home3/stli/glibcDir/glibc-20160711-build/pretty-printers/test-rwlock-printer; \
../scripts/evaluate-test.sh pretty-printers/test-rwlock-printer-pp $? false false > /home3/stli/glibcDir/glibc-20160711-build/pretty-printers/test-rwlock-printer-pp.test-result
Error: Response does not match the expected pattern.
Command: print *rwlock
Expected pattern: Writer ID = 1
Response: print *rwlock
$14 = pthread_rwlock_t = {Status = Locked (Write), Writer ID = 51916, 
  Queued readers = 0, Queued writers = 0, Shared = No, Prefers = Readers}
gdb-test% 
../scripts/merge-test-results.sh -s /home3/stli/glibcDir/glibc-20160711-build/pretty-printers/ pretty-printers \
  test-condvar-attributes-pp test-condvar-printer-pp test-mutex-attributes-pp test-mutex-printer-pp test-rwlock-attributes-pp test-rwlock-printer-pp \
  > /home3/stli/glibcDir/glibc-20160711-build/pretty-printers/subdir-tests.sum
make[2]: Leaving directory `/home3/stli/glibcDir/glibc/pretty-printers'
scripts/merge-test-results.sh -s /home3/stli/glibcDir/glibc-20160711-build/ "" \
  begin-end-check c++-types-check check-local-headers \
  > /home3/stli/glibcDir/glibc-20160711-build/subdir-tests.sum
scripts/merge-test-results.sh -t /home3/stli/glibcDir/glibc-20160711-build/ subdir-tests.sum \
  . pretty-printers \
  > /home3/stli/glibcDir/glibc-20160711-build/tests.sum
FAIL: pretty-printers/test-condvar-attributes-pp
FAIL: pretty-printers/test-mutex-attributes-pp
FAIL: pretty-printers/test-mutex-printer-pp
FAIL: pretty-printers/test-rwlock-attributes-pp
FAIL: pretty-printers/test-rwlock-printer-pp
Summary of test results:
      5 FAIL
      4 PASS
make[1]: Leaving directory `/home3/stli/glibcDir/glibc'

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