[Xorp-hackers] Crash due to stale cached xrl sender pointer.

Bruce Simpson bms at incunabulum.net
Thu Oct 29 08:42:09 PDT 2009


Ben Greear wrote:
> The attached patch seems to fix the problem.

Thanks for the patch, and the analysis.

This seems to introduce a ref_ptr -- a class I'm not 100% happy about. 
Are you sure that this patch does not leak any memory?

Passing a ref_ptr around is bad, because every time it crosses a C++ 
scope boundary, the refcount is bumped -- Boost at least has a weak_ptr 
and a shared_ptr, which cleanly separates the smart pointer semantics 
between 'I am passing this around' and 'I am sharing ownership of the 
pointed-to object'.

Is there a simpler workaround possible for the issue? I'd rather not get 
too deep into reviewing a patch which cuts fairly deep into internals 
which are probably about to get rewritten.

thanks,
BMS



More information about the Xorp-hackers mailing list