Bug 1497800

Summary: something broken in ppc64 backtracing
Product: DevTools Reporter: Martin Cermak <mcermak>
Component: rustAssignee: Josh Stone <jistone>
Status: CLOSED ERRATA QA Contact: Martin Cermak <mcermak>
Severity: unspecified Docs Contact: Vladimír Slávik <vslavik>
Priority: unspecified    
Version: rust-toolset-7CC: emachado, jcajka, jistone, kanderso, law, sbharadw, tstellar, vslavik
Target Milestone: rc   
Target Release: 2018.4   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: Rust's backtrace library didn't support ppc64 ELFv1. Consequence: Backtraces printed during Rust panics with RUST_BACKTRACE=1 showed "<unknown>" symbol information. Fix: Rust's backtrace library has been updated in Rust 1.28 to include support for ppc64 ELFv1. Result: RUST_BACKTRACE=1 shows appropriate symbols.
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-11-13 15:24:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Martin Cermak 2017-10-02 17:22:20 UTC
Description of problem:
  The run-pass/backtrace.rs fails on ppc64

Version-Release number of selected component (if applicable):
  rust-toolset-7-rust-1.20.0-2.el7

How reproducible:
  100% on ppc64

Steps to Reproduce:
1. scl enable rust-toolset-7 llvm-toolset-7 bash
2. rpmbuild -bp rust.spec
3. go to src/test/run-pass
4. env RUSTC_BOOTSTRAP=1 rustc -O backtrace.rs
5. ./backtrace

Actual results:
 7.4 Server ppc64 # ./backtrace
thread 'main' panicked at 'bad output: thread 'main' panicked at 'explicit panic', backtrace.rs:24:8
stack backtrace:
   0: <unknown>
   1: <unknown>
   2: <unknown>
   3: <unknown>
   4: <unknown>
   5: <unknown>
   6: <unknown>
   7: <unknown>
   8: <unknown>
   9: <unknown>
  10: <unknown>
  11: <unknown>
  12: <unknown>
  13: <unknown>
', backtrace.rs:59:4
note: Run with `RUST_BACKTRACE=1` for a backtrace.
 7.4 Server ppc64 #

Expected results:
No output.

Comment 2 Josh Stone 2018-02-28 18:39:16 UTC
Deferring to a future release, but we'll keep the bug open for tracking.

Comment 11 Josh Stone 2018-07-31 22:32:49 UTC
Rust uses a fork of https://github.com/ianlancetaylor/libbacktrace, which is based on GCC's libbacktrace.  It appears that code just didn't handle .opd at all, which you need for PPC64 ELFv1 (big-endian).  This was reported in GCC 82368, fixed by Jakub in r257685, and will reach Rust in 1.28.

Comment 12 Josh Stone 2018-07-31 22:45:12 UTC
Rather, GCC r257658 was the actual fix; r257685 was a followup tweak.

Comment 21 errata-xmlrpc 2018-11-13 15:24:31 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2018:3584