[xsd-users] shared objects that load compiled schemas from a shared object

Ray Lischner rlischner at proteuseng.com
Fri Mar 4 09:49:54 EST 2011


We are using RedHat Linux 5.x, g++ 4.1.2, xsd 3.3.0.
We compile a set of schemas that use substitutionGroups into a shared object X.so.
We build two more shared objects, A.so and B.so, which make use of the schemas in X.so. We build A.so and B.so with -lX.

When we load A.so and B.so into an application, the substitutionGroups don't work. That is, a dynamic_cast<Type>() of an object of type Type returns a null pointer. When the same code executes with only A.so loaded, or only B.so loaded, the code works. It fails only when we load A.so and B.so into the same process space.

If we set LD_PRELOAD=X.so, the program works with A.so and B.so loaded.

Is there a way we can make this work without the LD_PRELOAD? I thought the loader would be able to detect that it needs to load only one copy of X.so, but apparently I am mistaken.

Ray Lischner,
Distinguished Member of Technical Staff
133 National Business Pkwy, Ste 150     t. 443.539.3448
Annapolis Junction, MD 20701                c. 410.854.5170
rlischner at proteuseng.com                     f. 443.539.3370

This electronic message and any files transmitted with it contain information
which may be privileged and/or proprietary. The information is intended for use
solely by the intended recipient(s). If you are not the intended recipient, be
aware that any disclosure, copying, distribution or use of this information is
prohibited. If you have received this electronic message in error, please advise
the sender by reply email or by telephone (443.539.3400) and delete the message.


More information about the xsd-users mailing list