[omniORB] Again about OmniOrb and shared objects

Mark Hole mark.hole@futuretv.com
Fri, 25 Jan 2002 17:10:08 -0000


Andrey,

>       I'm trying to put some work with corba into .so file on linux.
>       However i expirience some problems. Ideally, my dll should be
>       used from apache module. I wrote this module and this dll helper
>       (which uses corba) and it worked perfecly on win32 system.
>       But when i ported it to linux i meet problems with threading
>       locking. Very often call from ORB_init never returns.

We had exactly the same problem with using omniOrb shared libraries from an
Apache Module.

The problem is that Apache is not built with pthread libraries linked in.
There is a bug with the Linux pthread implementation which AFAIK gets very
upset if an executable (that is not built with pthreads) loads a dynamic
library (that is built with pthreads) and then subsequently forks the
process. Apache does exactly this, it loads the library (module) at start up
and then forks the main process as required to service requests.

To get around it you can do one of the following:

a) Build Apache with -lpthread (we've not tried this one)
b) Build yourself an Apache module which dynamically loads your real modules
after the process has been forked. (This was the option we went for and it
seems to work well)


Mark Hole

FutureTV Ltd.