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.
Description of problem:
If a process disappears while iterating the loop in pidstats.reload_threads(), we get a RuntimeError as shown below. This is because we cannot remove an entry from a dictionary while iterating the dictionary.
This problem is the cause of the following Tuned error reported in bug#1666562:
2019-01-16 03:22:34,859 ERROR tuned.units.manager: BUG: Unhandled exception in start_tuning: dictionary changed size during iteration
Version-Release number of selected component (if applicable):
python3-linux-procfs-0.6-5.el8.noarch
How reproducible:
always
Steps to Reproduce:
1. Add the following line to the beginning of pidstats.reload_threads() in /usr/lib/python3.6/site-packages/procfs/procfs.py:
import pdb; pdb.set_trace()
2. Start some process
3. Start the python interpreter and proceed as follows:
# python3
Python 3.6.8 (default, Jan 11 2019, 02:17:16)
[GCC 8.2.1 20180905 (Red Hat 8.2.1-3)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import procfs
>>> ps = procfs.pidstats()
>>> ps.reload_threads()
> /usr/lib/python3.6/site-packages/procfs/procfs.py(463)reload_threads()
-> for pid in self.processes.keys():
(Pdb) next
> /usr/lib/python3.6/site-packages/procfs/procfs.py(464)reload_threads()
-> try:
(Pdb)
At this point, terminate the process started in step 2. Return to the
python interpreter:
(Pdb) continue
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.6/site-packages/procfs/procfs.py", line 465, in reload_threads
self.processes[pid].load_threads()
RuntimeError: dictionary changed size during iteration
Actual results:
RuntimeError is raised
Expected results:
reload_threads() finishes without errors
Additional info:
A fix for the problem has been sent upstream:
https://lists.fedorahosted.org/archives/list/tuna-devel@lists.fedorahosted.org/thread/PK354CZETOV23PJPMJ7CZCK7SOOV2JX6/
(In reply to Luiz Capitulino from comment #11)
> Can we set the "Fixed In Version" field so that we know when this was fixed?
> Thanks.
Done - python3-linux-procfs-0.6-6.el8