[Xorp-hackers] xorp callback code replacement?

Ben Greear greearb at candelatech.com
Mon Sep 19 17:10:46 PDT 2011


Hello!

While trying to debug some un-related issues, I notice that
xorp rtrmgr crashes often under valgrind due to what appears
to be callbacks happening on already-deleted objects.

This makes me once again think about re-doing the callback
logic entirely.

My complaints with the current code:

* callback code is generated by a python script, and results in
   templated c++ code that I simply cannot understand.
   This also makes it very hard to add debugging code as well (say,
   a string name; object so we can identify callbacks generically,
   or similar.)

* The callbacks take pointers to objects, and there
   is virtually no way to cleanly remove the callbacks once
   added if we are deleting an object that might have a reference
   held by a callback.


I am curious if anyone has any suggestions for improving this.

My first instinct is to try to hand-write the callback objects,
and give them enough smarts to introspect themselves (recursively, as needed)
so we can remove callbacks that reference objects we want to free.

That may be a huge amount of work, however...so any other ideas
are welcome!

Thanks,
Ben

-- 
Ben Greear <greearb at candelatech.com>
Candela Technologies Inc  http://www.candelatech.com



More information about the Xorp-hackers mailing list