Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 46016 - gentoo-stats integer overflow on big mem/swap
Summary: gentoo-stats integer overflow on big mem/swap
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Meir Kriheli (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-28 12:39 UTC by Bob Miller
Modified: 2004-03-30 07:41 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
tcpdump of a failed RPC transaction (rpc-trans.tcpdump,48.46 KB, application/octet-stream)
2004-03-29 08:04 UTC, Bob Miller
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bob Miller 2004-03-28 12:39:00 UTC
I have 3 gigabytes of swap space.  When I try to run gentoo-stats --update,
it dies with the cryptic error message "error connecing to server".
I added some debug output to gentoo-stats and learned that the real error
is "long int exceeds XML-RPC limits".  The long int in question seems to
be swap: 3012079616L.

I only have 2 gigabytes of RAM in this box, but it looks like the same
problem would happen on systems with more than 2 GB of RAM.

Aside: how about enhancing the cryptic error message:

    except:
        print >>sys.stderr, "Error connecting to server:", sys.exc_value

Reproducible: Always
Steps to Reproduce:
1. Activate 3 gigabytes of swap space.
2. /usr/bin/gentoo-stats --update


Actual Results:  
gentoo-stats printed "Error connecing to server".



Expected Results:  
I expected gentoo-stats to silently send an update.
Comment 1 Meir Kriheli (RETIRED) gentoo-dev 2004-03-28 16:20:56 UTC
Uploaded  a new version (0.5.1) which changes mem/swap
params to string. This should resolve the issue.

Also modified the error display as you've suggested, 10x.

Please test, so we can close it.
Comment 2 Bob Miller 2004-03-28 19:02:44 UTC
I upgraded to gentoo-stats-0.5.1, and I ran it three times.  This is what happened.

jogger-egg ~> gentoo-stats -u
Error: <xmlrpclib.ResponseError instance at 0x402f3a0c>
jogger-egg ~> gentoo-stats -u
Error updating server:  <Fault 801: 'Invalid client'>
jogger-egg ~> gentoo-stats -u
Error updating server:  <Fault 801: 'Invalid client'>

It looks like the original problem is apparently fixed, but other problems have taken its place.
Comment 3 Meir Kriheli (RETIRED) gentoo-dev 2004-03-29 00:21:10 UTC
What's the output of:
md5sum /usr/sbin/gentoo-stats
Comment 4 Bob Miller 2004-03-29 07:58:41 UTC
mksoft wrote:
> What's the output of:                                                           
> md5sum /usr/sbin/gentoo-stats                                                   

Hey, that's not a fair question! (-:  I'd added debug printing to the script.
I re-emerged it, ensured that 0.5.1 is installed, and verified that it's
still failing.  It still fails.  The md5sum is 5dafa4f531c79163656edc8071a5472c.

I captured the wire protocol using Ethereal.  I will attach the tcpdump file.
You can view this in ethereal (ethereal rpc-trans.tcpdump; select any TCP packet; do Tools->Follow TCP Stream) and see the entire request gentoo-stats made, but the interesting thing is that the response says,

Fatal error: Call to a member function on a non-object in /var/www/gentoo-stats/xmlrpc.php on line 115
Comment 5 Bob Miller 2004-03-29 08:04:05 UTC
Created attachment 28287 [details]
tcpdump of a failed RPC transaction

Read this file using ethereal.	Select any TCP or HTTP packet, then select
Tools->Follow TCP Stream.  That will show the whole RPC transaction, nicely
formatted.
Comment 6 Meir Kriheli (RETIRED) gentoo-dev 2004-03-30 00:59:35 UTC
Do you have an SMP machine ? if so, it's a known bug.
For now set SUBMIT_CPU to nothing. The cpu detection
is moving from the client to the server and rewritten.

BTW, you don't need all that for debugging. Right now, to
help with testing it checks /usr/sbin/gentoo-stats, so you
can copy the file to some temp location, modify it, and test
it (the md5sum will still be reported for /usr/sbin/gentoo-stats)

and to get the visual protocol output, you can add verbose=1 to the
server creation line. I'll add it as an option in the next version
(-v verbose)
Comment 7 Bob Miller 2004-03-30 07:41:23 UTC
Thanks.  Yes, it's an SMP box.  And I didn't know that gentoo-stats was transmitting the md5sum to the server.  (Hadn't read the code.)

Everything is working fine now.  Thanks for your quick response.