Bug 1712768 - lsmem segfaults on ppc64 wih -o
Summary: lsmem segfaults on ppc64 wih -o
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: util-linux
Version: 7.7
Hardware: ppc64
OS: Linux
urgent
high
Target Milestone: rc
: 7.8
Assignee: Karel Zak
QA Contact: Radka Brychtova
URL:
Whiteboard:
: 1713396 1739141 1763182 (view as bug list)
Depends On:
Blocks: 1689150 1689420 1766091
TreeView+ depends on / blocked
 
Reported: 2019-05-22 08:35 UTC by ekulik
Modified: 2023-03-24 14:50 UTC (History)
5 users (show)

Fixed In Version: util-linux-2.23.2-62.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1766091 (view as bug list)
Environment:
Last Closed: 2020-03-31 20:00:10 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 4519671 0 None None None 2019-10-22 08:39:50 UTC
Red Hat Product Errata RHBA-2020:1102 0 None None None 2020-03-31 20:00:23 UTC

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


Note You need to log in before you can comment on or make changes to this bug.