Stas Bekman wrote:
Marc Tardif wrote:
[...]
The problem is that if I uncomment the require line in the handler, I
get the following error message in /tmp/mod_perl.error.log:
Error loading Mozilla::LDAP::API: perldap_init failed
The solution might be related to the following XS code in API.xs:
BOOT:
if ( perldap_init() != 0) {
fprintf(stderr,
"Error loading Mozilla::LDAP::API: perldap_init failed\n");
exit(1);
}
So, perhaps perldap_init() is being called multiple times. Is there
something I can try in mod_perl to avoid this kind of problem? Can I
provide more information to help solve this problem?
I'd try to add some debug prints in perldap_init() function and see
where it fails (or step through with debugger).
The Mozilla::LDAP::API module was installed from an RPM. I have the
source but the makefiles don't work out of the box. I have tried
fiddling around with the compilation flags but haven't managed to get
the module compiled again. I would prefer to attach to the process with
gdb but the problem is that it that the process dies when encountering a
problem with the Perl module (see exit(1) in the XS code above).
If it was a problem at the startup and if perldap uses some static C
variables, you could have used
http://perl.apache.org/docs/2.0/user/handlers/server.html#Dealing_with_Restarts
I have tried printing the restart_count value in my handler and it
always returns 2. Could that be the problem?
However it looks like a runtime problem.
What if you preload Mozilla::LDAP::API at the server startup?
Same thing, I still get the error message:
Error loading Mozilla::LDAP::API: perldap_init failed
Are you using threads?
No, I'm not using threads. How can I make sure mod_perl.so hasn't been
compiled with threads?
Can you please send the complete bug report as
explained at http://perl.apache.org/bugs/?
Done.
--
Marc Tardif
Sitepak
(514) 866-8883