Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 104090

Summary: herdstat consumes all cpu/memory
Product: Gentoo Linux Reporter: Rob Cakebread (RETIRED) <pythonhead>
Component: New packagesAssignee: Aaron Walker (RETIRED) <ka0ttic>
Status: RESOLVED FIXED    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Rob Cakebread (RETIRED) gentoo-dev 2005-08-28 20:44:11 UTC
Heres a fun one for you:
herdstat -q -n -m dev-db/postgis

and your cpu will go to 99% and memory slowly be used completely.
Careful if you have 128meg or less, it'll use all your memory quickly.
I let it run several minutes on a 1 gig machine but it never finished, consuming
80% memory.

I tried it on two machines with 1.1.1_p3 1.1.1_p5
Its only affected by dev-db/postgis since the package was updated today
Comment 1 Aaron Walker (RETIRED) gentoo-dev 2005-08-29 04:19:16 UTC
ewww.  that was the last set of command-line options I was expecting to see when
reading the summary (since it's not at all cpu/mem intensive like the -p option).  

I am able to reproduce it here though, so that's good.  Just got home from work,
so I'll have a closer look in a bit.
Comment 2 Aaron Walker (RETIRED) gentoo-dev 2005-08-30 06:04:48 UTC
Here's our culprit (line 36 of postgis-1.0.1_p20050805.ebuild):

xslv="$(echo ${xslv} | cut -d'-' -f1 )-$(echo ${xslv} | cut -d'-' -f2 )-$(echo
${xslv} | cut -d'-' -f3)"

herdstat tries to do /very/ simple variable substitution so that stuff like

HOMEPAGE="...${PV}..."

etc, get substituted and displayed to the user correctly.  For some reason, in
this particular case, the recursion depth safeguard I had in place didn't do
what is was supposed to (break out of the loop if it cannot resolve the variable
after recursing a certain number of times), thus the inf. loop.

I'll do a 1.1.1_p6 some time today.
Comment 3 Aaron Walker (RETIRED) gentoo-dev 2005-08-30 19:00:28 UTC
1.1.1_p6 in cvs.
Comment 4 Jakub Moc (RETIRED) gentoo-dev 2006-09-24 02:51:55 UTC
Assuming fixed, closing.