I have a problem with dlopen() that I don't know how to analyse.

Let's start from the beginning. I'm trying to upgrade an old VoIP server with OpenBSD 5.3 amd64, installing a completely new PC with OpenBSD 5.9 amd64 and reinstalling all the programs there.

The problem is that, EXACTLY the same source (OpenSER 1.1 with some custom changes) compiles correctly under 5.9 but it's unable to load the mysql module. The main program loads a few modules compiled as ".so" loadable modules. All modules are correctly loaded but one, the mysql.so one.

This is the code that load the modules:

        handle=dlopen(path, RTLD_NOW); /* resolve all symbols now */
        if (handle==0){
                LOG(L_ERR, "ERROR: load_module: could not open module <%s>: 
%s\n",
                                        path, dlerror() );
                goto error;
        }


And this is the error generated:
Jun 29 17:18:37 eowyn2 openser: ERROR: load_module: could not open module </usr/local/lib/openser/modules/mysql.so>: Cannot load specified object


Here is the ldd of the module (I verified that all the libraries listed here actually do exist):
eowyn2:/home/giannici# ldd /usr/local/lib/openser/modules/mysql.so
/usr/local/lib/openser/modules/mysql.so:
        Start            End              Type Open Ref GrpRef Name
000005ab5046f000 000005ab50888000 dlib 2 0 0 /usr/local/lib/openser/modules/mysql.so 000005ab9c012000 000005ab9c43a000 rlib 0 3 0 /usr/lib/libm.so.9.0 000005ab98016000 000005ab9877d000 rlib 0 1 0 /usr/local/lib/libmysqlclient.so.27.0 000005ac10636000 000005ac10a4b000 rlib 0 2 0 /usr/lib/libz.so.5.0 000005abf5656000 000005abf5a68000 rlib 0 2 0 /usr/lib/libpthread.so.20.1 000005ab6af15000 000005ab6b36f000 rlib 0 1 0 /usr/lib/libssl.so.38.0 000005abe8370000 000005abe893f000 rlib 0 2 0 /usr/lib/libcrypto.so.37.0 000005ac1d45c000 000005ac1d972000 rlib 0 1 0 /usr/lib/libstdc++.so.57.0


I repeat that:
1) The same source had no problem under OpenBSD 5.3.
2) All other modules are correctly loaded, only this one give error.

Now, what could be the problem?
How can I find what is the specific problem?
I'd like to have a more specific error instead of "Cannot load specified object". Is there any way?
Something changed in dlopen() between OpenBSD 5.3 and 5.9?

Thank you for any suggestion.

Reply via email to