Red Hat Bugzilla – Bug 1365902
parse_affinity() function reports wrong affinity if CPU number is larger than 31
Last modified: 2016-11-04 04:08:13 EDT
Created attachment 1189624 [details] bitmasklist-bug.py - reproducer Description of problem: parse_affinity() function reports wrong affinity if CPU number is larger than 31 Version-Release number of selected component (if applicable): python-linux-procfs-0.4.6-3.el7 How reproducible: When affinity is set for CPU 32 and higher. Attached reproducer with several showcases Steps to Reproduce: run the attached script bitmasklist-bug.py which calls the bitmasklist function directly with examples of affinity Actual results: parse_affinity() reports wrong affinity when affinity is set for CPUs 32 and higher Expected results: parse_affinity() reports correct affinity regardless of CPU number Additional info: I believe this is caused by bitmasklist() splitting the input line into array instead of treating it as long hexbitmask, the attached fix.patch produces expected result
Created attachment 1189625 [details] proposed patch
Created attachment 1191143 [details] fix var names and improved sanitation of input
Jozef Bacik - are you the author of that patch? Can I have your SOB? Just paste it in a comment.
Created attachment 1193571 [details] fix parse_affinity for CPU numbers greater than 31
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://rhn.redhat.com/errata/RHBA-2016-2532.html