Bug 2121369

Summary: ppc64le: lldb loses connection with lldbserver
Product: [Fedora] Fedora Reporter: Jesus Checa <jchecahi>
Component: lldbAssignee: Nikita Popov <npopov>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: airlied, jan, jchecahi, kkleine, npopov, sguelton, siddharth.kde, tbaeder, tstellar
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: ppc64le   
OS: Unspecified   
Whiteboard:
Fixed In Version: lldb-15.0.0-3.fc38 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-10-18 15:59:03 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 Jesus Checa 2022-08-25 09:33:04 UTC
This bug was initially created as a copy of Bug #2052982

I am copying this bug because: 
The bug described is identical to the original bug. To reproduce this in Fedora it's enough with the following steps:

$ dnf -yq install lldb
$ lldb true                                                                                    
(lldb) target create "true"
Current executable set to 'true' (powerpc64le).
(lldb) b main
Breakpoint 1: where = true`main + 8, address = 0x0000000000010688
(lldb) run
Process 2546 launched: '/usr/bin/true' (powerpc64le)
Process 2546 exited with status = -1 (0xffffffff) lost connection
(lldb) 

Description of problem:
lldb loses connection with lldbserver when trying to run a simple program in ppc64le

Version-Release number of selected component (if applicable):
python-lit-13.0.1-1.el9
llvm-toolset-13.0.1-1.el9
llvm-13.0.1-1.el9
lldb-13.0.1-1.el9
compiler-rt-13.0.1-1.el9
clang-13.0.1-1.el9
lld-13.0.1-1.el9
libomp-13.0.1-1.el9


How reproducible:
100%

Steps to Reproduce:
$ cat test.cpp 
#include <stdio.h>
#include <vector>
int
main ()
{
  std::vector<int> v (1, 2);
  std::vector<int>::iterator it(v.begin());
  return 0;
}

1. g++ -g test.cpp
2. lldb -o run -- a.out

Actual results:
[root@ibm-p9z-23-lp7 lldb-test]# lldb -o run -- a.out
(lldb) target create "a.out"
Current executable set to '/root/lldb-test/a.out' (powerpc64le).
(lldb) run
Process 2274151 exited with status = -1 (0xffffffff) lost connection
Process 2274151 launched: '/root/lldb-test/a.out' (powerpc64le)

Expected results:
Successful run and "Process XXXXXXX exited with status = 0 (0x00000000)" message.

Additional info:
Test coming from upstream testcase: https://src.fedoraproject.org/rpms/lldb/blob/rawhide/f/tests/python-embedded-interpreter

Comment 1 Timm Bäder 2022-08-25 13:21:27 UTC
We probably need to work around this in the same way we did in CentOS: https://gitlab.com/redhat/centos-stream/rpms/lldb/-/commit/60cb7465abb85cf15ee53c44f7bad83d44858db1

Since "PPC64 in lldb is not very well maintained" (from https://github.com/llvm/llvm-project/issues/54520).

@nikic, can you just take that patch from CentOS LLDB and use it in Fedora as well?

Comment 2 Nikita Popov 2022-08-29 13:04:45 UTC
https://src.fedoraproject.org/rpms/lldb/pull-request/52 to add the patch to Fedora.

Comment 3 Fedora Update System 2022-10-18 15:51:36 UTC
FEDORA-2022-0c7796b6a7 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2022-0c7796b6a7

Comment 4 Fedora Update System 2022-10-18 15:59:03 UTC
FEDORA-2022-0c7796b6a7 has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.