Re: [pmacct-discussion] Infinite loop in sql_cache_insert
Hi Paolo, On Mon, 28 Nov 2011, Paolo Lucente wrote: Would be great if: 1) you can upgrade to something more recent than that, ie. issue could be related to timestamps and fix might well be in some other parts of the code (pkt_handlers.c pops to mind) I will probably do this soon as I'm intending to do more work on pmacct development. However it would be great if Ubuntu would pick up more recent versions of pmacct in their newer releases. I'm running the latest release, Oneiric. Are you in touch with the package maintainer? I'd particularly like to add some more identifying information to the list of aggregation primitives, to help connect pmacct traffic logs with Squid logs, to associate website names to them. However I was completely confused about where to start on my first attempt to achieve this (adding new primitives). I was wondering whether it would be easier to write a classifier that would inspect the first packet of the stream and stuff the TCP ISN into the classification field? Does that seem like a reasonable approach? and/or 2) manage to reproduce the issue. I'm afraid this is probably impossible. I rarely run packet logging on my laptop and I wasn't at that time. It has happened a few times, but rarely. Apart of the above, agree 100% with your thoughts about cleaning up a bit; i have that on my todo list (along with other related things, ie. creating a sql_cache_free_entries() routine). Excellent :) Simpler and more flexible code would make it much easier to work on and extend pmacct. 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
Re: [pmacct-discussion] Infinite loop in sql_cache_insert
Hi Chris, Would be great if: 1) you can upgrade to something more recent than that, ie. issue could be related to timestamps and fix might well be in some other parts of the code (pkt_handlers.c pops to mind) and/or 2) manage to reproduce the issue. Apart of the above, agree 100% with your thoughts about cleaning up a bit; i have that on my todo list (along with other related things, ie. creating a sql_cache_free_entries() routine). Cheers, Paolo On Sun, Nov 27, 2011 at 05:15:51PM +0200, Chris Wilson wrote: 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 ___ pmacct-discussion mailing list http://www.pmacct.net/#mailinglists