Skip to content

LLVM 5 fails debuginfo/by-value-self-argument-in-trait-impl.rs #47611

Closed
@cuviper

Description

@cuviper

rustc compiled with LLVM 5 fails debuginfo/by-value-self-argument-in-trait-impl.rs on x86_64-unknown-linux-gnu. GDB fails to read self for the following impl in the test:

impl Trait for (f64, isize, isize, f64) {
    fn method(self) -> (f64, isize, isize, f64) {
        zzz(); // #break
        self
    }
}
Cannot access memory at address 0x40b15c8000000000

It's called with (4444.5, 5555, 6666, 7777.5).method(), and it just so happens that 4444.5 transmuted to a u64 is 0x40b15c8000000000, so there seems to be an indirection/deref problem in the debuginfo.

Full test output:

---- [debuginfo-gdb] debuginfo/by-value-self-argument-in-trait-impl.rs stdout ----
        NOTE: compiletest thinks it is using GDB with native rust support
NOTE: compiletest thinks it is using GDB version 8000001

error: line not found in debugger output: $3 = (4444.5, 5555, 6666, 7777.5)
status: exit code: 0
command: "/usr/bin/gdb" "-quiet" "-batch" "-nx" "-command=/home/jistone/rust/rust/build/x86_64-unknown-linux-gnu/test/debuginfo/by-value-self-argument-in-trait-impl.debugger.script"
stdout:
------------------------------------------
GNU gdb (GDB) Fedora 8.0.1-33.fc27
Copyright (C) 2017 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-redhat-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 0xf9c: file /home/jistone/rust/rust/src/test/debuginfo/by-value-self-argument-in-trait-impl.rs, line 59.
Breakpoint 2 at 0xfc0: file /home/jistone/rust/rust/src/test/debuginfo/by-value-self-argument-in-trait-impl.rs, line 71.
Breakpoint 3 at 0xfeb: file /home/jistone/rust/rust/src/test/debuginfo/by-value-self-argument-in-trait-impl.rs, line 78.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Breakpoint 1, <isize as by_value_self_argument_in_trait_impl::Trait>::method (self=1111) at /home/jistone/rust/rust/src/test/debuginfo/by-value-self-argument-in-trait-impl.rs:59
59              zzz(); // #break
$1 = 1111

Breakpoint 2, <by_value_self_argument_in_trait_impl::Struct as by_value_self_argument_in_trait_impl::Trait>::method (self=...) at /home/jistone/rust/rust/src/test/debuginfo/by-value-self-argument-in-trait-impl.rs:71
71              zzz(); // #break
$2 = by_value_self_argument_in_trait_impl::Struct {x: 2222, y: 3333}

Breakpoint 3, <(f64, isize, isize, f64) as by_value_self_argument_in_trait_impl::Trait>::method (self=<error reading variable: Cannot access memory at address 0x40b15c8000000000>) at /home/jistone/rust/rust/src/test/debuginfo/by-value-self-argument-in-trait-impl.rs:78
78              zzz(); // #break

------------------------------------------
stderr:
------------------------------------------
/home/jistone/rust/rust/build/x86_64-unknown-linux-gnu/test/debuginfo/by-value-self-argument-in-trait-impl.debugger.script:16: Error in sourced command file:
Cannot access memory at address 0x40b15c8000000000

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

thread '[debuginfo-gdb] debuginfo/by-value-self-argument-in-trait-impl.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:2884:9

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions