RE: PerlModule not updating %INC
-Original Message- From: Perrin Harkins [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 20, 2001 6:43 PM To: David Pisoni; [EMAIL PROTECTED]; Robert Landrum Subject: Re: PerlModule not updating %INC [snip] It sounds like this is a real bug with PerlModule. This was supposed to be fixed by 1.26, but I guess the fix didn't work or it got broken again. (Doug?) I wonder if this has something to do with the multiple init thing http://marc.theaimsgroup.com/?l=apache-modperlm=100510779912574w=2 if the interpreter is really being entirely broken down on each restart (including the initial one that Apache does when it reparses httpd.conf) %INC might be getting mucked up... --Geoff
Re: PerlModule not updating %INC
I wonder if this has something to do with the multiple init thing http://marc.theaimsgroup.com/?l=apache-modperlm=100510779912574w=2 It does. It's exactly the same bug. if the interpreter is really being entirely broken down on each restart (including the initial one that Apache does when it reparses httpd.conf) %INC might be getting mucked up... It shouldn't. I thought the interpreter didn't actually get broken down on restart at all unless you have PerlFreshRestart on. However, I see that Doug said this: i think that using *Apache::ReadConfig elsewhere will still trigger the double loading of all Perl{Require,Module}s, but i doubt the people suffering from the double load problem are using that feature. so i'll deal with that later. David, are you using Apache::ReadConfig or anything that uses it? - Perrin
RE: PerlModule not updating %INC
-Original Message- From: Perrin Harkins [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 21, 2001 11:01 AM To: Geoffrey Young; [EMAIL PROTECTED]; David Pisoni Subject: Re: PerlModule not updating %INC I wonder if this has something to do with the multiple init thing http://marc.theaimsgroup.com/?l=apache-modperlm=100510779912574w=2 It does. It's exactly the same bug. if the interpreter is really being entirely broken down on each restart (including the initial one that Apache does when it reparses httpd.conf) %INC might be getting mucked up... It shouldn't. I thought the interpreter didn't actually get broken down on restart at all unless you have PerlFreshRestart on. However, I see that Doug said this: i think that using *Apache::ReadConfig elsewhere will still trigger the double loading of all Perl{Require,Module}s, but i doubt the people suffering from the double load problem are using that feature. so i'll deal with that later. yeah, I read that and didn't understand the how patch he offered worked here at all. IIRC, I ran a test with only httpd.conf.default with only these additions PerlModule My::Foo then package My::Foo; warn initializing...; in lib/perl and I got 'initializing' on each restart. no Apache::ReadConfig going on here. I may have time to test this again today, but if someone else could verify, that would be great. --Geoff
Re: PerlModule not updating %INC
IIRC, I ran a test with only httpd.conf.default with only these additions PerlModule My::Foo then package My::Foo; warn initializing...; in lib/perl and I got 'initializing' on each restart. no Apache::ReadConfig going on here. And no PerlFreshRestart?
RE: PerlModule not updating %INC
-Original Message- From: Perrin Harkins [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 21, 2001 11:12 AM To: Geoffrey Young; [EMAIL PROTECTED]; David Pisoni Subject: Re: PerlModule not updating %INC IIRC, I ran a test with only httpd.conf.default with only these additions PerlModule My::Foo then package My::Foo; warn initializing...; in lib/perl and I got 'initializing' on each restart. no Apache::ReadConfig going on here. And no PerlFreshRestart? nope - I literally copied the default httpd.conf and added the single PerlModule directive. maybe a ServerName and Port change too, but no other mod_perl stuff. this drove me batty as I was trying to document how module initialization code worked. I did lots of archive digging and convinced myself that the current behavior is broken and that Doug thinks that what we all expect to see is the proper behavior, despite the fact that I created mod_perl builds back to 1.24 and saw the same thing. --Geoff
RE: PerlModule not updating %INC
ok, here was my test... [geoff@mainsheet apache]$ diff -u conf/httpd.conf.default conf/httpd.conf --- conf/httpd.conf.default Wed Nov 21 02:00:16 2001 +++ conf/httpd.conf Wed Nov 21 11:59:35 2001 @@ -38,6 +38,8 @@ # server as /usr/local/apache/logs/foo.log. # +PerlModule My::Foo + ### Section 1: Global Environment # # The directives in this section affect the overall operation of Apache, @@ -248,7 +250,7 @@ # don't use Group #-1 on these systems! # User nobody -Group #-1 +Group nobody # # ServerAdmin: Your address, where problems with the server should be [geoff@mainsheet apache]$ cat lib/perl/My/Foo.pm package My::Foo; open my $fh, '/tmp/test'; print $fh scalar localtime, \n; 1; [geoff@mainsheet apache]$ cat /tmp/test [geoff@mainsheet apache]$ ./bin/apachectl start ./bin/apachectl start: httpd started [geoff@mainsheet apache]$ cat /tmp/test Wed Nov 21 12:01:06 2001 [geoff@mainsheet apache]$ ./bin/apachectl restart ./bin/apachectl restart: httpd restarted [geoff@mainsheet apache]$ cat /tmp/test Wed Nov 21 12:01:06 2001 Wed Nov 21 12:01:17 2001 that's not what we should be seeing, right? --Geoff [geoff@mainsheet apache]$ HEAD http://mainsheet.laserlink.net:8080 200 OK Connection: close Date: Wed, 21 Nov 2001 17:04:08 GMT Accept-Ranges: bytes Server: Apache/1.3.23-dev (Unix) mod_perl/1.26_01-dev Content-Length: 413 Content-Type: text/html ETag: 6b82a-19d-3bdd9d6c Last-Modified: Mon, 29 Oct 2001 18:18:20 GMT Client-Date: Wed, 21 Nov 2001 17:04:08 GMT Client-Peer: 10.5.6.32:8080
Re: PerlModule not updating %INC
At 11.00 -0500 11/21/2001, Perrin Harkins wrote: SNIP David, are you using Apache::ReadConfig or anything that uses it? - Perrin Nope, not using ReadConfig. And to address another point, the behavior is consistant regardless of whether or not PerlFreshRestart is on. David
Re: PerlModule not updating %INC
Hello, I hate to keep banging this old drum, but since I was able to reproduce this problem (but not solve it), I figured I'd recycle it again. Perrin said earlier that this was fixed in 1.26, but I am indeed using 1.26 and the problem persists. Stas suggested upgrading perl to 5.6.1 -- I did so, recompiled mod_perl, and the problem persists. I didn't try upgrading the perl on my darwin box, but the fact that I get the same result there is telling. Can anyone tell me what the fix was from 1.25 to 1.26? Maybe there's a clue there. Thanks, David I'm still having this problem, and I've discovered that it is also happening on my darwin box. This is enough to lead me to believe the problem is bona fide. To recap: problem occurs on : Darwin (MacOS X) Perl 5.6.0 / Apache 1.3.20 / mod_perl 1.26 Red-Hat Linux (7.1) Perl 5.6.0 / Apache 1.3.20 / mod_perl 1.26 Red-Hat Linux (7.1) Perl 5.6.1 / Apache 1.3.20 / mod_perl 1.26 Problem : PerlModule does not cause %INC to be updated, but 'use' does Symptoms : Apache::StatINC does not work for said modules. Said modules do not appear in Apache::Status loaded modules page, but do appear in the Inheritance tree. Ideas? Thanks, David Date: Thu, 18 Oct 2001 12:57:27 -0800 To: Stas Bekman [EMAIL PROTECTED] From: David Pisoni [EMAIL PROTECTED] Subject: Re: PerlModule not updating %INC Cc: Perrin Harkins [EMAIL PROTECTED], [EMAIL PROTECTED] Bcc: X-Attachments: At 1.13 +0800 10/17/2001, Stas Bekman wrote: David Pisoni wrote: At 18.23 -0400 10/11/2001, Perrin Harkins wrote: At 18.07 -0400 10/11/2001, Perrin Harkins wrote: We are using perl 5.6.0 for Apache 1.3/20, with mod_perl 1.26. Are you sure? There was a problem with %INC and PerlModule, but I thought it was fixed in 1.26. - Perrin Indeed, like I said, I tested it by dumping %INC myself -- the modules are indeed missing when loaded with PerlModule. No, I meant are you sure you're running 1.26? Please doublecheck it, since this sounds so much like the bug from the previous release. - Perrin Indeed, here's the signature from Apache::Status : Embedded Perl version v5.6.0 for Apache/1.3.20 (Unix) (Red-Hat/Linux) mod_perl/1.26 Apache.pm shows v1.27 (that's a little weird, but I assume unimportant.) Thanks, David So... any ideas on this one? have you tried 5.6.1? 5.6.0 is very buggy. Just tried it. Fresh build of 5.6.1, and mod_perl 1.26 against it. The problem persists -- %INC is incomplete vs. my actual loaded modules, missing what was loaded with PerlModule directives. What should I try next. :-) David Original Message : Hello, We are using perl 5.6.0 for Apache 1.3/20, with mod_perl 1.26. We are running these on a RedHat Linux 7.1, kernel v2.4.2 system. We have been doing development using mod_perl, but finding that Apache::StatINC was not working as expected (i.e., we needed to restart the web server in order to see our module changes in effect.) Our apache config files preload all necessary modules at start time using the 'PerlModule' directive. When I started peeking through Apache::Status I found that although all of our loaded modules appear in the Inheritance Tree and the ISA Tree, most of them did not appear in the Loaded Modules section. (I also did a test handler with a dump of the contents of %INC, and said modules were missing.) The only modules of ours which DID appear were those which were ALSO called for with 'use' calls by other modules. Out of curiosity, I took our configuration file and changed all the 'PerlModule' directives to 'use' calls (inside a Perl block), and lo and behold, they all appeared in %INC. I could not find any documentation suggesting that the PerlModule directive would successfully load a module while circumventing %INC, nor do I recall in my previous projects developed using mod_perl having this problem. (Although I've been away awhile -- maybe I forget.) Any guidance? Thanks,
Re: PerlModule not updating %INC
At 2:31 PM -0800 11/20/01, David Pisoni wrote: We have been doing development using mod_perl, but finding that Apache::StatINC was not working as expected (i.e., we needed to restart the web server in order to see our module changes in effect.) Our apache config files preload all necessary modules at start time using the 'PerlModule' directive. When I started peeking through Apache::Status I found that although all of our loaded modules appear in the Inheritance Tree and the ISA Tree, most of them did not appear in the Loaded Modules section. (I also did a test handler with a dump of the contents of %INC, and said modules were missing.) The only modules of ours which DID appear were those which were ALSO called for with 'use' calls by other modules. I just reread your original post... I think I may know what the problem is (maybe). Are you using Location handlers? Location /whatever SetHandler perl-script PerlModule My::Special::Module PerlHandler My::Special::Module /Location If that is the case, My::Special::Module won't be loaded and compiled until the very first time that someone hits /whatever. This explains the missing modules in %INC (I think), but it does not explain the problem with Apache::StatINC. Out of curiosity, I took our configuration file and changed all the 'PerlModule' directives to 'use' calls (inside a Perl block), and lo and behold, they all appeared in %INC. And did this fix your problem with Apache::StatINC too? Rob -- Only two things are infinite: The universe, and human stupidity. And I'm not sure about the former. --Albert Einstein
Re: PerlModule not updating %INC
At 18.02 -0500 11/20/2001, Robert Landrum wrote: At 2:31 PM -0800 11/20/01, David Pisoni wrote: We have been doing development using mod_perl, but finding that Apache::StatINC was not working as expected (i.e., we needed to restart the web server in order to see our module changes in effect.) Our apache config files preload all necessary modules at start time using the 'PerlModule' directive. When I started peeking through Apache::Status I found that although all of our loaded modules appear in the Inheritance Tree and the ISA Tree, most of them did not appear in the Loaded Modules section. (I also did a test handler with a dump of the contents of %INC, and said modules were missing.) The only modules of ours which DID appear were those which were ALSO called for with 'use' calls by other modules. I just reread your original post... I think I may know what the problem is (maybe). Are you using Location handlers? Location /whatever SetHandler perl-script PerlModule My::Special::Module PerlHandler My::Special::Module /Location If that is the case, My::Special::Module won't be loaded and compiled until the very first time that someone hits /whatever. Just about EVERY module we use has a 'PerlModule' call to it, outside any enclosing blocks. Although I do have 'PerlHandler' directives in Location and Files blocks, the modules they use are preloaded prior to the enclosing block. We're hip to shared memory :-) This explains the missing modules in %INC (I think), but it does not explain the problem with Apache::StatINC. Out of curiosity, I took our configuration file and changed all the 'PerlModule' directives to 'use' calls (inside a Perl block), and lo and behold, they all appeared in %INC. And did this fix your problem with Apache::StatINC too? Rob Yes. StatINC indeed uses %INC to do its magic. StatINC's success or failure in this situation is merely a symptom though, not the real problem. We could simply set our configuration files as I've described here, but I'm interested in mod_perl working correctly for everyone, hence I continue to beat this drum. :-) I don't assume that the problem is unique to us -- rather I assume that we're the only ones experiencing it who both realize it and are doing something about it. Thanks, David
Re: PerlModule not updating %INC
If that is the case, My::Special::Module won't be loaded and compiled until the very first time that someone hits /whatever. Just about EVERY module we use has a 'PerlModule' call to it, outside any enclosing blocks. Although I do have 'PerlHandler' directives in Location and Files blocks, the modules they use are preloaded prior to the enclosing block. We're hip to shared memory :-) It just hit me That is why Apache::StatINC isn't working. We use Apache::StatINC on our development server, but we never preload any modules... We just use Location /whatever SetHandler perl-script PerlHandler My::Special::Module /Location and Apache::StatINC works. If you preload, It's not going to put the module into %INC. Otherwise Apache::StatINC would intentionally overwrite that shared memory and destroy the purpose for using PerlModule in the first place. I could be wrong... but I think that the answer is that It's not a bug, it's a feature, and that the behavior is actually correct. Rob -- Only two things are infinite: The universe, and human stupidity. And I'm not sure about the former. --Albert Einstein
Re: PerlModule not updating %INC
At 18.32 -0500 11/20/2001, Robert Landrum wrote: If that is the case, My::Special::Module won't be loaded and compiled until the very first time that someone hits /whatever. Just about EVERY module we use has a 'PerlModule' call to it, outside any enclosing blocks. Although I do have 'PerlHandler' directives in Location and Files blocks, the modules they use are preloaded prior to the enclosing block. We're hip to shared memory :-) It just hit me That is why Apache::StatINC isn't working. We use Apache::StatINC on our development server, but we never preload any modules... We just use Location /whatever SetHandler perl-script PerlHandler My::Special::Module /Location and Apache::StatINC works. If you preload, It's not going to put the module into %INC. Otherwise Apache::StatINC would intentionally overwrite that shared memory and destroy the purpose for using PerlModule in the first place. If this is true, it is a change from prior behavior. (And a bit distressing.) I for one would not complain of Apache::StatINC dirtying memory pages -- I'm really only concerned with shared memory on a production server, and I wouldn't run StatINC outside of the development environment. Besides, I'm assuming that if I do my trick of calling 'use' in a Perl block (which DOES update %INC) that the module code pages are still shared. What is more distressing though is that StatINC may not be the only consumer of %INC. (e.g., Apache::Status does not report these modules in Loaded Modules) The real trouble is that it is deviating from Doing the Right ThingĀ by perl. I could be wrong... but I think that the answer is that It's not a bug, it's a feature, and that the behavior is actually correct. For the above reasons, I hope you are wrong. :-) But you may be right! David
Re: PerlModule not updating %INC
I'm still having this problem, and I've discovered that it is also happening on my darwin box. This is enough to lead me to believe the problem is bona fide. To recap: problem occurs on : Darwin (MacOS X) Perl 5.6.0 / Apache 1.3.20 / mod_perl 1.26 Red-Hat Linux (7.1) Perl 5.6.0 / Apache 1.3.20 / mod_perl 1.26 Red-Hat Linux (7.1) Perl 5.6.1 / Apache 1.3.20 / mod_perl 1.26 Problem : PerlModule does not cause %INC to be updated, but 'use' does Symptoms : Apache::StatINC does not work for said modules. Said modules do not appear in Apache::Status loaded modules page, but do appear in the Inheritance tree. Ideas? Thanks, David Date: Thu, 18 Oct 2001 12:57:27 -0800 To: Stas Bekman [EMAIL PROTECTED] From: David Pisoni [EMAIL PROTECTED] Subject: Re: PerlModule not updating %INC Cc: Perrin Harkins [EMAIL PROTECTED], [EMAIL PROTECTED] Bcc: X-Attachments: At 1.13 +0800 10/17/2001, Stas Bekman wrote: David Pisoni wrote: At 18.23 -0400 10/11/2001, Perrin Harkins wrote: At 18.07 -0400 10/11/2001, Perrin Harkins wrote: We are using perl 5.6.0 for Apache 1.3/20, with mod_perl 1.26. Are you sure? There was a problem with %INC and PerlModule, but I thought it was fixed in 1.26. - Perrin Indeed, like I said, I tested it by dumping %INC myself -- the modules are indeed missing when loaded with PerlModule. No, I meant are you sure you're running 1.26? Please doublecheck it, since this sounds so much like the bug from the previous release. - Perrin Indeed, here's the signature from Apache::Status : Embedded Perl version v5.6.0 for Apache/1.3.20 (Unix) (Red-Hat/Linux) mod_perl/1.26 Apache.pm shows v1.27 (that's a little weird, but I assume unimportant.) Thanks, David So... any ideas on this one? have you tried 5.6.1? 5.6.0 is very buggy. Just tried it. Fresh build of 5.6.1, and mod_perl 1.26 against it. The problem persists -- %INC is incomplete vs. my actual loaded modules, missing what was loaded with PerlModule directives. What should I try next. :-) David
Re: PerlModule not updating %INC
At 1.13 +0800 10/17/2001, Stas Bekman wrote: David Pisoni wrote: At 18.23 -0400 10/11/2001, Perrin Harkins wrote: At 18.07 -0400 10/11/2001, Perrin Harkins wrote: We are using perl 5.6.0 for Apache 1.3/20, with mod_perl 1.26. Are you sure? There was a problem with %INC and PerlModule, but I thought it was fixed in 1.26. - Perrin Indeed, like I said, I tested it by dumping %INC myself -- the modules are indeed missing when loaded with PerlModule. No, I meant are you sure you're running 1.26? Please doublecheck it, since this sounds so much like the bug from the previous release. - Perrin Indeed, here's the signature from Apache::Status : Embedded Perl version v5.6.0 for Apache/1.3.20 (Unix) (Red-Hat/Linux) mod_perl/1.26 Apache.pm shows v1.27 (that's a little weird, but I assume unimportant.) Thanks, David So... any ideas on this one? have you tried 5.6.1? 5.6.0 is very buggy. Just tried it. Fresh build of 5.6.1, and mod_perl 1.26 against it. The problem persists -- %INC is incomplete vs. my actual loaded modules, missing what was loaded with PerlModule directives. What should I try next. :-) David
Re: PerlModule not updating %INC
David Pisoni wrote: At 18.23 -0400 10/11/2001, Perrin Harkins wrote: At 18.07 -0400 10/11/2001, Perrin Harkins wrote: We are using perl 5.6.0 for Apache 1.3/20, with mod_perl 1.26. Are you sure? There was a problem with %INC and PerlModule, but I thought it was fixed in 1.26. - Perrin Indeed, like I said, I tested it by dumping %INC myself -- the modules are indeed missing when loaded with PerlModule. No, I meant are you sure you're running 1.26? Please doublecheck it, since this sounds so much like the bug from the previous release. - Perrin Indeed, here's the signature from Apache::Status : Embedded Perl version v5.6.0 for Apache/1.3.20 (Unix) (Red-Hat/Linux) mod_perl/1.26 Apache.pm shows v1.27 (that's a little weird, but I assume unimportant.) Thanks, David So... any ideas on this one? have you tried 5.6.1? 5.6.0 is very buggy. -- _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://ticketmaster.com http://apacheweek.com http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
Re: PerlModule not updating %INC
At 18.23 -0400 10/11/2001, Perrin Harkins wrote: At 18.07 -0400 10/11/2001, Perrin Harkins wrote: We are using perl 5.6.0 for Apache 1.3/20, with mod_perl 1.26. Are you sure? There was a problem with %INC and PerlModule, but I thought it was fixed in 1.26. - Perrin Indeed, like I said, I tested it by dumping %INC myself -- the modules are indeed missing when loaded with PerlModule. No, I meant are you sure you're running 1.26? Please doublecheck it, since this sounds so much like the bug from the previous release. - Perrin Indeed, here's the signature from Apache::Status : Embedded Perl version v5.6.0 for Apache/1.3.20 (Unix) (Red-Hat/Linux) mod_perl/1.26 Apache.pm shows v1.27 (that's a little weird, but I assume unimportant.) Thanks, David So... any ideas on this one? David
PerlModule not updating %INC
Hello, We are using perl 5.6.0 for Apache 1.3/20, with mod_perl 1.26. We are running these on a RedHat Linux 7.1, kernel v2.4.2 system. We have been doing development using mod_perl, but finding that Apache::StatINC was not working as expected (i.e., we needed to restart the web server in order to see our module changes in effect.) Our apache config files preload all necessary modules at start time using the 'PerlModule' directive. When I started peeking through Apache::Status I found that although all of our loaded modules appear in the Inheritance Tree and the ISA Tree, most of them did not appear in the Loaded Modules section. (I also did a test handler with a dump of the contents of %INC, and said modules were missing.) The only modules of ours which DID appear were those which were ALSO called for with 'use' calls by other modules. Out of curiosity, I took our configuration file and changed all the 'PerlModule' directives to 'use' calls (inside a Perl block), and lo and behold, they all appeared in %INC. I could not find any documentation suggesting that the PerlModule directive would successfully load a module while circumventing %INC, nor do I recall in my previous projects developed using mod_perl having this problem. (Although I've been away awhile -- maybe I forget.) Any guidance? Thanks, -- David Pisoni One machine can do the work of fifty ordinary men. No machine can do the work of one extraordinary man. -Elbert Hubbard, author, editor, printer (1856-1915)
Re: PerlModule not updating %INC
We are using perl 5.6.0 for Apache 1.3/20, with mod_perl 1.26. Are you sure? There was a problem with %INC and PerlModule, but I thought it was fixed in 1.26. - Perrin
Re: PerlModule not updating %INC
At 18.07 -0400 10/11/2001, Perrin Harkins wrote: We are using perl 5.6.0 for Apache 1.3/20, with mod_perl 1.26. Are you sure? There was a problem with %INC and PerlModule, but I thought it was fixed in 1.26. - Perrin Indeed, like I said, I tested it by dumping %INC myself -- the modules are indeed missing when loaded with PerlModule. Enjoy, David
Re: PerlModule not updating %INC
At 18.07 -0400 10/11/2001, Perrin Harkins wrote: We are using perl 5.6.0 for Apache 1.3/20, with mod_perl 1.26. Are you sure? There was a problem with %INC and PerlModule, but I thought it was fixed in 1.26. - Perrin Indeed, like I said, I tested it by dumping %INC myself -- the modules are indeed missing when loaded with PerlModule. No, I meant are you sure you're running 1.26? Please doublecheck it, since this sounds so much like the bug from the previous release. - Perrin
Re: PerlModule not updating %INC
At 18.23 -0400 10/11/2001, Perrin Harkins wrote: At 18.07 -0400 10/11/2001, Perrin Harkins wrote: We are using perl 5.6.0 for Apache 1.3/20, with mod_perl 1.26. Are you sure? There was a problem with %INC and PerlModule, but I thought it was fixed in 1.26. - Perrin Indeed, like I said, I tested it by dumping %INC myself -- the modules are indeed missing when loaded with PerlModule. No, I meant are you sure you're running 1.26? Please doublecheck it, since this sounds so much like the bug from the previous release. - Perrin Indeed, here's the signature from Apache::Status : Embedded Perl version v5.6.0 for Apache/1.3.20 (Unix) (Red-Hat/Linux) mod_perl/1.26 Apache.pm shows v1.27 (that's a little weird, but I assume unimportant.) Thanks, David