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

debuginfo/empty-string.rs test failed on Linux #63436

Closed
tesuji opened this issue Aug 10, 2019 · 4 comments
Closed

debuginfo/empty-string.rs test failed on Linux #63436

tesuji opened this issue Aug 10, 2019 · 4 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. O-linux Operating system: Linux T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@tesuji
Copy link
Contributor

tesuji commented Aug 10, 2019

When I run x.py test on Linux, debuginfo/empty-string.rs test failed with
the following error:

Check compiletest suite=debuginfo mode=debuginfo-gdb+lldb (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)

running 122 tests
.iiiii..ii.....i..i...i..i.iFi..i.ii..iii....ii.ii....i..........iiii..........i.i.ii..ii.......ii.i 100/122
.iii.....iiiiii.....ii
failures:

---- [debuginfo-gdb+lldb] debuginfo/empty-string.rs stdout ----
NOTE: compiletest thinks it is using GDB with native rust support
NOTE: compiletest thinks it is using GDB version 7012000

error: line not found in debugger output: $2 = ""
status: exit code: 0
command: "/usr/bin/gdb" "-quiet" "-batch" "-nx" "-command=/home/lzutao/forked/rust/compiler-rust/build/x86_64-unknown-linux-gnu/test/debuginfo/empty-string/empty-string.debugger.script"
stdout:
------------------------------------------
GNU gdb (Debian 7.12-6) 7.12.0.20161007-git
Copyright (C) 2016 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 0x267f: file /home/lzutao/forked/rust/compiler-rust/src/test/debuginfo/empty-string.rs, line 32.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Breakpoint 1, empty_string::main::h4739d54fd70936a5 () at /home/lzutao/forked/rust/compiler-rust/src/test/debuginfo/empty-string.rs:32
32          zzz(); // #break
$1 = ""
$2 = &str {data_ptr: 0x555555554a4e "attempt to create unaligned or null slicesrc/libcore/slice/mod.rsattempt to create slice covering half the address space\000", length: 0}
A debugging session is active.

        Inferior 1 [process 6653] will be killed.

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

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

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



failures:
    [debuginfo-gdb+lldb] debuginfo/empty-string.rs

test result: FAILED. 73 passed; 1 failed; 48 ignored; 0 measured; 0 filtered out

thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:536:22
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

command did not execute successfully: "/home/lzutao/forked/rust/compiler-rust/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/home/lzutao/forked/rust/compiler-rust/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/home/lzuta
o/forked/rust/compiler-rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/home/lzutao/forked/rust/compiler-rust/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/home/lzutao/forked/rust/compiler-rust/src/tes
t/debuginfo" "--build-base" "/home/lzutao/forked/rust/compiler-rust/build/x86_64-unknown-linux-gnu/test/debuginfo" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "debuginfo-gdb+lldb" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llv
m-filecheck" "/home/lzutao/forked/rust/compiler-rust/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--nodejs" "/home/lzutao/.local/bin/node" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/home/lzutao/forked/rust/compiler-rust/build/
x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/home/lzutao/forked/rust/compiler-rust/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-py
thon" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "9.0.0-rust-1.38.0-dev-48818e9f5\n" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" ""
expected success, got: exit code: 101

Metadata

Git commits: d19a359

@tesuji

This comment has been minimized.

@rustbot rustbot added A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) A-testsuite Area: The testsuite used to check the correctness of rustc O-linux Operating system: Linux T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 10, 2019
@jonas-schievink jonas-schievink added the C-bug Category: This is a bug. label Aug 10, 2019
@tesuji
Copy link
Contributor Author

tesuji commented Aug 17, 2019

It seems like gdb cannot load the pretty printer:
Run the script manually, I got:

% "/usr/bin/gdb" "-quiet" "-nx" "-command=/home/lzutao/forked/rust/compiler-rust/build/x86_64-unknown-linux-gnu/test/debuginfo/empty-string/empty-string.debugger.script"       
GNU gdb (Debian 7.12-6) 7.12.0.20161007-git
Copyright (C) 2016 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".
Traceback (most recent call last):
  File "/home/lzutao/forked/rust/compiler-rust/src/etc/gdb_load_rust_pretty_printers.py", line 2, in <module>
    import gdb_rust_pretty_printing
ImportError: No module named 'gdb_rust_pretty_printing'
Breakpoint 1 at 0x263f: file /home/lzutao/forked/rust/compiler-rust/src/test/debuginfo/empty-string.rs, line 32.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Breakpoint 1, empty_string::main::h4739d54fd70936a5 () at /home/lzutao/forked/rust/compiler-rust/src/test/debuginfo/empty-string.rs:32
32          zzz(); // #break
$1 = alloc::string::String {vec: alloc::vec::Vec<u8> {buf: alloc::raw_vec::RawVec<u8, alloc::alloc::Global> {ptr: core::ptr::unique::Unique<u8> {pointer: 0x1 <error: Cannot access memory at address 0x1>, _marker: core::marker::PhantomData<u8>}, cap: 0, a: alloc::alloc::Gl
obal}, len: 0}}
$2 = &str {data_ptr: 0x5555555549fe "attempt to create unaligned or null slicesrc/libcore/slice/mod.rsattempt to create slice covering half the address space\000", length: 0}
A debugging session is active.

        Inferior 1 [process 14010] will be killed.

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

@tesuji
Copy link
Contributor Author

tesuji commented Aug 17, 2019

rust-gdb load and run the script fine.

@wesleywiser
Copy link
Member

Visited during wg-debugging triage. We can't repro this and we think what occurred is that gdb 7 (from the bug report) is simply too old for our visualization scripts to work correctly. The test in question currently contains a // min-gdb-version: 8.1 directive so this shouldn't happen again.

As such, we're going to close this since it can't be repro'd.

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. O-linux Operating system: Linux 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

4 participants