Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1365902 - parse_affinity() function reports wrong affinity if CPU number is larger than 31
parse_affinity() function reports wrong affinity if CPU number is larger than 31
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: python-linux-procfs (Show other bugs)
7.2
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: John Kacur
Jiri Kastner
:
Depends On:
Blocks: 1274397 1374804
  Show dependency treegraph
 
Reported: 2016-08-10 08:52 EDT by Jozef Bacik
Modified: 2016-11-04 04:08 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1374804 (view as bug list)
Environment:
Last Closed: 2016-11-04 04:08:13 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
bitmasklist-bug.py - reproducer (703 bytes, text/plain)
2016-08-10 08:52 EDT, Jozef Bacik
no flags Details
proposed patch (679 bytes, patch)
2016-08-10 08:53 EDT, Jozef Bacik
no flags Details | Diff
fix var names and improved sanitation of input (691 bytes, patch)
2016-08-16 04:24 EDT, Jozef Bacik
no flags Details | Diff
fix parse_affinity for CPU numbers greater than 31 (1.41 KB, patch)
2016-08-24 06:25 EDT, John Kacur
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2532 normal SHIPPED_LIVE python-linux-procfs bug fix update 2016-11-03 10:17:30 EDT

  None (edit)
Description Jozef Bacik 2016-08-10 08:52:35 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
Comment 1 Jozef Bacik 2016-08-10 08:53 EDT
Created attachment 1189625 [details]
proposed patch
Comment 3 Jozef Bacik 2016-08-16 04:24 EDT
Created attachment 1191143 [details]
fix var names and improved sanitation of input
Comment 8 John Kacur 2016-08-23 12:20:08 EDT
Jozef Bacik - are you the author of that patch? Can I have your SOB? Just paste it in a comment.
Comment 10 John Kacur 2016-08-24 06:25 EDT
Created attachment 1193571 [details]
fix parse_affinity for CPU numbers greater than 31
Comment 15 errata-xmlrpc 2016-11-04 04:08:13 EDT
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

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