Bug 859117 - sar2pcp warnings: use of uninitialized value .... line 171
Summary: sar2pcp warnings: use of uninitialized value .... line 171
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: pcp
Version: 16
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Nathan Scott
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-09-20 15:12 UTC by Frank Ch. Eigler
Modified: 2012-12-20 15:52 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2012-12-20 15:52:47 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
some random sar file (327.83 KB, application/octet-stream)
2012-09-20 15:12 UTC, Frank Ch. Eigler
no flags Details
sadf -x from same (30.38 KB, text/xml)
2012-09-20 15:15 UTC, Frank Ch. Eigler
no flags Details
output of sadf -x on RHEL5 (103.90 KB, text/xml)
2012-09-20 15:22 UTC, David Juran
no flags Details
RHEL5 binary sa file (72.25 KB, application/octet-stream)
2012-09-21 08:01 UTC, David Juran
no flags Details
converted data (2.05 KB, application/x-bzip2)
2012-09-24 12:51 UTC, David Juran
no flags Details

Description Frank Ch. Eigler 2012-09-20 15:12:57 UTC
Created attachment 614951 [details]
some random sar file

sar2pcp (3.6.5-1.el6) gives many warnings during operation:

Use of uninitialized value in subroutine entry at /usr/bin/sar2pcp line 171.
....

but results in an otherwise serviceable pcp archive.
(Note bug #859102 may require one to use a working version of sysstat (sadf) to get this far.)

Comment 1 Frank Ch. Eigler 2012-09-20 15:15:53 UTC
Created attachment 614952 [details]
sadf -x   from same

Comment 2 David Juran 2012-09-20 15:18:24 UTC
On RHEL5 (with pcp-3.6.5-1.el5) similar (and more) errors occur, and _no_ archive is created.

[djuran@rhel5 ~]$ sar2pcp /var/log/sa/sa20 /tmp/pcp/foo
Warning: XML tag <processes> not handled
Warning: XML tag <context-switch> not handled
Use of uninitialized value in division (/) at /usr/bin/sar2pcp line 223.
Argument "\x{30}\x{2c}..." isn't numeric in division (/) at /usr/bin/sar2pcp line 224.
Use of uninitialized value in division (/) at /usr/bin/sar2pcp line 225.
Argument "\x{31}\x{31}..." isn't numeric in division (/) at /usr/bin/sar2pcp line 226.
Argument "\x{30}\x{2c}..." isn't numeric in division (/) at /usr/bin/sar2pcp line 227.
Use of uninitialized value in addition (+) at /usr/bin/sar2pcp line 228.
Use of uninitialized value in addition (+) at /usr/bin/sar2pcp line 228.
Argument "\x{38}\x{35}..." isn't numeric in division (/) at /usr/bin/sar2pcp line 229.
Use of uninitialized value in division (/) at /usr/bin/sar2pcp line 253.
Argument "\x{30}\x{2c}..." isn't numeric in division (/) at /usr/bin/sar2pcp line 254.
Use of uninitialized value in division (/) at /usr/bin/sar2pcp line 255.
Argument "\x{32}\x{36}..." isn't numeric in division (/) at /usr/bin/sar2pcp line 256.
Argument "\x{30}\x{2c}..." isn't numeric in division (/) at /usr/bin/sar2pcp line 257.
Use of uninitialized value in addition (+) at /usr/bin/sar2pcp line 258.
Use of uninitialized value in addition (+) at /usr/bin/sar2pcp line 258.
Argument "\x{37}\x{30}..." isn't numeric in division (/) at /usr/bin/sar2pcp line 259.
Use of uninitialized value in division (/) at /usr/bin/sar2pcp line 253.
Argument "\x{30}\x{2c}..." isn't numeric in division (/) at /usr/bin/sar2pcp line 254.
Use of uninitialized value in division (/) at /usr/bin/sar2pcp line 255.
Argument "\x{30}\x{2c}..." isn't numeric in division (/) at /usr/bin/sar2pcp line 256.
Argument "\x{30}\x{2c}..." isn't numeric in division (/) at /usr/bin/sar2pcp line 257.
Use of uninitialized value in addition (+) at /usr/bin/sar2pcp line 258.
Use of uninitialized value in addition (+) at /usr/bin/sar2pcp line 258.
Argument "\x{39}\x{39}..." isn't numeric in division (/) at /usr/bin/sar2pcp line 259.
Use of uninitialized value in division (/) at /usr/bin/sar2pcp line 253.
Argument "\x{30}\x{2c}..." isn't numeric in division (/) at /usr/bin/sar2pcp line 254.
Use of uninitialized value in division (/) at /usr/bin/sar2pcp line 255.
Argument "\x{30}\x{2c}..." isn't numeric in division (/) at /usr/bin/sar2pcp line 256.
Argument "\x{30}\x{2c}..." isn't numeric in division (/) at /usr/bin/sar2pcp line 257.
Use of uninitialized value in addition (+) at /usr/bin/sar2pcp line 258.
Use of uninitialized value in addition (+) at /usr/bin/sar2pcp line 258.
Argument "\x{39}\x{39}..." isn't numeric in division (/) at /usr/bin/sar2pcp line 259.
Use of uninitialized value in division (/) at /usr/bin/sar2pcp line 253.
Argument "\x{30}\x{2c}..." isn't numeric in division (/) at /usr/bin/sar2pcp line 254.
Use of uninitialized value in division (/) at /usr/bin/sar2pcp line 255.
Argument "\x{31}\x{37}..." isn't numeric in division (/) at /usr/bin/sar2pcp line 256.
Argument "\x{30}\x{2c}..." isn't numeric in division (/) at /usr/bin/sar2pcp line 257.
Use of uninitialized value in addition (+) at /usr/bin/sar2pcp line 258.
Use of uninitialized value in addition (+) at /usr/bin/sar2pcp line 258.
Argument "\x{37}\x{31}..." isn't numeric in division (/) at /usr/bin/sar2pcp line 259.
pmiPutValue: Failed @ 20-Sep-2012 14:35:01: Impossible value or scale conversion


attaching output of sadf -x

Comment 3 David Juran 2012-09-20 15:22:07 UTC
Created attachment 614953 [details]
output of sadf -x on RHEL5

Comment 4 Nathan Scott 2012-09-21 01:19:54 UTC
Have a fix for the RHEL6 test case (from fche).  Creating a generic little test case so we can keep these problematic sar archives and ensure we don't regress again down the track.

pcp/qa/370 already exists, and goes to great lengths to check correctness of a localhost sar-create/pcp-import cycle, this new test will be more aimed at verifying we can do conversions for as many different RHEL/Fedora/other sysstat versions as possible.

Will look into David's failing case next...

Comment 5 Nathan Scott 2012-09-21 01:45:52 UTC
Hi David,

Could you attach your failing /var/log/sa/sa20 file here?  (i.e. the binary file too please)

thanks!

Comment 6 Nathan Scott 2012-09-21 02:55:39 UTC
Oh, ignore that last request David - found it over in 859102.

Comment 7 David Juran 2012-09-21 08:01:13 UTC
Created attachment 615301 [details]
RHEL5 binary sa file

Comment 8 David Juran 2012-09-21 08:10:18 UTC
Nathan, terribly sorry for the confusion, I really should open separate Bz for each issue.

The binary sa file in bug 859102 is from Fedora 16, attached here is now the binary file from RHEL5 that caused the error-messages in #2

Comment 9 Nathan Scott 2012-09-21 09:42:21 UTC
Thanks!  I think I understand the failure on the 859102 binary anyway,
it has some interesting characteristics that invalidate an assumption
that the sar2pcp script (in particular, it has a network interface that
appears mid-way through the log that was not there at the start).

Got a fair way through fixing it, but have run out of time for today;
will keep going early next week.

Thanks for reporting the issues, it's been interesting for me to learn
all about how this script works.

cheers.

Comment 10 Nathan Scott 2012-09-23 11:15:24 UTC
Hi David (and Frank),

I have sar2pcp working cleanly now for each of these problem scenarios.
I've committed all the fixes into the pcp dev git tree now, which can be
found at: git://oss.sgi.com/pcp/pcp

David, would you be comfortable cloning that git tree and doing a local
build to test it with your own data, on whichever Fedora/RHEL you are
using?  This would give me additional confidence before doing the next
PCP release.

Alternatively, I could do a release later this and push into Fedora for
further testing if thats easier?  (I'd prefer the former if possible, so
I don't have to do additional fixup releases later).

RPMs can be generated from the git tree using the "./Makepkgs" script if
that helps at all.

FWIW, the particular problem listed earlier in this bug with RHEL5 sar
data was resolved by this commit:

commit 11f0e2a371fb05940209b36423bb4731e2f9ea82
Author: Nathan Scott <nathans>
Date:   Sat Sep 22 21:51:08 2012 +1000

    Fix another problem in sar2pcp handling of ancient sar archives
    
    Really old versions of sysstat used commas in place of decimal
    points in the XML floating point numbers.  This causes failure
    whenever perl attempts to convert that string to a float.  So,
    we need to fix up the number (give it a decimal point instead
    of a comma) before doing any arithmetic or attempting to store
    the number.
    
    This is the cause (if you should ever observe it) of this type
    of perl warning/failure message:  (e.g.)
      'Argument "\x{31}\x{2c}..." isn't numeric in addition (+)'
    
    Red Hat Bugzilla: 859117


There are a number of other fixes in there too, however, so its worth
getting the complete set (via git clone/pull) before testing anything.

cheers.

Comment 12 David Juran 2012-09-24 09:48:31 UTC
In response to #10, actually I don't think it's the really old version of sadf that is causing the comma signs but rather that I had LC_NUMERIC set to sv_SE.utf8.... Nevertheless, the pacth referred to in #10 solves the problem, thanks for the help

Comment 13 Nathan Scott 2012-09-24 11:09:43 UTC
Ah yes, that would do it too - I didn't think of something like that.  Good to hear its working anyway.

Comment 14 David Juran 2012-09-24 12:50:06 UTC
Something still seems fishy though, running pmval on the converted sar data doesn't give any sensible results, e.g. kernel.all.load is reported to be constantly 1.000. And if I understand this metric correctly, it should be the same as "sar -q"

Attaching the results of my conversion, the source file is the one from https://bugzilla.redhat.com/attachment.cgi?id=615301 and everything has been run on RHEL5.

Comment 15 David Juran 2012-09-24 12:51:36 UTC
Created attachment 616547 [details]
converted data

Comment 16 Nathan Scott 2012-09-24 22:45:32 UTC
Thanks - yes, found the bug, recent regression I've introduced with the other changes.  I've just committed a fix:

Changes committed to git://oss.sgi.com/pcp/pcp.git dev

 src/pmimport/sar2pcp/sar2pcp |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

commit 66a116299f59f14d5da29e81487fe3770a1e86d8
Author: Nathan Scott <nathans>
Date:   Tue Sep 25 08:37:57 2012 +1000

    Fix sar2pcp dovalue() routine - returning incorrect values


Using git is going to be quickest, but if it suits you more I'll take Franks
suggestion on to patch the Fedora spec (just lemme know).

Also, just for reference, another way to check this stuff is to use:
"pmdumplog -a <pcplog> | less" ... this is a raw dump of the contents
of the PCP archive.  It differs to using the higher level tools like
pmval in that it doesn't do interpolation or rate-conversion on any
counter metrics, etc.  It's a handy way to see the original logging
frequency too (pmval will do 1sec reporting, or -t <interval>, which
is independent to the native logged frequency.

But thats not directly relevent to this issue, just for reference. :)

Thanks for testing it out!

cheers.

Comment 17 Mark Goodwin 2012-09-24 23:55:12 UTC
Nathan, I've confirmed your fix 66a116299f59f14d5da29e81487fe3770a1e86d8
to doValue() fixes the issue I reported on IRC yesterday, thanks!

Comment 18 David Juran 2012-09-25 15:14:16 UTC
Thanks, looks much better (-:

Comment 19 Fedora Update System 2012-10-25 22:18:02 UTC
pcp-3.6.9-1.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/pcp-3.6.9-1.el5

Comment 20 Fedora Update System 2012-10-25 22:18:36 UTC
pcp-3.6.9-1.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/pcp-3.6.9-1.fc18

Comment 21 Fedora Update System 2012-10-25 22:19:03 UTC
pcp-3.6.9-1.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/pcp-3.6.9-1.fc16

Comment 22 Fedora Update System 2012-10-25 22:19:30 UTC
pcp-3.6.9-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/pcp-3.6.9-1.el6

Comment 23 Fedora Update System 2012-10-25 22:20:00 UTC
pcp-3.6.9-1.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/pcp-3.6.9-1.fc17

Comment 24 Fedora Update System 2012-10-26 18:34:09 UTC
Package pcp-3.6.9-1.el5:
* should fix your issue,
* was pushed to the Fedora EPEL 5 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=epel-testing pcp-3.6.9-1.el5'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-EPEL-2012-13283/pcp-3.6.9-1.el5
then log in and leave karma (feedback).

Comment 25 Fedora Update System 2012-12-20 15:52:49 UTC
pcp-3.6.9-1.el6 has been pushed to the Fedora EPEL 6 stable repository.  If problems still persist, please make note of it in this bug report.


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