[omniORB] proxyObjectFactory and dynamic loading

Renzo Tomaselli renzo.tomaselli@tecnotp.it
Fri, 13 Jul 2001 12:25:08 +0200


Hi all,
    the OmniORB 3.04 implementation of proxyObjectFactory doesn't match
needs for dynamic unloading of dll (or shlib) implementing some objects.
That's because it behaves asymmetrically (in orbcore/proxyObjectFactory.cc):
constructor register the factory into ofl list (replacing what's there if
any), while destructor does *nothing*.
The result is that whenever a dynamic component is unloaded leaving a
running ORB, next proxyObjectFactory::lookup will likely crash the entire
application because a dead pointer is left into ofl.
A simple fixing would be achieve by having the destructor removing itself
from the ofl.
A better fixing would be:
- use a ref. counter/factory pair into ofl, not just the factory pointer;
- incr./decr. the counter within constructor/destructor.
An even better solution would require to keep *all* factories for a given
repoId. Indeed it happens that when common stubs are included in multiple
dynamic components a strict load/unload ordering must be followed in case of
simple ref. counting. A full list would allow proxyObjectFactory::lookup to
match both repoId *and* factory pointer.
Thanks,
                                             Renzo Tomaselli
---------------------------------------------------------------------------
TecnoTP s.n.c. Special Information System Design
Maso Pelauchi I38050 Ronchi Valsugana,  Trento TN  ITALY
Tel. +39 0461 773164      Fax. +39 0461 771514
e-mail: renzo.tomaselli@tecnotp.it
---------------------------------------------------------------------------