Hi all,
I just caught my copy of pmacct on my laptop in an infinite loop in
sql_cache_insert, burning 100% CPU.
Unfortunately I don't know what traffic could have caused this. I have the
process in a debugger right now, but without debug symbols I can't tell
very much. It's 0.12.1 from Ubuntu Oneiric. I've tried rebuilding the same
package from source and the resulting binary has debug symbols but the
addresses don't match.
This function appears untouched in 0.14.0rc2, so I assume the bug is still
present. It's full of gotos, and it's not at all obvious that it makes
progress in every case, because it's difficult to untangle.
Might I suggest rewriting this code to avoid use of global variables
(for example, keep state such as pqq_ptr in a data buffer struct along
with the data) and make it guarantee to make progress and terminate? (for
example, using a for loop over buffer entries with a fixed step, and
functions for safe actions, insert and update)?
Cheers, Chris.
--
Aptivate | http://www.aptivate.org | Phone: +44 1223 760887
The Humanitarian Centre, Fenner's, Gresham Road, Cambridge CB1 2ES
Aptivate is a not-for-profit company registered in England and Wales
with company number 04980791.
_______________________________________________
pmacct-discussion mailing list
http://www.pmacct.net/#mailinglists