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

Not all debuginfo tests work on GDB 7.2 #13680

Closed
alexcrichton opened this issue Apr 22, 2014 · 6 comments
Closed

Not all debuginfo tests work on GDB 7.2 #13680

alexcrichton opened this issue Apr 22, 2014 · 6 comments
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.)

Comments

@alexcrichton
Copy link
Member

Turns out the linux-snap bot just gained gdb 7.2 (it previously didn't have gdb at all). It also turns out that a few of our debug-info tests fail on 7.2, and it all appears primarily related to globals. The full log is here and here's an excerpt as well.

---- [debug-info] debug-info/basic-types-globals-metadata.rs stdout ----

    error: line not found in debugger output: type = bool
    command: gdb -quiet -batch -nx -command=x86_64-unknown-linux-gnu/test/debug-info/basic-types-globals-metadata.debugger.script x86_64-unknown-linux-gnu/test/debug-info/basic-types-globals-metadata.stage2-x86_64-unknown-linux-gnu
    stdout:
    ------------------------------------------
    Breakpoint 1 at 0x400840: file /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/obj/tmp/distcheck/rust-nightly/src/test/debug-info/basic-types-globals-metadata.rs, line 71.
    static void _zzz();
    [Thread debugging using libthread_db enabled]

    Breakpoint 1, _zzz () at /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/obj/tmp/distcheck/rust-nightly/src/test/debug-info/basic-types-globals-metadata.rs:71
    71  fn _zzz() {()}
    0x00000000004007de in main () at /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/obj/tmp/distcheck/rust-nightly/src/test/debug-info/basic-types-globals-metadata.rs:68
    68      _zzz();

    ------------------------------------------
    stderr:
    ------------------------------------------
    x86_64-unknown-linux-gnu/test/debug-info/basic-types-globals-metadata.debugger.script:5: Error in sourced command file:
    No symbol "basic-types-globals-metadata::B" in current context.

    ------------------------------------------

    task '[debug-info] debug-info/basic-types-globals-metadata.rs' failed at 'explicit failure', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/obj/tmp/distcheck/rust-nightly/src/compiletest/runtest.rs:969

---- [debug-info] debug-info/basic-types-globals.rs stdout ----

    error: line not found in debugger output: $1 = false
    command: gdb -quiet -batch -nx -command=x86_64-unknown-linux-gnu/test/debug-info/basic-types-globals.debugger.script x86_64-unknown-linux-gnu/test/debug-info/basic-types-globals.stage2-x86_64-unknown-linux-gnu
    stdout:
    ------------------------------------------
    Breakpoint 1 at 0x400840: file /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/obj/tmp/distcheck/rust-nightly/src/test/debug-info/basic-types-globals.rs, line 75.
    static void _zzz();
    [Thread debugging using libthread_db enabled]

    Breakpoint 1, _zzz () at /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/obj/tmp/distcheck/rust-nightly/src/test/debug-info/basic-types-globals.rs:75
    75  fn _zzz() {()}
    0x00000000004007de in main () at /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/obj/tmp/distcheck/rust-nightly/src/test/debug-info/basic-types-globals.rs:72
    72      _zzz();

    ------------------------------------------
    stderr:
    ------------------------------------------
    x86_64-unknown-linux-gnu/test/debug-info/basic-types-globals.debugger.script:5: Error in sourced command file:
    No symbol "basic-types-globals::B" in current context.

    ------------------------------------------

    task '[debug-info] debug-info/basic-types-globals.rs' failed at 'explicit failure', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/obj/tmp/distcheck/rust-nightly/src/compiletest/runtest.rs:969

---- [debug-info] debug-info/basic-types-mut-globals.rs stdout ----

    error: line not found in debugger output: $1 = false
    command: gdb -quiet -batch -nx -command=x86_64-unknown-linux-gnu/test/debug-info/basic-types-mut-globals.debugger.script x86_64-unknown-linux-gnu/test/debug-info/basic-types-mut-globals.stage2-x86_64-unknown-linux-gnu
    stdout:
    ------------------------------------------
    Breakpoint 1 at 0x4008e0: file /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/obj/tmp/distcheck/rust-nightly/src/test/debug-info/basic-types-mut-globals.rs, line 129.
    static void _zzz();
    [Thread debugging using libthread_db enabled]

    Breakpoint 1, _zzz () at /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/obj/tmp/distcheck/rust-nightly/src/test/debug-info/basic-types-mut-globals.rs:129
    129 fn _zzz() {()}
    0x00000000004007de in main () at /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/obj/tmp/distcheck/rust-nightly/src/test/debug-info/basic-types-mut-globals.rs:107
    107     _zzz();

    ------------------------------------------
    stderr:
    ------------------------------------------
    x86_64-unknown-linux-gnu/test/debug-info/basic-types-mut-globals.debugger.script:5: Error in sourced command file:
    No symbol "basic-types-mut-globals::B" in current context.

    ------------------------------------------

    task '[debug-info] debug-info/basic-types-mut-globals.rs' failed at 'explicit failure', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/obj/tmp/distcheck/rust-nightly/src/compiletest/runtest.rs:969

---- [debug-info] debug-info/c-style-enum.rs stdout ----

    error: line not found in debugger output: $1 = TheOnlyVariant
    command: gdb -quiet -batch -nx -command=x86_64-unknown-linux-gnu/test/debug-info/c-style-enum.debugger.script x86_64-unknown-linux-gnu/test/debug-info/c-style-enum.stage2-x86_64-unknown-linux-gnu
    stdout:
    ------------------------------------------
    Breakpoint 1 at 0x4008b0: file /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/obj/tmp/distcheck/rust-nightly/src/test/debug-info/c-style-enum.rs, line 126.
    static void zzz();

    ------------------------------------------
    stderr:
    ------------------------------------------
    x86_64-unknown-linux-gnu/test/debug-info/c-style-enum.debugger.script:3: Error in sourced command file:
    No symbol "c-style-enum::SINGLE_VARIANT" in current context.

    ------------------------------------------

    task '[debug-info] debug-info/c-style-enum.rs' failed at 'explicit failure', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/obj/tmp/distcheck/rust-nightly/src/compiletest/runtest.rs:969

---- [debug-info] debug-info/lexical-scopes-in-block-expression.rs stdout ----

    error: line not found in debugger output: $1 = 0
    command: gdb -quiet -batch -nx -command=x86_64-unknown-linux-gnu/test/debug-info/lexical-scopes-in-block-expression.debugger.script x86_64-unknown-linux-gnu/test/debug-info/lexical-scopes-in-block-expression.stage2-x86_64-unknown-linux-gnu
    stdout:
    ------------------------------------------
    Breakpoint 1 at 0x400c20: file /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/obj/tmp/distcheck/rust-nightly/src/test/debug-info/lexical-scopes-in-block-expression.rs, line 376.
    static void zzz();
    [Thread debugging using libthread_db enabled]

    Breakpoint 1, zzz () at /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/obj/tmp/distcheck/rust-nightly/src/test/debug-info/lexical-scopes-in-block-expression.rs:376
    376 fn zzz() {()}

    ------------------------------------------
    stderr:
    ------------------------------------------
    x86_64-unknown-linux-gnu/test/debug-info/lexical-scopes-in-block-expression.debugger.script:4: Error in sourced command file:
    No symbol "lexical-scopes-in-block-expression::MUT_INT" in current context.

    ------------------------------------------

    task '[debug-info] debug-info/lexical-scopes-in-block-expression.rs' failed at 'explicit failure', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/obj/tmp/distcheck/rust-nightly/src/compiletest/runtest.rs:969

---- [debug-info] debug-info/simple-struct.rs stdout ----

    error: line not found in debugger output: $1 = {x = 1000, y = -1001}
    command: gdb -quiet -batch -nx -command=x86_64-unknown-linux-gnu/test/debug-info/simple-struct.debugger.script x86_64-unknown-linux-gnu/test/debug-info/simple-struct.stage2-x86_64-unknown-linux-gnu
    stdout:
    ------------------------------------------
    Breakpoint 1 at 0x4009b0: file /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/obj/tmp/distcheck/rust-nightly/src/test/debug-info/simple-struct.rs, line 194.
    static void zzz();

    ------------------------------------------
    stderr:
    ------------------------------------------
    x86_64-unknown-linux-gnu/test/debug-info/simple-struct.debugger.script:4: Error in sourced command file:
    No symbol "simple-struct::NO_PADDING_16" in current context.

    ------------------------------------------

    task '[debug-info] debug-info/simple-struct.rs' failed at 'explicit failure', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/obj/tmp/distcheck/rust-nightly/src/compiletest/runtest.rs:969

---- [debug-info] debug-info/simple-tuple.rs stdout ----

    error: line not found in debugger output: $1 = {-50, 50}
    command: gdb -quiet -batch -nx -command=x86_64-unknown-linux-gnu/test/debug-info/simple-tuple.debugger.script x86_64-unknown-linux-gnu/test/debug-info/simple-tuple.stage2-x86_64-unknown-linux-gnu
    stdout:
    ------------------------------------------
    Breakpoint 1 at 0x400a30: file /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/obj/tmp/distcheck/rust-nightly/src/test/debug-info/simple-tuple.rs, line 113.
    static void zzz();

    ------------------------------------------
    stderr:
    ------------------------------------------
    x86_64-unknown-linux-gnu/test/debug-info/simple-tuple.debugger.script:4: Error in sourced command file:
    No symbol "simple-tuple::NO_PADDING_8" in current context.

    ------------------------------------------

    task '[debug-info] debug-info/simple-tuple.rs' failed at 'explicit failure', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/obj/tmp/distcheck/rust-nightly/src/compiletest/runtest.rs:969

---- [debug-info] debug-info/vec-slices.rs stdout ----

    error: line not found in debugger output: $14 = 2
    command: gdb -quiet -batch -nx -command=x86_64-unknown-linux-gnu/test/debug-info/vec-slices.debugger.script x86_64-unknown-linux-gnu/test/debug-info/vec-slices.stage2-x86_64-unknown-linux-gnu
    stdout:
    ------------------------------------------
    Breakpoint 1 at 0x401580: file /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/obj/tmp/distcheck/rust-nightly/src/test/debug-info/vec-slices.rs, line 87.
    static void zzz();
    [Thread debugging using libthread_db enabled]

    Breakpoint 1, zzz () at /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/obj/tmp/distcheck/rust-nightly/src/test/debug-info/vec-slices.rs:87
    87  fn zzz() {()}
    0x0000000000400b66 in main () at /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/obj/tmp/distcheck/rust-nightly/src/test/debug-info/vec-slices.rs:84
    84      zzz();
    $1 = 0
    $2 = 1
    $3 = {1}
    $4 = 4
    $5 = {2, 3, 4, 5}
    $6 = 2
    $7 = {3, 4}
    $8 = 2
    $9 = {6, 7}
    $10 = {8, 9}
    $11 = 2
    $12 = {x = 10, y = 11, z = 12}
    $13 = {x = 13, y = 14, z = 15}

    ------------------------------------------
    stderr:
    ------------------------------------------
    x86_64-unknown-linux-gnu/test/debug-info/vec-slices.debugger.script:19: Error in sourced command file:
    No symbol "vec-slices::MUT_VECT_SLICE" in current context.

    ------------------------------------------

    task '[debug-info] debug-info/vec-slices.rs' failed at 'explicit failure', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/obj/tmp/distcheck/rust-nightly/src/compiletest/runtest.rs:969

---- [debug-info] debug-info/vec.rs stdout ----

    error: line not found in debugger output: $2 = {4, 5, 6}
    command: gdb -quiet -batch -nx -command=x86_64-unknown-linux-gnu/test/debug-info/vec.debugger.script x86_64-unknown-linux-gnu/test/debug-info/vec.stage2-x86_64-unknown-linux-gnu
    stdout:
    ------------------------------------------
    Breakpoint 1 at 0x4009b0: file /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/obj/tmp/distcheck/rust-nightly/src/test/debug-info/vec.rs, line 40.
    static void zzz();
    [Thread debugging using libthread_db enabled]

    Breakpoint 1, zzz () at /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/obj/tmp/distcheck/rust-nightly/src/test/debug-info/vec.rs:40
    40  fn zzz() {()}
    0x0000000000400912 in main () at /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/obj/tmp/distcheck/rust-nightly/src/test/debug-info/vec.rs:37
    37      zzz();
    $1 = {1, 2, 3}

    ------------------------------------------
    stderr:
    ------------------------------------------
    x86_64-unknown-linux-gnu/test/debug-info/vec.debugger.script:7: Error in sourced command file:
    No symbol "VECT" in namespace "vec".

    ------------------------------------------

    task '[debug-info] debug-info/vec.rs' failed at 'explicit failure', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/obj/tmp/distcheck/rust-nightly/src/compiletest/runtest.rs:969


failures:
    [debug-info] debug-info/basic-types-globals-metadata.rs
    [debug-info] debug-info/basic-types-globals.rs
    [debug-info] debug-info/basic-types-mut-globals.rs
    [debug-info] debug-info/c-style-enum.rs
    [debug-info] debug-info/lexical-scopes-in-block-expression.rs
    [debug-info] debug-info/simple-struct.rs
    [debug-info] debug-info/simple-tuple.rs
    [debug-info] debug-info/vec-slices.rs
    [debug-info] debug-info/vec.rs

I'm going to try to upgrade gdb locally on the linux-snap bot, but we should perhaps handle the gdb version when running debug-info tests (if it's not too hard).

cc @michaelwoerister

@michaelwoerister
Copy link
Member

Yes, these all seem to be related to globals. Who would have thought that this innocent looking feature would cause so much trouble...
I certainly can look into it. Would you say this is a high-priority issue?

@alexcrichton
Copy link
Member Author

Oh no, I don't think this is high priority. I updated gdb on the bots and everything was fine, just wanted to make sure that it was known and written down!

@michaelwoerister
Copy link
Member

In that case I'll focus on more pressing issues for the time being :)

@klutzy
Copy link
Contributor

klutzy commented Apr 26, 2014

Seems like it's #13256 on linux. I previously found the error on win32, but now I see same behavior on linux64:

$ rustc basic-types-globals-metadata.rs -g -o abc
$ gdb ./abc
GNU gdb (GDB) 7.6.2 (Debian 7.6.2-1)
...
This GDB was configured as "x86_64-linux-gnu".
...

(gdb) whatis 'basic-types-globals-metadata::B'
No symbol "basic-types-globals-metadata::B" in current context.

(gdb) whatis 'abc::B'
type = bool

@klutzy
Copy link
Contributor

klutzy commented Apr 26, 2014

Ah, sorry. The build command must be rustc basic-types-globals-metadata.rs -o basic-types-globals-metadata.stage2-x86_64-unknown-linux-gnu, but it works on my machine.
So I'm less convinced that it's dup of #13256, but I guess there's at least similar issue on linux-snap gdb.

bors added a commit that referenced this issue May 15, 2014
…hton

This pull request fixes #12881.

Two caveats:

1. As explained in the commit message, this doesn't include a regression test. If this is unacceptable, please let me know, I'll see what I can do.
1. I'm getting some test failures on make check, all from debuginfo. I suspect this is due to #13680 and  not related to my changes (I have GDB 7.7). This is the list of failed tests:

> [debuginfo-gdb] debuginfo/basic-types-globals.rs
> [debuginfo-gdb] debuginfo/basic-types-mut-globals.rs
> [debuginfo-gdb] debuginfo/basic-types.rs
> [debuginfo-gdb] debuginfo/borrowed-basic.rs
> [debuginfo-gdb] debuginfo/borrowed-managed-basic.rs
> [debuginfo-gdb] debuginfo/borrowed-struct.rs
> [debuginfo-gdb] debuginfo/borrowed-unique-basic.rs
> [debuginfo-gdb] debuginfo/box.rs
> [debuginfo-gdb] debuginfo/by-value-non-immediate-argument.rs
> [debuginfo-gdb] debuginfo/by-value-self-argument-in-trait-impl.rs
> [debuginfo-gdb] debuginfo/closure-in-generic-function.rs
> [debuginfo-gdb] debuginfo/evec-in-struct.rs
> [debuginfo-gdb] debuginfo/function-arg-initialization.rs
> [debuginfo-gdb] debuginfo/function-prologue-stepping-no-split-stack.rs
> [debuginfo-gdb] debuginfo/generic-function.rs
> [debuginfo-gdb] debuginfo/generic-functions-nested.rs
> [debuginfo-gdb] debuginfo/generic-method-on-generic-struct.rs
> [debuginfo-gdb] debuginfo/generic-static-method-on-struct-and-enum.rs
> [debuginfo-gdb] debuginfo/generic-struct.rs
> [debuginfo-gdb] debuginfo/lexical-scope-in-stack-closure.rs
> [debuginfo-gdb] debuginfo/lexical-scope-in-unique-closure.rs
> [debuginfo-gdb] debuginfo/method-on-generic-struct.rs
> [debuginfo-gdb] debuginfo/method-on-tuple-struct.rs
> [debuginfo-gdb] debuginfo/name-shadowing-and-scope-nesting.rs
> [debuginfo-gdb] debuginfo/recursive-struct.rs
> [debuginfo-gdb] debuginfo/self-in-generic-default-method.rs
> [debuginfo-gdb] debuginfo/shadowed-argument.rs
> [debuginfo-gdb] debuginfo/shadowed-variable.rs
> [debuginfo-gdb] debuginfo/simd.rs
> [debuginfo-gdb] debuginfo/simple-lexical-scope.rs
> [debuginfo-gdb] debuginfo/simple-struct.rs
> [debuginfo-gdb] debuginfo/simple-tuple.rs
> [debuginfo-gdb] debuginfo/static-method-on-struct-and-enum.rs
> [debuginfo-gdb] debuginfo/tuple-struct.rs
> [debuginfo-gdb] debuginfo/var-captured-in-nested-closure.rs
> [debuginfo-gdb] debuginfo/var-captured-in-sendable-closure.rs
> [debuginfo-gdb] debuginfo/var-captured-in-stack-closure.rs

I can provide the full output on request.
@alexcrichton
Copy link
Member Author

Our debuginfo tests have been passing for quite some time now, and I've since come to think that if we require a minimum version of GDB to run tests that it's really not so bad, so I'm closing this as basically fixed.

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.)
Projects
None yet
Development

No branches or pull requests

3 participants