Bug 867914 - pcp pmcollectl - incorrect handling of return value
pcp pmcollectl - incorrect handling of return value
Status: CLOSED CANTFIX
Product: Red Hat Developer Toolset
Classification: Red Hat
Component: pcp (Show other bugs)
DTS 1.1 RHEL 6
ppc64 All
unspecified Severity unspecified
: ---
: 1.1
Assigned To: Nathan Scott
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-18 10:51 EDT by Tomas Dohnalek
Modified: 2013-02-15 02:30 EST (History)
8 users (show)

See Also:
Fixed In Version: devtoolset-1.1-pcp-3.6.9-2.el[56]
Doc Type: Bug Fix
Doc Text:
Previous versions of the pmcollectl were not sufficiently flexible with respect to parsing the /proc/interrupts file, which has a different layout on ppc64. This has been corrected.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-01-22 10:35:59 EST
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)
Resolve possible arch-related issue in pmcollect interrupt handling (2.59 KB, patch)
2012-10-19 02:02 EDT, Nathan Scott
no flags Details | Diff
/proc/interrupts output from ppc64 RHEL6 machine (3.05 KB, text/plain)
2012-10-19 04:47 EDT, Tomas Dohnalek
no flags Details
/proc/interrupts output from different ppc64 RHEL6 machine (1.45 KB, text/plain)
2012-10-19 04:49 EDT, Tomas Dohnalek
no flags Details
Test-case 709 output after applying attachment 629784 (2.83 KB, application/octet-stream)
2012-10-19 05:31 EDT, Tomas Dohnalek
no flags Details

  None (edit)
Description Tomas Dohnalek 2012-10-18 10:51:16 EDT
Description of problem:

When running devtoolset-1.1-pcp-testsuite on ppc64 RHEL6, test-case 709 fails due to calling len() on possible 'int' value in pmcollectl:522 script.

Version-Release number of selected component (if applicable):
3.6.9-1.el6

How reproducible:
always


Steps to Reproduce:
1. Make sure devtoolset-1.1 is installed
2. Enable devtoolset-1.1 by running `scl  enable devtoolset-1.1 bash'.
3. Run test-case 709 or just run `pmcollectl -sj -c2'
  
Actual results:
Traceback (most recent call last):
  File "/opt/rh/devtoolset-1.1/root/usr/bin/pmcollectl", line 1034, in <module>
    s.print_line()
  File "/opt/rh/devtoolset-1.1/root/usr/bin/pmcollectl", line 257, in print_line
    self.print_brief()
  File "/opt/rh/devtoolset-1.1/root/usr/bin/pmcollectl", line 522, in print_brief
    for k in range(len(self.get_interrupt_metric_value('kernel.percpu.interrupts.MCP'))):
TypeError: object of type 'int' has no len()


Expected results:
Not fail.

Additional info:
Comment 2 Nathan Scott 2012-10-18 20:06:07 EDT
Oddly this passes for me on RHEL6 (x86_64).  Bit beyond my limited python-fu, so have asked scox for his thoughts on this one.
Comment 3 Nathan Scott 2012-10-19 01:58:08 EDT
Ah I think I see where it might be failing - the format of /proc/interrupts for ppc64 might be different to x86_64.  Could you attach a copy of that file from the test machine Tomas?  thanks!
Comment 4 Nathan Scott 2012-10-19 02:02:01 EDT
Created attachment 629784 [details]
Resolve possible arch-related issue in pmcollect interrupt handling

This patch is punting that the len()-on-an-integer is coming from the "else" branch in get_interrupt_metric_value which returns a zero.  Iff thats what is happening, this should resolve it.

Tomas, could you see if this patch resolves the issue?  (I don't have a ppc64 machine).
Comment 5 Tomas Dohnalek 2012-10-19 04:47:46 EDT
Created attachment 629874 [details]
/proc/interrupts output from ppc64 RHEL6 machine

Collected result from machine running `cat /proc/interrupts' on
DISTRO=RHEL-6.3
ARCHITECTURE=ppc64
Comment 6 Tomas Dohnalek 2012-10-19 04:49:29 EDT
Created attachment 629876 [details]
/proc/interrupts output from different ppc64 RHEL6 machine

Collected result from different machine (probably more readable) running `cat /proc/interrupts' on
DISTRO=RHEL-6.3
ARCHITECTURE=ppc64
Comment 7 Tomas Dohnalek 2012-10-19 05:00:06 EDT
(In reply to comment #4)
> Created attachment 629784 [details]
> Resolve possible arch-related issue in pmcollect interrupt handling
> 
> This patch is punting that the len()-on-an-integer is coming from the "else"
> branch in get_interrupt_metric_value which returns a zero.  Iff thats what
> is happening, this should resolve it.
> 
> Tomas, could you see if this patch resolves the issue?  (I don't have a
> ppc64 machine).

After applying this patch, no error occurs, but of course, the output is not correct and differs from 709.out.
Comment 8 Nathan Scott 2012-10-19 05:08:03 EDT
Can you attach the new 709.out.bad file Tomas?  thanks!
Comment 9 Tomas Dohnalek 2012-10-19 05:31:51 EDT
Created attachment 629898 [details]
Test-case 709 output after applying attachment 629784 [details]
Comment 10 Nathan Scott 2012-10-24 20:04:14 EDT
Stan has fixed the issues identified here, and the updates are merged upstream.

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