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/pretty-uninitialized-vec fails with Cannot access memory at address 0x7fffff7fe000 #64343

Closed
mati865 opened this issue Sep 10, 2019 · 13 comments · Fixed by #66576
Closed
Assignees
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. P-high High priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@mati865
Copy link
Contributor

mati865 commented Sep 10, 2019

---- [debuginfo-gdb+lldb] debuginfo/pretty-uninitialized-vec.rs stdout ----
NOTE: compiletest thinks it is using GDB with native rust support
NOTE: compiletest thinks it is using GDB version 8003000

error: gdb failed to execute
status: exit code: 1
command: "/usr/bin/gdb" "-quiet" "-batch" "-nx" "-command=/home/mateusz/Projects/rust/rust/build/x86_64-unknown-linux-gnu/test/debuginfo/pretty-uninitialized-vec/pretty-uninitialized-vec.debugger.script"
stdout:
------------------------------------------
GNU gdb (GDB) 8.3
Copyright (C) 2019 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-pc-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 0x16c4: file /home/mateusz/Projects/rust/rust/src/test/debuginfo/pretty-uninitialized-vec.rs, line 21.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".

Breakpoint 1, pretty_uninitialized_vec::main () at /home/mateusz/Projects/rust/rust/src/test/debuginfo/pretty-uninitialized-vec.rs:21
21	    zzz(); // #break
$1 = Vec<i32>(len: 93824992258736, cap: 140737479962624) = {

------------------------------------------
stderr:
------------------------------------------
/home/mateusz/Projects/rust/rust/build/x86_64-unknown-linux-gnu/test/debuginfo/pretty-uninitialized-vec/pretty-uninitialized-vec.debugger.script:10: Error in sourced command file:
Cannot access memory at address 0x7fffff7fe000

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



failures:
    [debuginfo-gdb+lldb] debuginfo/pretty-uninitialized-vec.rs
@xire28
Copy link

xire28 commented Sep 10, 2019

Related WIP pull request: #60826

@jonas-schievink jonas-schievink added 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. labels Sep 10, 2019
@Centril
Copy link
Contributor

Centril commented Sep 24, 2019

I'm getting this when running ./x.py clean && ./x.py test reliably: https://gist.github.com/rust-play/467eb762d03985ed871d1c0c72cbe32d.

@Centril Centril added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. I-nominated labels Sep 24, 2019
@rinon
Copy link
Contributor

rinon commented Sep 26, 2019

This test is also failing for me with GDB 8.3 on Arch. Same error.

As of GDB 8.3, batch mode causes GDB to exit with non-zero exit status if a command failed, per https://www.gnu.org/software/gdb/news/

GDB in batch mode now exits with status 1 if the last executed command failed.

We either need to execute the "failing" command (the print that accesses invalid memory) from python in gdb and ignore the exception thrown, or ignore the return code of gdb for this test.

@pnkfelix
Copy link
Member

pre-triage: not certain what priority to assign (tempted to do P-medium). Leaving nominated for dicsussion of priority at T-compiler meeting.

Also, I think I'll nominate #60826 for discussion there too.

@pnkfelix
Copy link
Member

topic is too big to handle in triage meeting. Plan is now to allocate steering meeting to topic; see: rust-lang/compiler-team#186

@pnkfelix
Copy link
Member

for now, tagging P-high because this is causing pain for T-release. Hopefully we'll figure something out in the aforementioned planning meeting. Removing nomination.

@pnkfelix pnkfelix added P-high High priority and removed I-nominated labels Sep 26, 2019
@pnkfelix
Copy link
Member

pnkfelix commented Oct 3, 2019

there's a planning meeting scheduled Oct 18th to discuss debuginfo; this will hopefully be addressed as part of that. See rust-lang/compiler-team#186

@pnkfelix
Copy link
Member

pnkfelix commented Oct 3, 2019

self-assigning to at least look into this as part of prep work for aforementioned planning meeting.

@pnkfelix pnkfelix self-assigned this Oct 3, 2019
@pnkfelix pnkfelix added the E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc label Oct 18, 2019
@mati865
Copy link
Contributor Author

mati865 commented Oct 18, 2019

@pnkfelix I'm confused by E-needs-bisection. AFAIK the issue here is the test is not compatible with more recent GDB versions, could you elaborate?

@Mark-Simulacrum
Copy link
Member

I believe the impression in the planning meeting was that a rustc change broke this test -- if it is a GDB version issue we can likely work to fix the test and bump GDB version requirements.

@rinon
Copy link
Contributor

rinon commented Oct 19, 2019

This was definitely a change to GDB that made the test fail. It still does the expected behavior, but GDB now returns a failure return code.

@pnkfelix pnkfelix removed the E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc label Oct 19, 2019
@pnkfelix
Copy link
Member

pnkfelix commented Nov 14, 2019

adding @Centril to assignee list to deal with the test suite stuff to T-release. (See also rust-lang/compiler-team#186 )

@pnkfelix
Copy link
Member

Of potential interest: This bug does not reproduce for me on a rustc build with debug = true in the config.toml; I have to turn the debug setting back to its default of false to reproduce the problem.

pnkfelix added a commit to pnkfelix/rust that referenced this issue Nov 20, 2019
…ed vec.

I based this solution on my reading of:

https://rethinkdb.com/blog/make-debugging-easier-with-custom-pretty-printers#what-is-still-to-be-done

That post claims that there is no clean way to check for garbage pointers, and
so this PR adopts the same solution of tentatively attempting to convert a
dererence to a string, which throws a clean exception on garbage that we can
catch and recover from.

I only made the change to vec and not the other pretty printers because I wanted
to focus my effort on the simplest thing that would resolve issue rust-lang#64343. In
particular, I *considered* generalizing this fix to work on the other datatypes
in the pretty-printing support library, but I don't want to invest effort in
that until after we resolve our overall debugging support strategy; see also
issues rust-lang#60826 and rust-lang#65564.
pietroalbini added a commit to pietroalbini/rust that referenced this issue Nov 22, 2019
…r, r=alexcrichton

made gdb pretty-printing more robust when printing uninitialized vec

made gdb pretty-printing more robust when printing uninitialized vec

I based this solution on my reading of:

https://rethinkdb.com/blog/make-debugging-easier-with-custom-pretty-printers#what-is-still-to-be-done

That post claims that there is no clean way to check for garbage pointers, and
so this PR adopts the same solution of tentatively attempting to convert a
dererence to a string, which throws a clean exception on garbage that we can
catch and recover from.

I only made the change to vec and not the other pretty printers because I wanted
to focus my effort on the simplest thing that would resolve issue rust-lang#64343. In
particular, I *considered* generalizing this fix to work on the other datatypes
in the pretty-printing support library, but I don't want to invest effort in
that until after we resolve our overall debugging support strategy; see also
issues rust-lang#60826 and rust-lang#65564.

Fix rust-lang#64343
@bors bors closed this as completed in e94f066 Nov 23, 2019
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. P-high High priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants