While working on the JSON PMDA, I found a bug where I got a SIGSEGV in
python if I accidentally returned an int value for a string metric.
After working on this for a couple of days, I figured out that if you
returned a positive integer, that number got put into the atom->cp field
and then __pmStuffValue() tried to use that positive integer as a
pointer value in a memcpy() call. Boom.
I thought I fixed that problem, but I was still getting a SIGSEGV, but
later in my code. I finally tracked that down to an unhandled error
getting created when PyArg_Parse() fails. This error occurs when just
returning an error code for a string metric.
So, here's a patch that fixes the above problems for me and seems to
work well. It is commit ec3eda6 on the dsmith/dev branch of pcpfans.git
or at the following link:
<https://www.sourceware.org/git/gitweb.cgi?p=pcpfans.git;a=commitdiff;h=refs/heads/dsmith/dev;hp=27976c5bd80b65a076b3a8f444ffb17b11d0af25>
--
David Smith
dsmith@xxxxxxxxxx
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)
|