RE: A fix in sight: Apache::ASP: crash when placed in startup.pl
perl_destruct/perl_free are not called at restart, only during child_exit. it looks like that might need to change to finish the dso puzzle. I experienced some problems there, but that was a few years ago, looks like it's time to revisit. But it is called when Apache unloads the modules during startup. Therefore my Apache on NT starts cleanly without the PERL_STARTUP_DONE_CHECK workaround :-) and Embperl works the first time on Unix when it's loaded at startup time and mod_perl is dynamicly linked. Really great! Doug, I have the patch (with dlclose replaced with ap_os_dso_unload, as I posted some hours ago) here in the CVS working directory, should I commit it? Gerald - Gerald Richterecos electronic communication services gmbh Internetconnect * Webserver/-design/-datenbanken * Consulting Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925151 WWW:http://www.ecos.de Fax: +49 6133 925152 -
Re: A fix in sight: Apache::ASP: crash when placed in startup.pl
Doug MacEachern wrote: wow, *nice* catch!! Daniel, I can't thank you and Alan enough for your efforts here. it's such a thorny problem to debug, the closest I came was trying to prevent the dlclose of modperl's libperl.so, but had no idea why that bandaid prevented the bleeding. I hadn't heard of ltrace, what a spectacular looking tool. I'd really like to get the workaround in 1.22, even if Apache and/or DynaLoader is the "right" place, we don't have any control over the release schedules of either and modperl-1.22 is already long overdue. You are welcome - it has always bugged me that I could never get APXS to work. Both Perl and Apache are included with Solaris 8 (http://www.sun.com/software/solaris/ea/linux.html), and the only way to add mod_perl to the preinstalled Apache/Perl is to use APXS. I've posted a bug against DynaLoader to P5P. I think the fix is probably to put an END handler in DynaLoader to unload the XS modules, but I'm not familiar enough with the perl interpreter cleanup processing to know if this is the best way. It might add some weight if you could add your comments to the bug preport in P5P - after all, the know who you are ;-) Alan Burlison
RE: A fix in sight: Apache::ASP: crash when placed in startup.pl (2)
Seems correct to me, although as I said before the patch should really go in DynaLoader - after all it is conceivable that perl embedders other than Apache could be hit by this problem. Yes, I agree, but this will not before perl 5.006 and much people are still using perl 5.004... Gerald
RE: A fix in sight: Apache::ASP: crash when placed in startup.pl
perl_destruct/perl_free are not called at restart, only during child_exit. it looks like that might need to change to finish the dso puzzle. I experienced some problems there, but that was a few years ago, looks like it's time to revisit. But it is called when Apache unloads the modules during startup. Therefore not perl_destruct()/perl_free(), they are only called in mod_perl by perl_shutdown(), during child_exit(). Aah, now I understand. I didn't get it the right way from your first mail. Yes, perl_destruct()/perl_free() should also be called before the XS libraries are unloaded, to give perl a chance to cleanup. Gerald
Re: A fix in sight: Apache::ASP: crash when placed in startup.pl (2)
Gerald Richter wrote: Seems correct to me, although as I said before the patch should really go in DynaLoader - after all it is conceivable that perl embedders other than Apache could be hit by this problem. Yes, I agree, but this will not before perl 5.006 and much people are still using perl 5.004... This is unfortunately true. However, the next version of perl is imminent (ish) so it would be nice if the fix could be in it. Alan Burlison
Re: A fix in sight: Apache::ASP: crash when placed in startup.pl
On Tue, Jan 18, 2000 at 11:02:27PM -0800, Doug MacEachern wrote: On Sat, 15 Jan 2000, Daniel Jacobowitz wrote: ... Notice that DBI is never dlclose()'d. But mod_perl is, when apache unloads its modules. The linker is not clever enough to realize that DBI depends on symbols in mod_perl.so. When mod_perl is reloaded at a DIFFERENT address, DBI has no reason to be rebound; its symbols are already resolved! wow, *nice* catch!! Daniel, I can't thank you and Alan enough for your efforts here. it's such a thorny problem to debug, the closest I came was trying to prevent the dlclose of modperl's libperl.so, but had no idea why that bandaid prevented the bleeding. I hadn't heard of ltrace, what a spectacular looking tool. I'd really like to get the workaround in 1.22, even if Apache and/or DynaLoader is the "right" place, we don't have any control over the release schedules of either and modperl-1.22 is already long overdue. perl_destruct/perl_free are not called at restart, only during child_exit. it looks like that might need to change to finish the dso puzzle. I experienced some problems there, but that was a few years ago, looks like it's time to revisit. *blink* Oh, you're right, of course. They weren't getting called at all. I think that's a problem, and I have a good idea of how to go about fixing it - I'll get back to you on that in a few hours. Dan /\ /\ | Daniel Jacobowitz|__|SCS Class of 2002 | | Debian GNU/Linux Developer__Carnegie Mellon University | | [EMAIL PROTECTED] | | [EMAIL PROTECTED] | \/ \/
Re: DynaLoader/MakeMaker problem? - Apache::ASP: crash when placed in startup.pl
On Sun, 16 Jan 2000, Alan Burlison wrote: I think we have a strong case for: a) Requesting that MakeMaker adds a dependency between the .so files it generates and the perl libperl.so b) Requesting that a 'remove a module' method is added to DynaLoader Option b would be very useful for mod_perl because you could remove modules used at startup, but not needed throughout the use of the system. For example, say in your Perl section you want to parse an XML config file that changes your httpd configuration somehow. So you load in XML::Parser. But now you've got XML::Parser in each of your child procs that you don't need and can't unload. Being able to call DynaLoader::RemoveFromMemory(XML::Parser) would be ideal (yes, it could be dangerous - so are most power tools). -- Matt/ Details: FastNet Software Ltd - XML, Perl, Databases. Tagline: High Performance Web Solutions Web Sites: http://come.to/fastnet http://sergeant.org Available for Consultancy, Contracts and Training.
DSO SEGV fix (was: A fix in sight: Apache::ASP: crash when placed in startup.pl)
Daniel Jacobowitz [EMAIL PROTECTED] writes: This worked! Can I get opinions on the attached patch? I am not competent to check whether the patch has any hidden problems, but I hope Doug will be able to evaluate it and include it in the next release. Your description of the sequence leading up to the crash fits well with what I observed when trying to trace the problem with gcc. It looks like Alan Burlison is on to a different dynamic linking problem that also needs to be fixed. -- Frank Cringle, [EMAIL PROTECTED] voice: (+49 2304) 467101; fax: 943357
Re: DSO SEGV fix (was: A fix in sight: Apache::ASP: crash when placed in startup.pl)
"Frank D. Cringle" wrote: Daniel Jacobowitz [EMAIL PROTECTED] writes: This worked! Can I get opinions on the attached patch? I am not competent to check whether the patch has any hidden problems, but I hope Doug will be able to evaluate it and include it in the next release. Your description of the sequence leading up to the crash fits well with what I observed when trying to trace the problem with gcc. It looks like Alan Burlison is on to a different dynamic linking problem that also needs to be fixed. No, it's the exactly the same problem, and the fix works for me too. Alan Burlison
Apache::ASP: crash when placed in startup.pl
Hi, I'm trying to preload and precompile all ASP scripts by including Apache::ASP in the startup.pl. However, when I do so, httpd core dumps with a segmentation fault in SDBM_File: Program received signal SIGSEGV, Segmentation fault. 0x403dfe27 in boot_SDBM_File () from /usr/lib/perl5/5.00503/i386-linux/auto/SDBM_File/SDBM_File.so (gdb) Quite frankly, I have no idea where to go from here. Any suggestions? Thanks Dmitry Beransky
Re: Apache::ASP: crash when placed in startup.pl
Doh! I forgot to say what I'm running: Apache::ASP v. 0.17 SDMB_File v. 1.0 mod_perl v. 1.21 Apache v. 1.39 RedHat 6.1 on Linux 2.2.12 x86 At 11:30 AM 1/14/00 , you wrote: Hi, I'm trying to preload and precompile all ASP scripts by including Apache::ASP in the startup.pl. However, when I do so, httpd core dumps with a segmentation fault in SDBM_File: Program received signal SIGSEGV, Segmentation fault. 0x403dfe27 in boot_SDBM_File () from /usr/lib/perl5/5.00503/i386-linux/auto/SDBM_File/SDBM_File.so (gdb) Quite frankly, I have no idea where to go from here. Any suggestions? Thanks Dmitry Beransky
Re: Apache::ASP: crash when placed in startup.pl
Dmitry Beransky wrote: Doh! I forgot to say what I'm running: Apache::ASP v. 0.17 SDMB_File v. 1.0 mod_perl v. 1.21 Apache v. 1.39 RedHat 6.1 on Linux 2.2.12 x86 This might be yet another RedHat problem ... have you tried rebuilding your perl / mod_perl from scratch. Out of curiosity really, because I think you should still rebuild stuff, does SDBM_File load fine, if not being preloaded ? -- Joshua _ Joshua Chamas Chamas Enterprises Inc. NodeWorks free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Apache::ASP: crash when placed in startup.pl
Yep, everything runs just fine if I don't preload Apache::ASP. My apache/mod_perl are rebuilt, but I'm still using Perl off the original RedHat distribution (totally forgot about his). I can try recompiling it...I'll be back with the result shortly. Thanks Dmitry At 01:26 PM 1/14/00 , Joshua Chamas wrote: This might be yet another RedHat problem ... have you tried rebuilding your perl / mod_perl from scratch. Out of curiosity really, because I think you should still rebuild stuff, does SDBM_File load fine, if not being preloaded ? Dmitry Beransky wrote: Doh! I forgot to say what I'm running: Apache::ASP v. 0.17 SDMB_File v. 1.0 mod_perl v. 1.21 Apache v. 1.39 RedHat 6.1 on Linux 2.2.12 x86
Re: Apache::ASP: crash when placed in startup.pl
This might be yet another RedHat problem ... have you tried rebuilding your perl / mod_perl from scratch. Out of curiosity really, because I think you should still rebuild stuff, does SDBM_File load fine, if not being preloaded ? Well, I just finished recompiling perl and mod_perl, but the problem is still there. Is there any way to verify that mod_perl is using the new perl? Thanks Dmitry
Re: Apache::ASP: crash when placed in startup.pl
Dmitry Beransky wrote: This might be yet another RedHat problem ... have you tried rebuilding your perl / mod_perl from scratch. Out of curiosity really, because I think you should still rebuild stuff, does SDBM_File load fine, if not being preloaded ? Well, I just finished recompiling perl and mod_perl, but the problem is still there. Is there any way to verify that mod_perl is using the new perl? I don't know about this, are you sure you copied over your new modperl httpd to /usr/local/apache after the build, and did a full stop / start, this is a common step overlooked by the best of us. Beyond this, I think it would be a shame if you couldn't preload Apache::ASP because of SDBM_File, you might want to research the archives a bit on other preload problems people have had, as they are likely related. I do my UNIX work on Solaris and have not ever dealt with this problem personally, so can't really pursue it for you. Maybe someone else has some insight? -- Joshua _ Joshua Chamas Chamas Enterprises Inc. NodeWorks free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Apache::ASP: crash when placed in startup.pl
I don't know about this, are you sure you copied over your new modperl httpd to /usr/local/apache after the build, and did a full stop / start, this is a common step overlooked by the best of us. Yes, I'm using the new build. I've compiled perl with debugging turned on and now gdb shows exactly where the problem occurs: line 267 of SDBM_File.c 262 #ifdef __cplusplus 263 extern "C" 264 #endif 265 XS(boot_SDBM_File) 266 { 267 dXSARGS; 268 char* file = __FILE__; 269 270 XS_VERSION_BOOTCHECK ; I guess at this point I got to go to a bookstore, get a book on GDB and get my hands dirty with some debugging :). Thanks Dmitry This might be yet another RedHat problem ... have you tried rebuilding your perl / mod_perl from scratch. Out of curiosity really, because I think you should still rebuild stuff, does SDBM_File load fine, if not being preloaded ? Well, I just finished recompiling perl and mod_perl, but the problem is still there. Is there any way to verify that mod_perl is using the new perl?
Re: Apache::ASP: crash when placed in startup.pl
This sounds like the same corruption problem that I talked about in my last message - could you try exporting LD_PRELOAD=/path/to/modperl.so? (I'm guessing from context that you're using a DSO - apologies for the non-sequitor if I'm wrong, I just got back on the list). On Fri, Jan 14, 2000 at 05:57:49PM -0800, Dmitry Beransky wrote: I don't know about this, are you sure you copied over your new modperl httpd to /usr/local/apache after the build, and did a full stop / start, this is a common step overlooked by the best of us. Yes, I'm using the new build. I've compiled perl with debugging turned on and now gdb shows exactly where the problem occurs: line 267 of SDBM_File.c 262 #ifdef __cplusplus 263 extern "C" 264 #endif 265 XS(boot_SDBM_File) 266 { 267 dXSARGS; 268 char* file = __FILE__; 269 270 XS_VERSION_BOOTCHECK ; I guess at this point I got to go to a bookstore, get a book on GDB and get my hands dirty with some debugging :). Thanks Dmitry This might be yet another RedHat problem ... have you tried rebuilding your perl / mod_perl from scratch. Out of curiosity really, because I think you should still rebuild stuff, does SDBM_File load fine, if not being preloaded ? Well, I just finished recompiling perl and mod_perl, but the problem is still there. Is there any way to verify that mod_perl is using the new perl? Dan /\ /\ | Daniel Jacobowitz|__|SCS Class of 2002 | | Debian GNU/Linux Developer__Carnegie Mellon University | | [EMAIL PROTECTED] | | [EMAIL PROTECTED] | \/ \/
Re: Apache::ASP: crash when placed in startup.pl
Yep, I am using DSO, but LD_PRELOAD didn't help [dmitry@bio-york ~]# set LD_PRELOAD=/usr/lib/apache/libperl.so [dmitry@bio-york ~]# gdb httpd GNU gdb 4.18 This GDB was configured as "i386-redhat-linux"... (gdb) run -X Starting program: /usr/sbin/httpd -X [Fri Jan 14 18:34:03 2000] [error] [asp] [3483] loaded 12 scripts Program received signal SIGSEGV, Segmentation fault. 0x4043180b in boot_SDBM_File (cv=0x8aef3e8) at SDBM_File.c:267 267 dXSARGS; Cheers Dmitry At 06:17 PM 1/14/00 , Daniel Jacobowitz wrote: This sounds like the same corruption problem that I talked about in my last message - could you try exporting LD_PRELOAD=/path/to/modperl.so? (I'm guessing from context that you're using a DSO - apologies for the non-sequitor if I'm wrong, I just got back on the list). On Fri, Jan 14, 2000 at 05:57:49PM -0800, Dmitry Beransky wrote: I don't know about this, are you sure you copied over your new modperl httpd to /usr/local/apache after the build, and did a full stop / start, this is a common step overlooked by the best of us. Yes, I'm using the new build. I've compiled perl with debugging turned on and now gdb shows exactly where the problem occurs: line 267 of SDBM_File.c