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-gdb tests failing #40557

Closed
nrc opened this issue Mar 15, 2017 · 9 comments
Closed

Some debuginfo-gdb tests failing #40557

nrc opened this issue Mar 15, 2017 · 9 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

Comments

@nrc
Copy link
Member

nrc commented Mar 15, 2017

On Linux, Ubuntu 16.10, GDB v7.11.90. The following tests fail:

    [debuginfo-gdb] debuginfo-gdb/limited-debuginfo.rs
    [debuginfo-gdb] debuginfo-gdb/simple-struct.rs
    [debuginfo-gdb] debuginfo-gdb/simple-tuple.rs

Seems to be an issue with output formatting/pretty printing, e.g.,

error: line not found in debugger output: $1 = simple_struct::NoPadding16 {x: 1000, y: -1001}
[...]
Breakpoint 1 at 0x92e: file /home/ncameron/rust1/src/test/debuginfo/simple-struct.rs, line 233.
$1 = {x = 1000, y = -1001}

This appears to be a regression - the same machine was passing tests last week (or maybe the week before).

cc @michaelwoerister

@nrc nrc 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 Mar 15, 2017
@nrc
Copy link
Member Author

nrc commented Mar 15, 2017

cc #40184 which looks similar-ish (I'm 99% sure I haven't changed my GDB install since these tests passed for me though).

@TimNN
Copy link
Contributor

TimNN commented Mar 16, 2017

@nrc: Could you post a bit more of the logs? I'm especially interested in the gdb version conpiletest detected and if it thinks that gdb has native rust support (frome the line not found error above, it probaly thinks it does).

@nrc
Copy link
Member Author

nrc commented Mar 17, 2017

Sure:

---- [debuginfo-gdb] debuginfo-gdb/simple-struct.rs stdout ----
	NOTE: compiletest thinks it is using GDB with native rust support
NOTE: compiletest thinks it is using GDB version 7011090

error: line not found in debugger output: $1 = simple_struct::NoPadding16 {x: 1000, y: -1001}
status: exit code: 0
command: /usr/bin/gdb -quiet -batch -nx -command=/home/ncameron/rust2/build/x86_64-unknown-linux-gnu/test/debuginfo/simple-struct.debugger.script
stdout:
------------------------------------------
GNU gdb (Ubuntu 7.11.90.20161005-0ubuntu1) 7.11.90.20161005-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 0x92e: file /home/ncameron/rust2/src/test/debuginfo/simple-struct.rs, line 233.
$1 = {x = 1000, y = -1001}
$2 = {x = 1, y = 2, z = 3}
$3 = {x = 4, y = 5, z = 6}
$4 = {a = 7, b = 8, c = 9, d = 10}
$5 = {x = 11, y = 12}
$6 = {x = 13, y = 14}
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Breakpoint 1, simple_struct::main () at /home/ncameron/rust2/src/test/debuginfo/simple-struct.rs:233
233	    zzz(); // #break
$7 = simple_struct::NoPadding16 {x: 10000, y: -10001}
$8 = simple_struct::NoPadding32 {x: -10002, y: -10003.5, z: 10004}
$9 = simple_struct::NoPadding64 {x: -10005.5, y: 10006, z: 10007}
$10 = simple_struct::NoPadding163264 {a: -10008, b: 10009, c: 10010, d: 10011}
$11 = simple_struct::InternalPadding {x: 10012, y: -10013}
$12 = simple_struct::PaddingAtEnd {x: -10014, y: 10015}
$13 = simple_struct::NoPadding16 {x: 100, y: -101}
$14 = simple_struct::NoPadding32 {x: -15, y: -16, z: 17}
$15 = simple_struct::NoPadding64 {x: -18, y: 19, z: 20}
$16 = simple_struct::NoPadding163264 {a: -21, b: 22, c: 23, d: 24}
$17 = simple_struct::InternalPadding {x: 25, y: -26}
$18 = simple_struct::PaddingAtEnd {x: -27, y: 28}
[Inferior 1 (process 13879) exited normally]

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

@MaloJaffre
Copy link
Contributor

MaloJaffre commented Mar 18, 2017

Same error with GDB version 7012001 and native rust support, on Arch Linux.
I have enabled debuginfo and debuginfo-lines in config.toml, this might have an impact.

@TimNN
Copy link
Contributor

TimNN commented Mar 18, 2017

This is probably a duplicate of #39838 with more discussion in #40351, summary: #![omit_gdb_pretty_printer_section] used in the debuginfo tests doesn't work if the pretty printer section is included in libraries since the output of the pretty printer is incompatible with the output of gdb with rust support.

@eddyb
Copy link
Member

eddyb commented Mar 19, 2017

For anyone who wants to work around it, this did the trick for me:

touch build/x86_64-unknown-linux-gnu/test/debuginfo/{limited-debuginfo,simple-struct,simple-tuple}.rs-H-x86_64-unknown-linux-gnu-T-x86_64-unknown-linux-gnu-S-stage1-x86_64-unknown-linux-gnu.stamp

You'll have to adjust for build triple and stage number, of course.

@nodakai
Copy link
Contributor

nodakai commented Apr 16, 2017

With my Debian GDB 7.12, set language rust after the file command seems to do the trick (i.e. force GDB to use Rust-like output format.) It should probably be guarded by if config.gdb_native_rust as GDB < 7.12 will error out upon finding the unrecognized source language name.

On the other hand we have an option of forcing newer GDBs to use C-like output format. What do you folks think? CC: @amboar

@infinity0
Copy link
Contributor

Confirmed this bug exists on 1.17.0 with Debian GDB 7.12-6 and that @nodakai's patch works, thanks!

diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index 1ec0838d4..51ab38b1a 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -645,6 +645,9 @@ actual:\n\
                 script_str.push_str(&format!("file {}\n",
                                              exe_file.to_str().unwrap()
                                              .replace(r"\", r"\\")));
+                if self.config.gdb_native_rust {
+                    script_str.push_str("set language rust\n");
+                }
 
                 // Add line breakpoints
                 for line in &breakpoint_lines {

@eddyb
Copy link
Member

eddyb commented May 10, 2017

Huh, has anyone opened a PR yet? I (incorrectly) assumed we did all the detection we reasonably could and that it wasn't enough.

frewsxcv added a commit to frewsxcv/rust that referenced this issue May 10, 2017
frewsxcv added a commit to frewsxcv/rust that referenced this issue May 11, 2017
frewsxcv added a commit to frewsxcv/rust that referenced this issue May 11, 2017
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
Projects
None yet
Development

No branches or pull requests

6 participants