Skip to content
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

Some debuginfo tests are not running #47163

Open
nerd2 opened this issue Jan 3, 2018 · 13 comments
Open

Some debuginfo tests are not running #47163

nerd2 opened this issue Jan 3, 2018 · 13 comments
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@nerd2
Copy link

nerd2 commented Jan 3, 2018

I noticed when adding a debuginfo test that nothing I did caused the test to fail. Tracing back this seems to have been caused by 3e6c83d which broke parsing of the command/check lines, leaving all tests passing without any checking.

PR #47155 runs them again and ignores the failing ones

@nerd2
Copy link
Author

nerd2 commented Jan 3, 2018

Happy to have this assigned to me to work through the failing low hanging fruit tests

@nikomatsakis nikomatsakis added A-testsuite Area: The testsuite used to check the correctness of rustc T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 3, 2018
@nerd2
Copy link
Author

nerd2 commented Jan 6, 2018

PR #47155 has now landed, the following tests were disabled:
basic-types-globals-metadata.rs // ignore-gdb
basic-types-globals.rs // ignore-gdb
basic-types-metadata.rs // ignore-gdb
basic-types-mut-globals.rs // ignore-gdb
by-value-non-immediate-argument.rs // ignore-test
c-style-enum.rs // ignore-gdb
drop-locations.rs // ignore-test
function-arg-initialization.rs // ignore-test
function-prologue-stepping-regular.rs // ignore-test
lexical-scopes-in-block-expression.rs // ignore-gdb
limited-debuginfo.rs // ignore-gdb
macro-stepping.rs // ignore-gdb
method-on-enum.rs // ignore-test
option-like-enum.rs // ignore-test
pretty-std.rs // ignore-test
shadowed-variable.rs // ignore-test
simple-struct.rs // ignore-gdb
simple-tuple.rs // ignore-gdb
struct-in-enum.rs // ignore-test
type-names.rs // ignore-gdb
union-smoke.rs // ignore-gdb
vec-slices.rs // ignore-gdb
vec.rs // ignore-gdb

@nerd2
Copy link
Author

nerd2 commented Jan 6, 2018

@eddyb I had a brief look at option-like-enum.rs and it seems that the DWARF emitted is hardcoding the descriminant to the 0th field? Looked like you had done most recent work in this area. The issue is that the following is emitted as "RUST$ENCODED$ENUM$0$None". Same if the first field of "Full" is u64. cc @tromey i notice you are working in this area too

enum MoreFields<'a> { Full(u32, &'a isize, i16), Empty }

@nerd2
Copy link
Author

nerd2 commented Jan 6, 2018

@arielb1 @vadimcn Looking at drop-locations.rs, various of the #locs are skipped. I notice that going from "-O" to "-C opt-level=0" fixes the test, on osx at least, but I wasn't sure if that was a valid fix or if this test should still work at O2.

kennytm added a commit to kennytm/rust that referenced this issue Jan 6, 2018
Debuginfo Shadowed Variable test: fix check numbering

Appears to be a simple fix to restore this test. Ref issue rust-lang#47163, CC @arielb1
@tromey
Copy link
Contributor

tromey commented Jan 7, 2018

The issue is that the following is emitted as "RUST$ENCODED$ENUM$0$None".

I'm addressing this more fully in #32920.

@jkordish jkordish added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Apr 4, 2018
@jonas-schievink jonas-schievink added the A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) label Apr 20, 2020
@jonas-schievink
Copy link
Contributor

Can someone give an update on this? Seems bad if we haven't run these tests for over 2 years.

@jonas-schievink jonas-schievink added C-bug Category: This is a bug. and removed C-enhancement Category: An issue proposing an enhancement or a PR with one. labels Apr 21, 2020
@tromey
Copy link
Contributor

tromey commented Apr 21, 2020

Many tests are still commented out. On my Fedora 30 system, I get one failure with the system gdb; and when I remove the comments I see:

failures:
    [debuginfo-gdb] debuginfo/basic-types-metadata.rs
    [debuginfo-gdb] debuginfo/macro-stepping.rs
    [debuginfo-gdb] debuginfo/pretty-std-collections.rs
    [debuginfo-gdb] debuginfo/type-names.rs

(I'm omitting some lldb failures here as not relevant.)

@tromey
Copy link
Contributor

tromey commented Apr 21, 2020

I read through the failures. However, I tried to re-run the tests against various versions of gdb, and I found I couldn't reliably do this... if I change my PATH to point to a newer gdb, x.py test seems to run a different number of tests. I don't know why this happens or what to do about it, but anyway it prevents a full investigation.

Most of these failures occur when gdb prints something reasonable, but just not exactly what the test case happens to expect.

I think macro-stepping.rs is an existing bug that is filed in the issues.

pretty-std-collections.rs is probably a bug in the pretty-printers:

Python Exception <class 'gdb.error'> No type named alloc::collections::btree::node::Root<i32, i32.: 
Python Exception <class 'gdb.error'> No type named alloc::collections::btree::node::Root<bool, bool>.: 
Python Exception <class 'gdb.error'> No type named alloc::collections::btree::node::Root<i32, pretty_std_collections::MyLeafNode.: 

I suspect type-names.rs may be fixed by this gdb patch series (not yet landed). However, I couldn't test this, as above.

compiletest seems confused by what the git gdb prints as its version number. (I tried to hack around this...)

Which versions of gdb ought to be tested? It's been a while since I looked at this stuff, so I no longer remember the state.

@tromey
Copy link
Contributor

tromey commented Apr 22, 2020

compiletest seems confused by what the git gdb prints as its version number. (I tried to hack around this...)

I have a patch for this that I will send soon.

@tromey
Copy link
Contributor

tromey commented Apr 22, 2020

See #71428

@spastorino
Copy link
Member

Removing nomination, as we've discussed this in our last weekly meeting.

@tromey
Copy link
Contributor

tromey commented Apr 23, 2020

I read the meeting notes. Note that #71428 just fixes a bug that prevents running the tests against git master gdb. It does not touch the tests. I still don't know which versions of gdb are / can be tested or where to look for that. But it sounds like perhaps these tests are deprecated anyway.

@jesusprubio
Copy link
Contributor

Just in case it could help. I can confirm they also fail in last Fedora (v33, GDB v10), but working for v9: #79009 (comment)

jacob-hughes added a commit to jacob-hughes/alloy that referenced this issue Apr 9, 2021
Stepping through a debugger is more difficult now Boehm has its own
SIGSEGV handler. These tests are deprecated anyway, and the rust team
are working on removing them.

More info: rust-lang#47163
tromey added a commit to tromey/rust that referenced this issue Mar 25, 2022
Bug rust-lang#47163 points out that some debug tests were disabled.  This patch
re-enables many of them for gdb (I don't know enough about recent
versions of lldb to make this change there).  One test that only works
for a relatively new gdb, due to the use of DW_ATE_UTF, is moved to a
version-specific test.  In a couple of spot, I simplified the check
expression where I thought that it made sense to do so -- sometimes it
isn't very worthwhile to match exactly what is emitted, particularly
where this has changed over time.  I tested this with both a
DW_ATE_UTF-capable gdb, and an older version.
@jyn514 jyn514 changed the title Debuginfo tests are not running Some debuginfo tests are not running Mar 31, 2023
jacob-hughes added a commit to jacob-hughes/alloy that referenced this issue May 17, 2023
Stepping through a debugger is more difficult now Boehm has its own
SIGSEGV handler. These tests are deprecated anyway, and the rust team
are working on removing them.

More info: rust-lang#47163
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 C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

7 participants