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 1712768

Summary: lsmem segfaults on ppc64 wih -o
Product: Red Hat Enterprise Linux 7 Reporter: ekulik
Component: util-linuxAssignee: Karel Zak <kzak>
Status: CLOSED ERRATA QA Contact: Radka Brychtova <rskvaril>
Severity: high Docs Contact:
Priority: urgent    
Version: 7.7CC: bugproxy, fkrska, hannsj_uhl, rmetrich, sgoveas
Target Milestone: rcKeywords: Patch, ZStream
Target Release: 7.8   
Hardware: ppc64   
OS: Linux   
Whiteboard:
Fixed In Version: util-linux-2.23.2-62.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1766091 (view as bug list) Environment:
Last Closed: 2020-03-31 20:00:10 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: 1689150, 1689420, 1766091    

Description ekulik 2019-05-22 08:35:08 UTC
Description of problem:
lsmem segfaults when using -o (--output).

Version-Release number of selected component (if applicable):
2.23.2-61.el7

How reproducible:
Always.

Steps to Reproduce:
1. lsmem -o NODE

Actual results:
lsmem segfaults.

Expected results:
lsmem does not segfault.

Additional info:

Running under GDB reveals this:

lsmem: sys-utils/lsmem.c:187: get_column_id: Assertion `columns[num] < (int) (sizeof(coldescs) / sizeof((coldescs)[0]) + (sizeof(struct { int:-!!(__builtin_types_compatible_p(__typeof__(coldescs), __typeof__(&coldescs[0]))); })))' failed.

Comment 2 ekulik 2019-05-22 08:37:12 UTC
Building util-linux from git results in a working binary, so I’m guessing that the backport of -o is faulty?

Comment 3 Karel Zak 2019-05-22 14:44:27 UTC
The problem is lib/strutils.c:string_add_to_idarray() where is still original code which is not compatible with utils where we use size_t to count columns... (affected are probably lsipc, lsmem and lsns).

It was fixed by upstream commit http://github.com/karelzak/util-linux/commit/40b175084ff4c57468fb67600c8c66703e17cd75. For RHEL-7 we probably need to use "int" in the affected tools to be compatible with the original version of the string_add_to_idarray().

Comment 4 Karel Zak 2019-05-24 10:02:18 UTC
*** Bug 1713396 has been marked as a duplicate of this bug. ***

Comment 6 Karel Zak 2019-08-12 16:50:37 UTC
*** Bug 1739141 has been marked as a duplicate of this bug. ***

Comment 9 Karel Zak 2019-10-22 08:39:50 UTC
*** Bug 1763182 has been marked as a duplicate of this bug. ***

Comment 13 errata-xmlrpc 2020-03-31 20:00:10 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-2020:1102