Open elias36 opened 6 years ago
Cc @rust-lang/compiler
Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
(gdb) bt
No stack.
This part indicates that by the time bt
was run, the process was already gone.
Which is a bit surprising, you would think a SIGSEGV
would get caught by gdb
.
With the existing information I'm not sure I can provide any help.
Thanks for the feedback. Please send any instructions for getting further information that may be useful.
Oh if you're using rustup
, then rustc
would be a wrapper, and not the actual executable you need to run inside gdb
, but I don't know where to find the real one. cc @alexcrichton
rustup which rustc
should do it.
Thanks. rustup is not installed.
Maybe set a breakpoint on main
before you run, so we can at least establish if you’re even getting that far? (I’m personally wondering if this is something going wrong with dynamic library loading or linking...)
Yep, thanks for the tip:
$ gdb -quiet --args rustc --version
Reading symbols from rustc...(no debugging symbols found)...done.
(gdb) break main
Breakpoint 1 at 0xa10
(gdb) run
Starting program: /usr/local/bin/rustc --version
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
Breakpoint 1, 0x80000a10 in main ()
(gdb) bt
#0 0x80000a10 in main ()
(gdb) list
1 /* Data for i386 version of processor capability information.
2 Copyright (C) 2001-2013 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4 Contributed by Ulrich Drepper <drepper@redhat.com>, 2001.
5
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
10
(gdb)
What about the start of the main
that’s in Rust? The code for which you showed list
output looks like the code for gnu libc?
Does the crash still happen if you continue
From such a breakpoint? (I was going to ask you to step through lines via next
, but I don’t think that will be fruitful it you’re not using a local build ...
Does the crash occur on a locally built rustc
?
1 & 2: I found the rustc::main::h8593b8c0c617293e
function which may relate to Rust's main
function:
[root@s7netserver dev]# gdb -quiet --args rustc --version
Reading symbols from rustc...(no debugging symbols found)...done.
(gdb) break rustc::main::h8593b8c0c617293e
Breakpoint 1 at 0x9f0
(gdb) run
Starting program: /usr/local/bin/rustc --version
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
Breakpoint 1, 0x800009f0 in rustc::main::h8593b8c0c617293e ()
(gdb) continue
Continuing.
Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
(gdb)
2: using next
:
[root@s7netserver dev]# gdb -quiet --args rustc --version
Reading symbols from rustc...(no debugging symbols found)...done.
(gdb) break rustc::main::h8593b8c0c617293e
Breakpoint 1 at 0x9f0
(gdb) run
Starting program: /usr/local/bin/rustc --version
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
Breakpoint 1, 0x800009f0 in rustc::main::h8593b8c0c617293e ()
(gdb) next
Single stepping until exit from function _ZN5rustc4main17h8593b8c0c617293eE,
which has no line number information.
Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
(gdb)
3: A segmentation fault occurs when trying to build rustc. Note that cmake is version 2.8.12.2 instead of the specified 3.4.3 or later, and git is not used:
[root@s7netserver rustc-1.27.2-src]# ./x.py build && sudo ./x.py install
<output deleted>
failed to run: /root/dev/rust/rustc-1.27.2-src/build/i686-unknown-linux-gnu/stage0/bin/cargo build --manifest-path /root/dev/rust/rustc-1.27.2-src/src/bootstrap/Cargo.toml
Build completed unsuccessfully in 0:01:06
[root@s7netserver rustc-1.27.2-src]# /root/dev/rust/rustc-1.27.2-src/build/i686-unknown-linux-gnu/stage0/bin/cargo build --manifest-path /root/dev/rust/rustc-1.27.2-src/src/bootstrap/Cargo.toml
Segmentation fault
I got this output from gdb about the functions it comes across:
[root@s7netserver dev]# gdb -quiet --args rustc --version
Reading symbols from rustc...(no debugging symbols found)...done.
(gdb) rbreak .
<output deleted>
(gdb) commands
Type commands for breakpoint(s) 1-31, one per line.
End with a line saying just "end".
>continue
>end
(gdb) run
Starting program: /usr/local/bin/rustc --version
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
<output deleted>
---Type <return> to continue, or q <return> to quit---
Breakpoint 4, 0x800007a0 in __rde_alloc@plt ()
Breakpoint 24, 0x80000a50 in __rust_alloc ()
Breakpoint 4, 0x800007a0 in __rde_alloc@plt ()
Breakpoint 24, 0x80000a50 in __rust_alloc ()
Breakpoint 4, 0x800007a0 in __rde_alloc@plt ()
Breakpoint 24, 0x80000a50 in __rust_alloc ()
Breakpoint 4, 0x800007a0 in __rde_alloc@plt ()
Breakpoint 24, 0x80000a50 in __rust_alloc ()
Breakpoint 4, 0x800007a0 in __rde_alloc@plt ()
Breakpoint 26, 0x80000ab0 in __rust_realloc ()
Breakpoint 6, 0x800007c0 in __rde_realloc@plt ()
Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
(gdb)
https://github.com/rust-lang/rust/issues/73527 makes me wonder if there's some random codegen problem in LLVM for i686 that rustc sometimes hits...
After installing rust with
$ curl -sSf https://static.rust-lang.org/rustup.sh | sh
(following info found at https://github.com/rust-lang-nursery/rustup.rs/issues/695), a segmentation fault occurs when running rustc.I tried the following code and received notification of the the fault instead of the version string:
When running the command via strace, the version string displays:
Info about the system:
Backtrace:
gdb:
The gdb 'edit' command leads to this being displayed:
Post made by me on the Rust forum in relation to this issue: https://users.rust-lang.org/t/rustc-version-segmentation-fault/19100/5?u=zis