Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2061892

Summary: gdb: Unable to parse values in xmm registers for sdt probes.
Product: Red Hat Enterprise Linux 9 Reporter: Carlos O'Donell <codonell>
Component: gdbAssignee: Andrew Burgess <aburgess>
gdb sub component: system-version QA Contact: qe-baseos-tools-bugs
Status: CLOSED WONTFIX Docs Contact:
Severity: high    
Priority: low CC: aburgess, gdb-bugs, keiths, ohudlick
Version: 9.0Keywords: Bugfix, Triaged
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-08 07:28:40 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 Carlos O'Donell 2022-03-08 17:05:55 UTC
Description of problem:
gdb is unable to parse sdt probe arguments in xmm registers.


Version-Release number of selected component (if applicable):
gdb 10.2-9.el9

How reproducible:

Always reproducible. Use a simple pthread_create/pthread_join example and then:

break main
start
info probes stap libc
break *[address of probe for pthread_start]
continue
show convenience
...
$_probe_arg11 = <error: Invalid probe argument 11 -- probe has 3 arguments available>
$_probe_arg10 = <error: Invalid probe argument 10 -- probe has 3 arguments available>
$_probe_arg9 = <error: Invalid probe argument 9 -- probe has 3 arguments available>
$_probe_arg8 = <error: Invalid probe argument 8 -- probe has 3 arguments available>
$_probe_arg7 = <error: Invalid probe argument 7 -- probe has 3 arguments available>
$_probe_arg6 = <error: Invalid probe argument 6 -- probe has 3 arguments available>
$_probe_arg5 = <error: Invalid probe argument 5 -- probe has 3 arguments available>
$_probe_arg4 = <error: Invalid probe argument 4 -- probe has 3 arguments available>
$_probe_arg3 = <error: Invalid probe argument 3 -- probe has 3 arguments available>
$_probe_arg2 = 0
$_probe_arg1 = 4198902
$_probe_arg0 = <error: Invalid cast.>
               ^^^^^^^^^^^^^^^^^^^^^^ Broken due to xmmo0 usage.
$_probe_argc = 3

$_probe_arg2 is 0 because NULL was passed as the arg to pthread_create().
-- Works because it's 8@1608(%rbx) 
$_probe_arg1 is the correct address of the start function e.g. 0x4011f6 <worker>
-- Works because it's 8@1600(%rbx) 
$_probe_arg0 is broken in gdb because of the use of xmm0.
-- Doesn't work because 8@%xmm0 uses %xmm0.

This is a blocker IMO since probes using xmm0 looks broken in gdb too.

Actual results:
- Prints <erro: Invalid cast.>

Expected results:
- Prints the value.

Comment 1 Carlos O'Donell 2022-03-08 17:07:39 UTC
We have two probes that use xmm registers in libc:

  stapsdt              0x0000004d       NT_STAPSDT (SystemTap probe descriptors)            Provider: libc
    Name: pthread_start
    Location: 0x00000000000a456b, Base: 0x00000000001c8658, Semaphore: 0x0000000000000000
    Arguments: 8@%xmm0 8@1600(%rbx) 8@1608(%rbx)
  stapsdt              0x00000054       NT_STAPSDT (SystemTap probe descriptors)            Provider: libc
    Name: pthread_create
    Location: 0x00000000000a4d28, Base: 0x00000000001c8658, Semaphore: 0x0000000000000000
    Arguments: 8@%xmm1 8@8(%rsp) 8@16(%rsp) 8@24(%rsp)

Comment 3 Andrew Burgess 2022-03-15 17:36:31 UTC
I've posted this patch to the upstream gdb mailing list:

  https://sourceware.org/pipermail/gdb-patches/2022-March/186632.html

This patch allows a user to stop at a probe and view the argument in an xmm register.

What's missing in this patch is GDB's agent expression support (used for the fast tracepoints), so a user can't place a tracepoint at a probe (that uses xmm registers) and collect the arguments.  I want to see how the approach I'm proposing in that patch goes down before I start worrying about agent expression support.

Comment 5 RHEL Program Management 2023-09-08 07:28:40 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.