Two modules w/ different instances of same lib causes crash

php.internals

Michael B Allen

19 years ago
My extension (plexsso.so) is dymanically linked with a library. That library (libplexsso.so) is a statically linked collection of libs including a custom version of Heimdal Kerberos (libkrb5.a). I have found that if another module is linked with the stock Heimdal (e.g. pgsql.so dynamically in this case) some symbol mixing occurs and the application crashes. Can two modules use different instances of the same library? Before I go try to become an expert in linking and the Linux loader can anyone give me advice as to how to I might workaround (for Linux at least)? Mike
-- Michael B Allen PHP Active Directory SSO http://www.ioplex.com/

Michael B Allen

19 years ago
RTLD_DEEPBIND fixes this problem using a test program and two minimalistic DSOs to emulate the namespace clash problem. But I see PHP has support for RTLD_DEEPBIND: # if defined(RTLD_GROUP) && defined(RTLD_WORLD) && defined(RTLD_PARENT) ... # elif defined(RTLD_DEEPBIND) ... # else ... # endif On my Linux glibc 2.3 systems RTLD_DEEPBIND is chosen. So now, I have to wonder why my customer had a problem in the first place. Based on the above macros, is it possible that RTLD_DEEPBIND could NOT be chosen? Mike On Fri, 15 Sep 2006 11:43:56 -0400 Michael B Allen <mba2000@ioplex.com> wrote:
> My extension (plexsso.so) is dymanically linked with a library. That > library (libplexsso.so) is a statically linked collection of libs > including a custom version of Heimdal Kerberos (libkrb5.a). I have found > that if another module is linked with the stock Heimdal (e.g. pgsql.so > dynamically in this case) some symbol mixing occurs and the application > crashes. > > Can two modules use different instances of the same library? > > Before I go try to become an expert in linking and the Linux loader > can anyone give me advice as to how to I might workaround (for Linux > at least)? > > Mike
-- Michael B Allen PHP Active Directory SSO http://www.ioplex.com/

Michael B Allen

19 years ago
On Fri, 15 Sep 2006 15:23:16 -0400 Michael B Allen <mba2000@ioplex.com> wrote:
> So now, I have to wonder why my customer had a problem in the first place. > > Based on the above macros, is it possible that RTLD_DEEPBIND could NOT > be chosen?
The customer is using 4.3.4 which did not have the RTLD_DEEPBIND patch so that explains it. Problem solved. You guys are good :-> Does anyone happen to know what version the RTLD_DEEPBIND patch was shipped in? Is there a way to tell from look at http://viewcvs.php.net/viewvc.cgi/ ? Mike
-- Michael B Allen PHP Active Directory SSO http://www.ioplex.com/