Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1365902 - parse_affinity() function reports wrong affinity if CPU number is larger than 31
Summary: parse_affinity() function reports wrong affinity if CPU number is larger than 31
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: python-linux-procfs
Version: 7.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: John Kacur
QA Contact: Jiri Kastner
URL:
Whiteboard:
Depends On:
Blocks: 1274397 1374804
TreeView+ depends on / blocked
 
Reported: 2016-08-10 12:52 UTC by Jozef Bacik
Modified: 2016-11-04 08:08 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1374804 (view as bug list)
Environment:
Last Closed: 2016-11-04 08:08:13 UTC


Attachments (Terms of Use)
bitmasklist-bug.py - reproducer (deleted)
2016-08-10 12:52 UTC, Jozef Bacik
no flags Details
proposed patch (deleted)
2016-08-10 12:53 UTC, Jozef Bacik
no flags Details | Diff
fix var names and improved sanitation of input (deleted)
2016-08-16 08:24 UTC, Jozef Bacik
no flags Details | Diff
fix parse_affinity for CPU numbers greater than 31 (deleted)
2016-08-24 10:25 UTC, John Kacur
no flags Details | Diff


Links
System 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 14:17:30 UTC

Description Jozef Bacik 2016-08-10 12:52:35 UTC
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 12:53:27 UTC
Created attachment 1189625 [details]
proposed patch

Comment 3 Jozef Bacik 2016-08-16 08:24:32 UTC
Created attachment 1191143 [details]
fix var names and improved sanitation of input

Comment 8 John Kacur 2016-08-23 16:20:08 UTC
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 10:25:07 UTC
Created attachment 1193571 [details]
fix parse_affinity for CPU numbers greater than 31

Comment 15 errata-xmlrpc 2016-11-04 08:08:13 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://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.