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 1718417

Summary: please backport fix for 'p' command regression
Product: Red Hat Enterprise Linux 8 Reporter: Dave Wysochanski <dwysocha>
Component: crashAssignee: Dave Anderson <anderson>
Status: CLOSED ERRATA QA Contact: Emma Wu <xiawu>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.0CC: ruyang
Target Milestone: rcKeywords: Regression, Reproducer
Target Release: 8.0Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: crash-7.2.6-2.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-11-05 20:53:48 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: 1690227    
Attachments:
Description Flags
commit b1a6e13a93661dfae7df15fe32862bddf4026c80 none

Description Dave Wysochanski 2019-06-07 17:18:11 UTC
Created attachment 1578406 [details]
commit b1a6e13a93661dfae7df15fe32862bddf4026c80

Description of problem:
Please backport the attached patch to RHEL8 as soon as reasonable.

commit b1a6e13a93661dfae7df15fe32862bddf4026c80
Author: Dave Anderson <anderson>
Date:   Tue May 21 14:09:13 2019 -0400

    Fix for a crash-7.2.6 regression to the "p" command.  Without the
    patch, a gdb pass-through command construct such as:
      p ((struct zone *)0xffff901e3ffda000)->min_slab_pages
    gets parsed incorrectly, and the "-" is mistaken for an argument
    option, and each of the subsequent characters are marked as an
    "invalid option".
    (dwysocha)


Version-Release number of selected component (if applicable):
crash-7.2.6-1.el8.x86_64

How reproducible:
Every time

Steps to Reproduce:
See patch or try to print a member of a struct with the print command by casting the pointer.

Actual results:
crash error

Expected results:
no crash error

Additional info:
Not sure if this was planned on next build but filing this in case it was forgotten.  Thanks.

Comment 3 Dave Wysochanski 2019-06-10 19:49:47 UTC
Thanks Dave A!.

QE - simple test to verify:

1. Run live crash
2. print any pointer as below such as task_struct of 'crash' executable with no spaces between the parenthesis and the pointer


FAILS:

[root@rhel8u0-node1-beta ~]# rpm -q crash
crash-7.2.6-1.el8.x86_64
      KERNEL: /usr/lib/debug/lib/modules/4.18.0-80.el8.x86_64/vmlinux  
    DUMPFILE: /proc/kcore
        CPUS: 1
        DATE: Mon Jun 10 15:46:36 2019
      UPTIME: 4 days, 06:41:32
LOAD AVERAGE: 0.49, 0.28, 0.12
       TASKS: 125
    NODENAME: rhel8u0-node1-beta.dwysocha.net
     RELEASE: 4.18.0-80.el8.x86_64
     VERSION: #1 SMP Wed Mar 13 12:02:46 UTC 2019
     MACHINE: x86_64  (1795 Mhz)
      MEMORY: 4 GB
         PID: 29722
     COMMAND: "crash"
        TASK: ffff888596b9af80  [THREAD_INFO: ffff888596b9af80]
         CPU: 0
       STATE: TASK_RUNNING (ACTIVE)

crash> bt
PID: 29722  TASK: ffff888596b9af80  CPU: 0   COMMAND: "crash"
(active)
crash> p (struct task_struct *)0xffff888596b9af80
A syntax error in expression, near `0xffff888596b9af80'.
p: gdb request failed: p (struct task_struct *)0xffff888596b9af80 0xffff888596b9af80
crash> 


PASS:


crash> [root@rhel8u0-node1-beta ~]# rpm -q crash
crash-7.2.6-2.el8.x86_64
[root@rhel8u0-node1-beta ~]# crash
...
      KERNEL: /usr/lib/debug/lib/modules/4.18.0-80.el8.x86_64/vmlinux  
    DUMPFILE: /proc/kcore
        CPUS: 1
        DATE: Mon Jun 10 15:48:41 2019
      UPTIME: 4 days, 06:43:37
LOAD AVERAGE: 0.59, 0.33, 0.15
       TASKS: 126
    NODENAME: rhel8u0-node1-beta.dwysocha.net
     RELEASE: 4.18.0-80.el8.x86_64
     VERSION: #1 SMP Wed Mar 13 12:02:46 UTC 2019
     MACHINE: x86_64  (1795 Mhz)
      MEMORY: 4 GB
         PID: 29789
     COMMAND: "crash"
        TASK: ffff888596b9af80  [THREAD_INFO: ffff888596b9af80]
         CPU: 0
       STATE: TASK_RUNNING (ACTIVE)

crash> bt
PID: 29789  TASK: ffff888596b9af80  CPU: 0   COMMAND: "crash"
(active)
crash> px (struct task_struct *)0xffff888596b9af80
$1 = (struct task_struct *) 0xffff888596b9af80
crash>

Comment 4 Dave Anderson 2019-06-10 20:13:22 UTC
Actually, a better test of your upstream patch would be to have an "-" in 
the gdb expression, with a double set of parentheses like this:

  crash> set 1
      PID: 1
  COMMAND: "systemd"
     TASK: ffff928cba240000  [THREAD_INFO: ffff928cba1cc000]
      CPU: 1
    STATE: TASK_INTERRUPTIBLE 
  crash> 

  crash> p ((struct task_struct *)0xffff928cba240000)->pid
  p: invalid option -- '>'
  p: invalid option -- 'p'
  p: invalid option -- 'i'
  Usage:
    p [-x|-d][-u] [expression | symbol[:cpuspec]]
  Enter "help p" for details.
  crash> 

With the patch applied:

  crash> set 1
      PID: 1
  COMMAND: "systemd"
     TASK: ffff928cba240000  [THREAD_INFO: ffff928cba1cc000]
      CPU: 1
    STATE: TASK_INTERRUPTIBLE 
  crash> 

  crash> p ((struct task_struct *)0xffff928cba240000)->pid
  $3 = 1
  crash>

Comment 8 errata-xmlrpc 2019-11-05 20:53:48 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/RHBA-2019:3349