-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
debuginfo-gdb test failures #39838
Labels
A-debuginfo
Area: Debugging information in compiled programs (DWARF, PDB, etc.)
A-testsuite
Area: The testsuite used to check the correctness of rustc
Comments
michaelwoerister
added
A-debuginfo
Area: Debugging information in compiled programs (DWARF, PDB, etc.)
A-testsuite
Area: The testsuite used to check the correctness of rustc
labels
Feb 15, 2017
Thanks for the detailed investigation and report! |
amboar
added a commit
to amboar/rust
that referenced
this issue
Mar 8, 2017
This was a largely automated process, driven by the hack of a shell script below. The process to generate the patch was to repeatedly run the script until the changes reached a fixed-point. ```bash set -euo pipefail O=$(mktemp) ./x.py test src/test/debuginfo 2>&1 | tee $O || true awk ' function escape_pattern(pat, safe) { safe = pat gsub(/[][^$.*?+{}\\()|]/, "\\\\&", safe) return safe } BEGIN { p = 0; n = 0; } /---- \[debuginfo-gdb\]/ { if (p == 1) { printf("%s|%s|%s\n", src, error, expected); } src = $3; p = 1; n = 0; name = ""; } n == 1 && $0 ~ name { expected = $0; n = 0; } /error: line not found in debugger output/ { error = substr($0,43); split(error, pieces); name = escape_pattern(pieces[1]); print "Found " name " in: " $0 > "/dev/stderr" n = 1; } END { printf("%s|%s|%s\n", src, error, expected); } ' $O | while read l; do SRC="$(echo "$l" | cut -d'|' -f1 | sed 's/debuginfo-gdb/debuginfo/')" ERR="$(echo "$l" | cut -d'|' -f2)" V="$(echo "$ERR" | cut -d' ' -f1 | sed 's/\$/\\$/g')" EX="$(echo "$l" | cut -d'|' -f3)" if echo "$EX" | grep '^\$' > /dev/null; then echo $SRC sed -ri '/\/\/ gdbr-check:'"$V"' /s|(// gdbr-check:).*|\1'"$EX"'|' src/test/$SRC else # this is a bit questionable EX="$(echo "$l" | cut -d'|' -f2)" sed -ri '/\/\/ gdbr-check:'"$V"' /s|(// gdbr-check:).*|\1'"$EX"'|' src/test/$SRC echo $SRC: Failed to patch with: $l fi done echo $O ``` Fixes: rust-lang#39838 Signed-off-by: Andrew Jeffery <[email protected]>
Does the fix #41877 work for you? |
@nodakai I'll test as soon as I get an opportunity. Thanks for the prompt! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-debuginfo
Area: Debugging information in compiled programs (DWARF, PDB, etc.)
A-testsuite
Area: The testsuite used to check the correctness of rustc
Recently I started looking at issues with the Rust test suite on powerpc64le as part of an effort to package Rust for Debian on POWER. I'm using 81bd267 as the basis for my testing, which contains the resolution for #39522, but I still see a large number of failures. I'm testing on Ubuntu Yakkety (16.10), both on powerpc64le and x86_64.
I made a couple of comments on #39522, but I have created a new issue to track my problem as I don't want to hijack a closed issue.
On Ubuntu Yakkety with a clean build of rust at 81bd267, invoking
./x.py test src/test/debuginfo/
gives me the output gdb-ubuntu-rust-debuginfo.txt, which has the summarytest result: FAILED. 54 passed; 40 failed; 13 ignored; 0 measured
.Yakkety's
gdb
reports:Given the issues with different
gdb
versions as outlined in #39522, I figured I'd try building gdb from the tip of binutils-gdb master, which at the time was commit 10ddfe62f8979cfe380b07c4f827e72681cc612a:This was built with
./configure --with-python=python3
, as is done for Ubuntu (though with many more configure options in Ubuntu's case).Using my own gdb build I get the output gdb-master-rust-debuginfo.txt and a result summary of
test result: FAILED. 53 passed; 51 failed; 3 ignored; 0 measured
. Presumably the tests ignored by the patch for #39522 with gdb 7.11.90 are now functional as we have 10 less tests ignored.However, the plot thickened before I realised that Ubuntu built gdb with Python support, as building a gdb with
./configure && make
gave me a binary that passed many more debuginfo tests. After jumping through several hoops I found I could simulate a lack of Python support in gdb by breaking a part of the Rust source tree withmv -f src/etc/debugger_pretty_printers_common.py{,.disabled} && touch src/etc/debugger_pretty_printers_common.py
. With this configuration, for both the stock Ubuntu gdb and my custom build, I now get the following logs:gdb-ubuntu-rust-debuginfo-no-pp.txt
gdb-master-rust-debuginfo-no-pp.txt:
This means one of two things
gdbr-check
annotations in the tests are out of sync with the pretty printer scripts, and the tests are expecting the wrong output. If this is the case, I have a commit at amboar/rust@67bffe3 which makes the expectations match the output. This commit was mechanically generated and the script used is included in the commit message.Miscellaneous testing gotchas:
rm -rf ./build/x86_64-unknown-linux-gnu/test/debuginfo/*
sed -ri '/CFG_GDB/s|/usr/bin/gdb|/usr/local/bin/gdb|' config.mk
, and switch the search and replace patterns around as necessaryThe text was updated successfully, but these errors were encountered: