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

many debuginfo tests fail with SIGSEGV, SIGILL, SIGABRT with gdb 11.2 on armhf (armv7-unknown-linux-gnueabihf) #96983

Closed
infinity0 opened this issue May 12, 2022 · 4 comments
Labels
C-bug Category: This is a bug.

Comments

@infinity0
Copy link
Contributor

This seems like a separate issue from #94458 as it only happens on armhf in Debian:

test [debuginfo-gdb] debuginfo/associated-types.rs ... FAILED
test [debuginfo-gdb] debuginfo/by-value-self-argument-in-trait-impl.rs ... FAILED
test [debuginfo-gdb] debuginfo/captured-fields-2.rs ... FAILED
test [debuginfo-gdb] debuginfo/closure-in-generic-function.rs ... FAILED
test [debuginfo-gdb] debuginfo/captured-fields-1.rs ... FAILED
test [debuginfo-gdb] debuginfo/destructured-fn-argument.rs ... FAILED
test [debuginfo-gdb] debuginfo/function-arguments.rs ... FAILED
test [debuginfo-gdb] debuginfo/generator-objects.rs ... FAILED
test [debuginfo-gdb] debuginfo/generator-locals.rs ... FAILED
test [debuginfo-gdb] debuginfo/generic-function.rs ... FAILED
test [debuginfo-gdb] debuginfo/generic-functions-nested.rs ... FAILED
test [debuginfo-gdb] debuginfo/generic-method-on-generic-struct.rs ... FAILED
test [debuginfo-gdb] debuginfo/generic-static-method-on-struct-and-enum.rs ... FAILED
test [debuginfo-gdb] debuginfo/lexical-scope-in-for-loop.rs ... FAILED
test [debuginfo-gdb] debuginfo/lexical-scope-in-match.rs ... FAILED
test [debuginfo-gdb] debuginfo/lexical-scope-in-if.rs ... FAILED
test [debuginfo-gdb] debuginfo/lexical-scope-in-stack-closure.rs ... FAILED
test [debuginfo-gdb] debuginfo/lexical-scope-in-unconditional-loop.rs ... FAILED
test [debuginfo-gdb] debuginfo/lexical-scope-in-unique-closure.rs ... FAILED
test [debuginfo-gdb] debuginfo/lexical-scope-in-while.rs ... FAILED
test [debuginfo-gdb] debuginfo/lexical-scope-with-macro.rs ... FAILED
test [debuginfo-gdb] debuginfo/method-on-generic-struct.rs ... FAILED
test [debuginfo-gdb] debuginfo/method-on-struct.rs ... FAILED
test [debuginfo-gdb] debuginfo/method-on-tuple-struct.rs ... FAILED
test [debuginfo-gdb] debuginfo/method-on-trait.rs ... FAILED
test [debuginfo-gdb] debuginfo/multi-cgu.rs ... FAILED
test [debuginfo-gdb] debuginfo/multiple-functions.rs ... FAILED
test [debuginfo-gdb] debuginfo/multiple-functions-equal-var-names.rs ... FAILED
test [debuginfo-gdb] debuginfo/name-shadowing-and-scope-nesting.rs ... FAILED
test [debuginfo-gdb] debuginfo/self-in-default-method.rs ... FAILED
test [debuginfo-gdb] debuginfo/self-in-generic-default-method.rs ... FAILED
test [debuginfo-gdb] debuginfo/shadowed-argument.rs ... FAILED
test [debuginfo-gdb] debuginfo/shadowed-variable.rs ... FAILED
test [debuginfo-gdb] debuginfo/simple-lexical-scope.rs ... FAILED
test [debuginfo-gdb] debuginfo/static-method-on-struct-and-enum.rs ... FAILED
test [debuginfo-gdb] debuginfo/step-into-match.rs ... FAILED
test [debuginfo-gdb] debuginfo/var-captured-in-sendable-closure.rs ... FAILED
test [debuginfo-gdb] debuginfo/var-captured-in-nested-closure.rs ... FAILED
test [debuginfo-gdb] debuginfo/var-captured-in-stack-closure.rs ... FAILED

Example errors:

Breakpoint 1 at 0x6e4: file /<<PKGBUILDDIR>>/src/test/debuginfo/associated-types.rs, line 111.
Breakpoint 2 at 0x77c: file /<<PKGBUILDDIR>>/src/test/debuginfo/associated-types.rs, line 118.
Breakpoint 3 at 0x7d8: file /<<PKGBUILDDIR>>/src/test/debuginfo/associated-types.rs, line 122.
Breakpoint 4 at 0x874: file /<<PKGBUILDDIR>>/src/test/debuginfo/associated-types.rs, line 130.
Breakpoint 5 at 0x8e8: file /<<PKGBUILDDIR>>/src/test/debuginfo/associated-types.rs, line 137.
Breakpoint 6 at 0x90c: file /<<PKGBUILDDIR>>/src/test/debuginfo/associated-types.rs, line 140.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".

Breakpoint 1, associated_types::assoc_struct<i32> (arg=...) at /<<PKGBUILDDIR>>/src/test/debuginfo/associated-types.rs:111
111         zzz(); // #break
$1 = associated_types::Struct<i32> {b: -1, b1: 0}

Program received signal SIGSEGV, Segmentation fault.
0x004005b0 in _start ()

------stderr------------------------------
/<<PKGBUILDDIR>>/build/armv7-unknown-linux-gnueabihf/test/debuginfo/associated-types.gdb/associated-types.debugger.script:17: Error in sourced command file:
No symbol 'inferred' in current context

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

error: gdb failed to execute
status: exit status: 1
command: "/usr/bin/gdb" "-quiet" "-batch" "-nx" "-command=/<<PKGBUILDDIR>>/build/armv7-unknown-linux-gnueabihf/test/debuginfo/associated-types.gdb/associated-types.debugger.script"
Breakpoint 1 at 0x734: file /<<PKGBUILDDIR>>/src/test/debuginfo/by-value-self-argument-in-trait-impl.rs, line 52.
Breakpoint 2 at 0x760: file /<<PKGBUILDDIR>>/src/test/debuginfo/by-value-self-argument-in-trait-impl.rs, line 64.
Breakpoint 3 at 0x788: file /<<PKGBUILDDIR>>/src/test/debuginfo/by-value-self-argument-in-trait-impl.rs, line 71.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".

Breakpoint 1, by_value_self_argument_in_trait_impl::{impl#0}::method (self=1111) at /<<PKGBUILDDIR>>/src/test/debuginfo/by-value-self-argument-in-trait-impl.rs:52
52              zzz(); // #break
$1 = 1111

Program received signal SIGILL, Illegal instruction.
0x004006b2 in __do_global_dtors_aux ()

------stderr------------------------------
/<<PKGBUILDDIR>>/build/armv7-unknown-linux-gnueabihf/test/debuginfo/by-value-self-argument-in-trait-impl.gdb/by-value-self-argument-in-trait-impl.debugger.script:14: Error in sourced command file:
No symbol 'self' in current context

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

error: gdb failed to execute
status: exit status: 1
command: "/usr/bin/gdb" "-quiet" "-batch" "-nx" "-command=/<<PKGBUILDDIR>>/build/armv7-unknown-linux-gnueabihf/test/debuginfo/by-value-self-argument-in-trait-impl.gdb/by-value-self-argument-in-trait-impl.debugger.script"

Most other failures are due to SIGSEGV or SIGILL, but we also have one SIGABRT:

Breakpoint 1 at 0x1088: method-on-generic-struct.rs:137. (2 locations)
Breakpoint 2 at 0x117c: method-on-generic-struct.rs:142. (2 locations)
Breakpoint 3 at 0x12c4: file /<<PKGBUILDDIR>>/src/test/debuginfo/method-on-generic-struct.rs, line 147.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".

Breakpoint 1, method_on_generic_struct::Struct<(u32, i32)>::self_by_ref<(u32, i32)> (self=0xfffeeb2c, arg1=-1, arg2=-2) at /<<PKGBUILDDIR>>/src/test/debuginfo/method-on-generic-struct.rs:137
137             zzz(); // #break
$1 = method_on_generic_struct::Struct<(u32, i32)> {x: (8888, -8888)}
$2 = -1
$3 = -2

Program received signal SIGABRT, Aborted.
0xf7d337d6 in ?? () from /lib/arm-linux-gnueabihf/libc.so.6

------stderr------------------------------
/<<PKGBUILDDIR>>/build/armv7-unknown-linux-gnueabihf/test/debuginfo/method-on-generic-struct.gdb/method-on-generic-struct.debugger.script:16: Error in sourced command file:
No symbol 'self' in current context

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

error: gdb failed to execute
status: exit status: 1
command: "/usr/bin/gdb" "-quiet" "-batch" "-nx" "-command=/<<PKGBUILDDIR>>/build/armv7-unknown-linux-gnueabihf/test/debuginfo/method-on-generic-struct.gdb/method-on-generic-struct.debugger.script"
@infinity0 infinity0 added the C-bug Category: This is a bug. label May 12, 2022
@infinity0 infinity0 changed the title Many debuginfo tests fail with SIGSEGV, SIGILL, SIGABRT with gdb 11.2 on armhf (armv7-unknown-linux-gnueabihf) 1.59 many debuginfo tests fail with SIGSEGV, SIGILL, SIGABRT with gdb 11.2 on armhf (armv7-unknown-linux-gnueabihf) May 12, 2022
@infinity0
Copy link
Contributor Author

I reproduced the failures with 1.58.1 on a Debian armhf machine, so it's not 1.59 specific.

@infinity0
Copy link
Contributor Author

infinity0 commented Jun 21, 2022

The issue exists all the way back to version 1.13 at https://static.rust-lang.org/dist/rust-1.13.0-armv7-unknown-linux-gnueabihf.tar.gz - using this to RUSTC_BOOTSTRAP=1 rustc -g src/test/debuginfo/associated-types.rs then running gdb -x dbg.script ./associated-types fails with SIGILL, with script dbg.script extracted from the build directory of 1.58.1:

set charset UTF-8
show version
set print pretty off
set language rust
break 'associated-types.rs':111
break 'associated-types.rs':118
break 'associated-types.rs':122
break 'associated-types.rs':130
break 'associated-types.rs':137
break 'associated-types.rs':140
run
print arg
continue
print inferred
print explicitly
continue
print arg
continue
print arg
continue
print a
print b
continue
print a
print b
continue
quit

The issue probably exists with all rustc versions, but I was unable to test versions earlier than 1.13 because they seem to link to an older incompatible libc that expects ld-linux.so.3 rather than the ld-linux-armhf.so.3 I had on this machine.

So it's likely an issue/regression with gdb 11.2 rather than rustc.

@infinity0
Copy link
Contributor Author

@infinity0 infinity0 changed the title 1.59 many debuginfo tests fail with SIGSEGV, SIGILL, SIGABRT with gdb 11.2 on armhf (armv7-unknown-linux-gnueabihf) many debuginfo tests fail with SIGSEGV, SIGILL, SIGABRT with gdb 11.2 on armhf (armv7-unknown-linux-gnueabihf) Jun 23, 2022
@luis-machado-arm
Copy link

Fixed in GDB now. Thanks for reporting it. Sorry it took a little while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug.
Projects
None yet
Development

No branches or pull requests

2 participants