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

Bruce Simpson bms at incunabulum.net
Sun Nov 8 07:13:10 PST 2009


Bruce Simpson wrote:
>
>    I've tested this briefly with the current SVN tree, just by running 
> a xorp_finder, call_xrl, and a xorp_rib. This exercises the reentrancy 
> of the XRL client stubs, because the Finder Client is instantiated 
> once for every XrlRouter. The RIB uses libfeaclient, which 
> instantiates its *own* XrlRouter instance (yes, you can have more than 
> one per process...) for getting interface updates from the FEA.

Anyway, back to this incremental change.

For testing, 3 shells:

1. Start the Finder (tedious, LD_LIBRARY_PATH needed if doing it from 
the source tree, which I don't recommend normally):-
%%%
anglepoise:~/svn/xorp/xorp % !81
env 
LD_LIBRARY_PATH=obj/x86_64-unknown-freebsd7.2/libxipc:obj/x86_64-unknown-freebsd7.2/libcomm:obj/x86_64-unknown-freebsd7.2/libxorp 
./obj/x86_64-unknown-freebsd7.2/libxipc/xorp_finder -v
Finder
\
%%%

2. Start the RIB:
%%%
anglepoise:~/svn/xorp/xorp % env 
LD_LIBRARY_PATH=obj/x86_64-unknown-freebsd7.2/libxipc:obj/x86_64-unknown-freebsd7.2/libcomm:obj/x86_64-unknown-freebsd7.2/libxorp:obj/x86_64-unknown-freebsd7.2/rib:obj/x86_64-unknown-freebsd7.2/libfeaclient:obj/x86_64-unknown-freebsd7.2/xrl/interfaces:obj/x86_64-unknown-freebsd7.2/xrl/targets:obj/x86_64-unknown-freebsd7.2/policy/backend:obj/x86_64-unknown-freebsd7.2/policy/common:obj/x86_64-unknown-freebsd7.2/libproto 
./obj/x86_64-unknown-freebsd7.2/rib/xorp_rib
%%%

2b. You should see the Finder complain about RIB asking where the 
non-existent FEA is in the first shell:
%%%
[ 2009/11/08 14:07:31 WARNING xorp_finder XrlFinderTarget ] Handling 
method for finder/0.2/resolve_xrl failed: XrlCmdError 102 Command failed 
Target "fea" does not exist or is not enabled.
%%%

3. Use call_xrl to verify the RIB registered OK with the Finder, by 
asking for all XRL targets to be dumped out:
%%%
anglepoise:~/svn/xorp/xorp % !32
env 
LD_LIBRARY_PATH=obj/x86_64-unknown-freebsd7.2/libxipc:obj/x86_64-unknown-freebsd7.2/libcomm:obj/x86_64-unknown-freebsd7.2/libxorp 
./obj/x86_64-unknown-freebsd7.2/libxipc/call_xrl 
finder://finder/finder/0.2/get_xrl_targets
target_names:list=:txt=call_xrl-4fcff00b2aeeb4447a32f10d3fa6d02f at 127.0.0.1,:txt=finder,:txt=ifmgr_mirror-4bb726603db32aacf6bd6dc5e4dd5053 at 127.0.0.1,:txt=rib-afe2bbdbd98937f915fe36ecf37e30a6 at 127.0.0.1
%%%

As you can see, the RIB came up OK in this case.

Profiling with the FreeBSD valgrind snapshot revealed that the "still 
reachable loss records" for the send*() methods in the XIF client stubs 
had indeed gone away, a desired result -- it's good to fix memory leaks. 
I'll hold off on committing for now, though.

It would be good to know if changing the Xrl allocation in this way 
helps the situation with the race you saw...



More information about the Xorp-hackers mailing list