Bug 2052982

Summary: ppc64le: lldb loses connection with lldbserver
Product: Red Hat Enterprise Linux 9 Reporter: Jesus Checa <jchecahi>
Component: lldbAssignee: Timm Bäder <tbaeder>
Status: CLOSED ERRATA QA Contact: Jesus Checa <jchecahi>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 9.0CC: fweimer, mprchlik, sipoyare, tbaeder, tstellar
Target Milestone: rcKeywords: Bugfix, Triaged, ZStream
Target Release: ---   
Hardware: ppc64le   
OS: Unspecified   
Whiteboard:
Fixed In Version: lldb-14.0.0-1.el9 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of:
: 2079140 (view as bug list) Environment:
Last Closed: 2022-11-15 10:19:00 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:
Bug Depends On:    
Bug Blocks: 2079140    

Description Jesus Checa 2022-02-10 11:51:05 UTC
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 2 Timm Bäder 2022-02-22 11:50:14 UTC
This is fixed in main and only happens when linking against the llvm dylib.

I will try to bisect but the Beaker machine I got is pretty slow.

Comment 7 Jesus Checa 2022-05-13 11:12:57 UTC
Build lldb-14.0.0-1.el9 fixes the issue. Now lldb connects and debugs the target executable properly:

+ rpm -q --requires lldb
python3-lldb
+ grep python3-lldb
+ g++ -g test.cpp
+ lldb -b -o 'breakpoint set --file test.cpp --line 7' -o run -o 'p v' -- a.out
+ tee lldb.log
(lldb) target create "a.out"
Current executable set to '/var/tmp/tmt/run-128/tests/build-gating/discover/lldb-upstream/tests/tests/python-embedded-interpreter/a.out' (powerpc64le).
(lldb) breakpoint set --file test.cpp --line 7
Breakpoint 1: where = a.out`main + 108 at test.cpp:7:40, address = 0x0000000010000a38
(lldb) run
Process 36322 stopped
* thread #1, name = 'a.out', stop reason = breakpoint 1.1
    frame #0: 0x0000000010000a38 a.out`main at test.cpp:7:40
   4   	main ()
   5   	{
   6   	  std::vector<int> v (1, 2);
-> 7   	  std::vector<int>::iterator it(v.begin());
    	                                       ^
   8   	  return 0;
   9   	}
Process 36322 launched: '/var/tmp/tmt/run-128/tests/build-gating/discover/lldb-upstream/tests/tests/python-embedded-interpreter/a.out' (powerpc64le)
(lldb) p v
(std::vector<int, std::allocator<> >) $0 = size=1 {
  [0] = 2
}
++ grep -e '(std::vector<int, std::allocator<> >) $0 = size=1 {' -e '\[0\] = 2' lldb.log
++ wc -l
+ test 2 -eq 2
+ rm lldb.log

Comment 17 errata-xmlrpc 2022-11-15 10:19:00 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 (llvm-toolset bug fix and enhancement update), 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/RHBA-2022:8092

Comment 18 Timm Bäder 2023-02-17 11:03:38 UTC
*** Bug 2009469 has been marked as a duplicate of this bug. ***