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

GDB debuginfo tests depend on operating system locale #17423

Closed
oskchaitanya opened this issue Sep 21, 2014 · 7 comments · Fixed by #17463
Closed

GDB debuginfo tests depend on operating system locale #17423

oskchaitanya opened this issue Sep 21, 2014 · 7 comments · Fixed by #17463
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.)

Comments

@oskchaitanya
Copy link
Contributor

While trying 'make check' on the latest revision (id mentioned in attachments), I get a bunch of failures in gdb debuginfo tests. Along with this, I see that 'make check' itself errors out and does not continue further.

Here is how the system info looks:

rust$ uname -a
Linux zanshin 3.13.0-35-generic #62-Ubuntu SMP Fri Aug 15 01:58:42 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux


rust$ 
rust$ cat /etc/issue
Ubuntu 14.04.1 LTS \n \l


rust$ gdb --version
GNU gdb (Ubuntu 7.7-0ubuntu3.1) 7.7
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".


rust$ git log --oneline -1
b8599ec auto merge of #17421 : anchovieshat/rust/move_lto, r=thestinger

Also, the last few lines of output from the problem described above:

---- [debuginfo-gdb] debuginfo/var-captured-in-sendable-closure.rs stdout ----
        NOTE: compiletest thinks it is using GDB version 7.7

        error: line not found in debugger output: $2 = {a = -2, b = 3.5, c = 4}

        status: exit code: 0
        command: gdb -quiet -batch -nx -command=x86_64-unknown-linux-gnu/test/debuginfo-gdb/var-captured-in-sendable-closure.debugger.script
        stdout:
        ------------------------------------------
        GNU gdb (Ubuntu 7.7-0ubuntu3.1) 7.7
        Copyright (C) 2014 Free Software Foundation, Inc.
        License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
        This is free software: you are free to change and redistribute it.

        There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
        and "show warranty" for details.
        This GDB was configured as "x86_64-linux-gnu".
        Type "show configuration" for configuration details.
        For bug reporting instructions, please see:
        <http://www.gnu.org/software/gdb/bugs/>.
        Find the GDB manual and other documentation resources online at:
        <http://www.gnu.org/software/gdb/documentation/>.
        For help, type "help".
        Type "apropos word" to search for commands related to "word".
        Breakpoint 1 at 0x1260: file src/test/debuginfo/var-captured-in-sendable-closure.rs, line 71.
        static void var-captured-in-sendable-closure::zzz(void);
        [Thread debugging using libthread_db enabled]
        Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

        Breakpoint 1, var-captured-in-sendable-closure::zzz () at src/test/debuginfo/var-captured-in-sendable-closure.rs:71
        71      fn zzz() {()}
        fn"fn"(1188) () at src/test/debuginfo/var-captured-in-sendable-closure.rs:61
        61              do_something(&constant, &a_struct.a, &*owned);
        $1 = 1
        $2 = {a = -2, b = 3,5, c = 4}
        $3 = 5
        A debugging session is active.

                Inferior 1 [process 8577] will be killed.

        Quit anyway? (y or n) [answered Y; input not from terminal]

        ------------------------------------------
        stderr:
        ------------------------------------------

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

        task '[debuginfo-gdb] debuginfo/var-captured-in-sendable-closure.rs' failed at 'explicit failure', /home/riddler/cursus/rust/rust/src/compiletest/runtest.rs:1432


---- [debuginfo-gdb] debuginfo/var-captured-in-stack-closure.rs stdout ----
        NOTE: compiletest thinks it is using GDB version 7.7

        error: line not found in debugger output: $3 = {a = -3, b = 4.5, c = 5}

        status: exit code: 0
        command: gdb -quiet -batch -nx -command=x86_64-unknown-linux-gnu/test/debuginfo-gdb/var-captured-in-stack-closure.debugger.script
        stdout:
        ------------------------------------------

        GNU gdb (Ubuntu 7.7-0ubuntu3.1) 7.7
        Copyright (C) 2014 Free Software Foundation, Inc.
        License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
        This is free software: you are free to change and redistribute it.
        There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
        and "show warranty" for details.
        This GDB was configured as "x86_64-linux-gnu".
        Type "show configuration" for configuration details.
        For bug reporting instructions, please see:
        <http://www.gnu.org/software/gdb/bugs/>.
        Find the GDB manual and other documentation resources online at:
        <http://www.gnu.org/software/gdb/documentation/>.
        For help, type "help".
        Type "apropos word" to search for commands related to "word".
        Breakpoint 1 at 0x2130: file src/test/debuginfo/var-captured-in-stack-closure.rs, line 84.
        static void var-captured-in-stack-closure::zzz(void);
        [Thread debugging using libthread_db enabled]
        Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

        Breakpoint 1, var-captured-in-stack-closure::zzz () at src/test/debuginfo/var-captured-in-stack-closure.rs:84
        84      fn zzz() {()}
        fn"fn"(1554) () at src/test/debuginfo/var-captured-in-stack-closure.rs:78
        78              variable = constant + a_struct.a + struct_ref.a + *owned + *managed;
        $1 = 1
        $2 = 2
        $3 = {a = -3, b = 4,5, c = 5}
        $4 = {a = -3, b = 4,5, c = 5}
        $5 = 6
        $6 = 7
        A debugging session is active.

                Inferior 1 [process 8592] will be killed.

        Quit anyway? (y or n) [answered Y; input not from terminal]

        ------------------------------------------
        stderr:
        ------------------------------------------

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

        task '[debuginfo-gdb] debuginfo/var-captured-in-stack-closure.rs' failed at 'explicit failure', /home/riddler/cursus/rust/rust/src/compiletest/runtest.rs:1432



failures:
    [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/gdb-pretty-struct-and-enums-pre-gdb-7-7.rs
    [debuginfo-gdb] debuginfo/gdb-pretty-struct-and-enums.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

test result: FAILED. 54 passed; 39 failed; 5 ignored; 0 measured

task '<main>' failed at 'Some tests failed', /home/riddler/cursus/rust/rust/src/compiletest/compiletest.rs:265
make: *** [tmp/check-stage2-T-x86_64-unknown-linux-gnu-H-x86_64-unknown-linux-gnu-debuginfo-gdb.ok] Error 101

I mentioned this issue in #rust last evening and was advised to file it as an issue. Please let me know if I can help resolve this issue by providing more information or trying a different setting/config.

@jdm
Copy link
Contributor

jdm commented Sep 21, 2014

This looks like a locale-related issue, given:
$2 = {a = -2, b = 3,5, c = 4} vs. the expected $2 = {a = -2, b = 3.5, c = 4} (, vs . for floating point values).

@jdm jdm added the A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) label Sep 21, 2014
@jdm
Copy link
Contributor

jdm commented Sep 21, 2014

cc @michaelwoerister

@michaelwoerister
Copy link
Member

Yes, I've had that issue too and changing the systemwide number format fixed it. But we should see if we can't make our test suite independent of the system's locale...

Thanks for the detailed bug report!

@oskchaitanya
Copy link
Contributor Author

If this is the kind of bug that a newbie can handle, I'll try to fix it.
I started with rust just some minutes ago and am going through the guide
at the moment.

On 21-09-14 20:30, Michael Woerister wrote:

Yes, I've had that issue too and changing the systemwide number format
fixed it. But we should see if we can't make our test suite
independent of the system's locale...

Thanks for the detailed bug report!


Reply to this email directly or view it on GitHub
#17423 (comment).

@michaelwoerister
Copy link
Member

If this is the kind of bug that a newbie can handle, I'll try to fix it.

Sure, if you want to give it a try, just go ahead. If you need any help you can post questions right here.

@michaelwoerister michaelwoerister changed the title gdb debug info testing fails 'make check' (not just individual test failures) GDB debuginfo tests depend on operating system locale Sep 22, 2014
@oskchaitanya
Copy link
Contributor Author

Here's my first attempt at solving this (works fine for me):
#17463

However, I am not sure if this is a good way to do it. I'll eagerly wait for you folks to review it and see what could be improved (if needed).

oskchaitanya added a commit to oskchaitanya/rust that referenced this issue Sep 23, 2014
bors added a commit that referenced this issue Sep 24, 2014
Setting LC_ALL to C helps keep gdb's output consistent ('print' gives us expected output). This fixes #17423. I do not have access to a windows/mac machines to test this. I've only tested it on an x86_64 linux box.
@michaelwoerister
Copy link
Member

👍

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

Successfully merging a pull request may close this issue.

3 participants