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 1800545 - pmieconf randomly fails
Summary: pmieconf randomly fails
Keywords:
Status: CLOSED DUPLICATE of bug 1792971
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: pcp
Version: 8.2
Hardware: Unspecified
OS: Linux
medium
medium
Target Milestone: rc
: 8.3
Assignee: Nathan Scott
QA Contact: Jan Kurik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-02-07 12:01 UTC by Jan Kurik
Modified: 2021-09-17 12:48 UTC (History)
5 users (show)

Fixed In Version: pcp-5.1.0
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-04-21 00:30:42 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
strace and valgrind log files (x86_64 architecture) (5.71 KB, application/x-xz)
2020-02-11 15:39 UTC, Jan Kurik
no flags Details

Description Jan Kurik 2020-02-07 12:01:10 UTC
Description of problem:
On ppc64le and aarch64 architectures
pmieconf does not work as it always fails with an error message and error code "1".

Version-Release number of selected component (if applicable):
pcp-5.0.2-4.el8

How reproducible:
Always on ppc64le and aarch64 architectures

Steps to Reproduce:
1. On a fresh RHEL-8.2 install pcp-zeroconf
yum install -y pcp-zeroconf
2. Run pmieconf with any parameters
pmieconf status


Actual results:
pmieconf: error - cannot access rules path component: "�7r!��"

Expected results:
verbose:  off
enabled rules:  15 of 24
pmie configuration file:  /etc/pcp/pmie/config.default
pmie processes (PIDs) using this file:  (none found)

Additional info:
As the pmieconf is called inside of postinstall script during the package installation, this issue pops up also during "yum install -y pcp-zeroconf"

Comment 1 Jan Kurik 2020-02-11 15:33:08 UTC
After a discussion with Nathan, I started to dig into this a bit deeper.
Finally I have realized, this issue is not architecture specific, just some architectures might be more sensitive to it.
I am also changing the bug summary to describe the issue in a bit better way.

1. observation:
It is very hard to reproduce the issue when pmieconf is running under valgrind.

2. observation:
strace shows pmieconf exiting at rules.c file on line 2176 [1]

3. observation:
Code inspections shows that a string "home" is freed on line 2174 [2] while a pointer "p", pointing somewhere into the middle of the string "home", is then used to print/format an error message.

Conclusion:
Depending on the way how each architecture works with memory and what is actual memory availability of a system (and whether valgrind has changed memory management or not), the pmieconf utility might exits successfully or with an error, when accessing already freed memory. That makes the fail random.

Proposed solution:
swap lines 2174 and 2175 of rules.c (print/format the error message first and then free the memory)

[1] https://github.com/performancecopilot/pcp/blob/master/src/pmieconf/rules.c#L2176
[2] https://github.com/performancecopilot/pcp/blob/master/src/pmieconf/rules.c#L2174

Comment 2 Jan Kurik 2020-02-11 15:39:47 UTC
Created attachment 1662484 [details]
strace and valgrind log files (x86_64 architecture)

Comment 3 Nathan Scott 2020-02-11 23:41:27 UTC
Good work, Jan - I think you've found & fixed it!  Will merge upstream shortly, then get this lined up for 8.3.

Comment 4 Nathan Scott 2020-04-21 00:30:42 UTC
This will be resolved by rebase to pcp-5.1.x

*** This bug has been marked as a duplicate of bug 1792971 ***

Comment 5 Jan Kurik 2020-06-12 15:26:13 UTC
I have not seen any crash of pmie during regression testing of pcp-5.1.1-2.el8 build.
I am considering this as fixed.


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