You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Jens-Uwe Mager <ju...@helios.de> on 2000/03/06 01:33:20 UTC
Is ap_os_dso_unload really the right unload routine?
I am having problems with the just introduced call to ap_os_dso_unload.
This call is used to unload xs modules, but these modules are not loaded
by Apache but by the perl dynamic loader. I am having a problem with
this, as the in the AIX case this are two things, each with their own
list of loaded modules. Unfortunately does DynaLoader have no dl_unload
routine, which would be the right thing. But would not simply calling
dlclose be more correct even for other platforms?
--
Jens-Uwe Mager
HELIOS Software GmbH
Steinriede 3
30827 Garbsen
Germany
Phone: +49 5131 709320
FAX: +49 5131 709325
Internet: jum@helios.de
Re: Is ap_os_dso_unload really the right unload routine?
Posted by Doug MacEachern <do...@pobox.com>.
On Mon, 6 Mar 2000, Jens-Uwe Mager wrote:
> Well, if I could get a ";" at the end of the line as well, that would be
> fine. :-)
doh! fixed :)
Re: Is ap_os_dso_unload really the right unload routine?
Posted by Jens-Uwe Mager <ju...@helios.de>.
On Sun, Mar 05, 2000 at 05:16:37PM -0800, Doug MacEachern wrote:
> ok, done, thanks!
Well, if I could get a ";" at the end of the line as well, that would be
fine. :-)
--
Jens-Uwe Mager
HELIOS Software GmbH
Steinriede 3
30827 Garbsen
Germany
Phone: +49 5131 709320
FAX: +49 5131 709325
Internet: jum@helios.de
Re: Is ap_os_dso_unload really the right unload routine?
Posted by Doug MacEachern <do...@pobox.com>.
> Well, it did work mostly OK, but I occasionally had problems with more complex
> xs modules (like my homegrown SQL module for an exotic database), these
> would fault if called from startup.pl. Now with the dlclose in place
> this problem is gone, so I would vote for a dlclose in the AIX case (the
> CPP symbol is _AIX).
ok, done, thanks!
Re: Is ap_os_dso_unload really the right unload routine?
Posted by Jens-Uwe Mager <ju...@helios.de>.
On Sun, Mar 05, 2000 at 04:55:39PM -0800, Doug MacEachern wrote:
> i see. well, you have been using mod_perl as a dso with aix before this
> patch without problems, right? i'll just put an #ifndef AIX around the
> call to unload_xs_so() or, are you saying this would work:
>
> #ifdef AIX
> dlclose(handle);
> #else
> ap_os_dso_unload(handle);
> #endif
Well, it did work mostly OK, but I occasionally had problems with more complex
xs modules (like my homegrown SQL module for an exotic database), these
would fault if called from startup.pl. Now with the dlclose in place
this problem is gone, so I would vote for a dlclose in the AIX case (the
CPP symbol is _AIX).
--
Jens-Uwe Mager
HELIOS Software GmbH
Steinriede 3
30827 Garbsen
Germany
Phone: +49 5131 709320
FAX: +49 5131 709325
Internet: jum@helios.de
Re: Is ap_os_dso_unload really the right unload routine?
Posted by Doug MacEachern <do...@pobox.com>.
> But the trick is that this is a different dlclose than the one you would
> call if mod_perl itself would call dlclose. Both Apache and Perl in the
> AIX case have a set of routines that emulate dlopen et. al., but they do
> not see each other because the symbols are not exported and thus behave
> as if they are shared object "static". I have changed that here locally
> to simply dlclose and it will reference the dlclose in dl_aix.xs, and
> this one knows about the loaded xs modules.
i see. well, you have been using mod_perl as a dso with aix before this
patch without problems, right? i'll just put an #ifndef AIX around the
call to unload_xs_so() or, are you saying this would work:
#ifdef AIX
dlclose(handle);
#else
ap_os_dso_unload(handle);
#endif
?
Re: Is ap_os_dso_unload really the right unload routine?
Posted by Jens-Uwe Mager <ju...@helios.de>.
On Sun, Mar 05, 2000 at 04:39:23PM -0800, Doug MacEachern wrote:
> the original patch called dlclose(), gerald changed it to
> ap_os_dso_unload() for use with win32. perl 5.5.670 fixes the problem on
> it's own (along with DynaLoader::dl_unload_file), but mod_perl needs the
> fix for older Perls. how is ap_os_dso_unload different with aix?
> looks like it should just call dlclose():
>
> void ap_os_dso_unload(void *handle)
> {
> #if defined(HPUX) || defined(HPUX10) || defined(HPUX11)
> shl_unload((shl_t)handle);
>
> #elif defined(HAVE_DYLD)
> NSUnLinkModule(handle,FALSE);
>
> #else
> dlclose(handle);
> #endif
> return;
> }
But the trick is that this is a different dlclose than the one you would
call if mod_perl itself would call dlclose. Both Apache and Perl in the
AIX case have a set of routines that emulate dlopen et. al., but they do
not see each other because the symbols are not exported and thus behave
as if they are shared object "static". I have changed that here locally
to simply dlclose and it will reference the dlclose in dl_aix.xs, and
this one knows about the loaded xs modules.
--
Jens-Uwe Mager
HELIOS Software GmbH
Steinriede 3
30827 Garbsen
Germany
Phone: +49 5131 709320
FAX: +49 5131 709325
Internet: jum@helios.de
Re: Is ap_os_dso_unload really the right unload routine?
Posted by Doug MacEachern <do...@pobox.com>.
On Mon, 6 Mar 2000, Jens-Uwe Mager wrote:
> I am having problems with the just introduced call to ap_os_dso_unload.
> This call is used to unload xs modules, but these modules are not loaded
> by Apache but by the perl dynamic loader. I am having a problem with
> this, as the in the AIX case this are two things, each with their own
> list of loaded modules. Unfortunately does DynaLoader have no dl_unload
> routine, which would be the right thing. But would not simply calling
> dlclose be more correct even for other platforms?
the original patch called dlclose(), gerald changed it to
ap_os_dso_unload() for use with win32. perl 5.5.670 fixes the problem on
it's own (along with DynaLoader::dl_unload_file), but mod_perl needs the
fix for older Perls. how is ap_os_dso_unload different with aix?
looks like it should just call dlclose():
void ap_os_dso_unload(void *handle)
{
#if defined(HPUX) || defined(HPUX10) || defined(HPUX11)
shl_unload((shl_t)handle);
#elif defined(HAVE_DYLD)
NSUnLinkModule(handle,FALSE);
#else
dlclose(handle);
#endif
return;
}