Re: AW: Use of uninitialized valued in concatenation....
Did u check what's in line # 42 ? If u run the same script with same params as stand-alone, do u see the warning ? Sreeji --- "B. Fongo" <[EMAIL PROTECTED]> wrote: > It is not a standard perl error message. I went > through mod_perl doc at > http://perl.apache.org/docs/general/perl_reference/perl_reference.html#T > racing_Warnings_Reports > > and understand that, the error message appear if one > fails to pass a > value to a subroutine before using. Looking through > my codes, you may > have noticed that, I did pass 2 arguments to the > subroutine. > > > > -Ursprüngliche Nachricht- > Von: Perrin Harkins [mailto:[EMAIL PROTECTED] > Gesendet: Samstag, 23. August 2003 00:10 > An: B. Fongo > Cc: [EMAIL PROTECTED] > Betreff: Re: Use of uninitialized valued in > concatenation > > On Fri, 2003-08-22 at 17:23, B. Fongo wrote: > > I have a file (output_tab.pm) that I use to > generate tables > > dynamically. Even though it serves its purpose, it > goes on generating > > this error: > > > > Script_name.pl: Use of uninitialized value in > concatenation (.) or > > string at output_tab.pm line 42. > > This is a standard perl error message. It is not > related to mod_perl. > You can look in the perldiag man page for a more > complete explanation. > > - Perrin Want to chat instantly with your online friends? Get the FREE Yahoo! Messenger http://uk.messenger.yahoo.com/ -- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html
[MP1.28 + perl maint. 20512] Build failure due to error in Apache/ExtUtils.pm
I tried to compile mod_perl-1.28 with perl maint. 20512 (http://www.iki.fi/jhi/[EMAIL PROTECTED]). I had a build failure (different errors each time trying to build). I noticed the following messages during perl Makefile.PL: .. + id: Perl/v5.8.1 (linux) [/nfs/private/user/srdas/i686/perl-pre-rc5/bin/perl] Modification of a read-only value attempted at /nfs/private/user/srdas/tech_stack/mod_perl-1.28/lib/Apache/ExtUtils.pm line 50. BEGIN failed--compilation aborted at ./modules/perl/perl_config line 6. Modification of a read-only value attempted at /nfs/private/user/srdas/tech_stack/mod_perl-1.28/lib/Apache/ExtUtils.pm line 50. BEGIN failed--compilation aborted at ./modules/perl/perl_config line 6. Modification of a read-only value attempted at /nfs/private/user/srdas/tech_stack/mod_perl-1.28/lib/Apache/ExtUtils.pm line 50. BEGIN failed--compilation aborted at ./modules/perl/perl_config line 6. Digging through, the following in Apache/ExtUtils.pm seem to be the problem: sub Config_pm_fixup { local $_ = $Config::Config{$key}; $sub->(); .. I could reproduce this using a small script: $ cat repeat.pl my $max_count = $ARGV[0] || 100; while ($count++ <= $max_count) { $ret = system("./oops.pl"); if ($ret) { warn "#$count: Errored\n"; ; } } $ cat oops.pl #!perl test('data'); sub test { replace() for (@_); } sub replace { my %hash = ( ld => sub { s/(.*)/T1/e }, ccdlflags => sub { s/(.*)/T2/; }, ); while (my($key, $sub) = each %hash) { local $_ = 'test'; $sub->(); } } --- I ran it as: $ perl ~/repeat.pl Modification of a read-only value attempted at /home/srdas/junk line 16. #3: Errored Modification of a read-only value attempted at /home/srdas/junk line 16. #5: Errored Modification of a read-only value attempted at /home/srdas/junk line 16. #6: Errored Modification of a read-only value attempted at /home/srdas/junk line 16. #7: Errored Modification of a read-only value attempted at /home/srdas/junk line 16. #8: Errored Modification of a read-only value attempted at /home/srdas/junk line 16. #12: Errored Modification of a read-only value attempted at /home/srdas/junk line 16. #13: Errored -- 1) The script ran perfectly fine on 5.6.1, 5.8.0 and also on 5.8.1 RC4 2) This looks similar to bug # 23238 (http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2003-08/msg00518.html) 3) local *_ before the local $_ in Apache/ExtUtils.pm (or in the test script) solves the problem. For whatever is worth, this is the above diff: diff -u lib/Apache/ExtUtils.pm.org lib/Apache/ExtUtils.pm --- lib/Apache/ExtUtils.pm.org Thu Aug 7 06:46:12 2003 +++ lib/Apache/ExtUtils.pm Thu Aug 7 06:43:36 2003 @@ -47,6 +47,7 @@ ); while (my($key, $sub) = each %config_fixups) { + local *_; local $_ = $Config::Config{$key}; $sub->(); (tied %Config::Config)->{$key} = $_; --- Now since this was working until RC4, I'd consider this a bug. Should this go over to perl5-porters ? thx Sreeji - For completeness, I've attached my perl-details. Want to chat instantly with your online friends? Get the FREE Yahoo! Messenger http://uk.messenger.yahoo.com/Summary of my perl5 (revision 5.0 version 8 subversion 1) configuration: Platform: osname=linux, osvers=2.4.9-e.18smp, archname=i686-linux-thread-multi uname='linux ap631wgs 2.4.9-e.18smp #1 smp fri apr 11 18:24:51 edt 2003 i686 unknown ' config_args='-de -Dprefix=//nfs/private/user/srdas/i686/perl-pre-rc5 -Dmake=/usr/bin/make -Dbin=/nfs/private/user/srdas/i686/perl-pre-rc5/bin/ -Uinstallusrbinperl -Dusethreads -Dstartperl=#!/nfs/private/user/srdas/i686/perl-pre-rc5/bin/perl -Dinc_version_list=none -Dscriptdir=//nfs/private/user/srdas/i686/perl-pre-rc5/bin -Dsitebin=/nfs/private/user/srdas/i686/perl-pre-rc5/bin -Doptimize=-O2' hint=recommended, useposix=true, d_sigaction=define usethreads=define use5005threads=undef useithreads=define usemultiplicity=define useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm', optimize='-O2', cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -I/usr/local/include -I/usr/include/gdbm' ccversion='', gccversion='2.96 2731 (Red Hat Linux 7.2 2.96-108.1)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbyt
Re: 'PerlSetVar' error, please help
--- Dead Line <[EMAIL PROTECTED]> wrote: > Hello Everyone, > >Im on FreeBSD 4.8R Fresh installation, I have > apache-fp, installed and > running, >I installed p5-Apache-ASP-2.51 from /ports > collection, installation was > ../www/.htaccess: Invalid command 'PerlSetVar', > perhaps mis-spelled or > defined by a module not included in the server > configuration I don't know what's Apache-ASP - never used it. However, the above error message means u've not enabled mod_perl. If your httpd binary is statically built, then httpd -l should show you an entry for mod_perl. Otherwise, make sure you have an AddModule for mod_perl.so in your httpd configuration. Sreeji Want to chat instantly with your online friends? Get the FREE Yahoo! Messenger http://uk.messenger.yahoo.com/
Re: mod_perl 1.0 and 2.0
I think it should be based on your specific requirements. If you want to setup a production box and does not have much time in hand to troubleshoot, then you must go for mod_perl 1.x/Apache-1.x latest stable versions. However, if you have time in hand & want to learn a bit about Apache/mod_perl, then 2.x would be better. For any slightly large project, you're likely to face problems & it's fun to debug as you'd get to know the code better. I'd also think mod_perl 1.x series may be discontinued after a while, as 2.x gets to be used widely (however, it may be a while). I have been trying to move a large application from mod_perl 1.x to 2.x. There had been many hiccups now & then and I had to install latest of version of all components in my tech stack (perl 5.8.0, latest CGI/DBI/DBD ...etc.) and had to tweak my configurations. I found few issues in the process and I've reported them here. From my experience, it's a bit long journey, but quite interesting. Sreeji --- Jamie Krasnoo <[EMAIL PROTECTED]> wrote: > Hi all, > > I'm currently working on a personal project to get > myself back in > mod_perl programming order. However I'm more used to > using mod_perl 1.0 > with Apache 1.3.x. I'm going through the > documentation for mod_perl 2.0 > but I'm worried that most of the modules I need > won't work with mod_perl > 2.0. I've been looking for what modules will and > will not work with 2.0 > (like Apache::DBI for pooling connections with > MySQL). Would it be a > better benefit to me to switch over to 2.0? > > Thanks, > > Jamie > Want to chat instantly with your online friends? Get the FREE Yahoo! Messenger http://uk.messenger.yahoo.com/
[MP2 - BUG ?] Issue handing Apache config. error messages
Following demonstrates the problem: $ cat /tmp/test.conf @Include = "/tmp/test1.conf"; Listen 43499 $ cat /tmp/test1.conf $Port = 42480; $ httpd -X -f /tmp/test.conf Syntax error on line 7 of /tmp/test.conf: Use of uninitialized value in subroutine entry at /tmp/CVS/virgin/modperl-2.0/blib/lib/Apache2/Apache/PerlSection.pm line 171. - I've confirmed that ap_walk_config() in modperl_config_insert() indeed returns a valid error message and this gets propogated to post_config() in PerlSection.pm & a dir $errmsg happens. I guess this has something to do with the double eval() happening. ie. one for Include, and then recursively for Port. I'll debug it further; but it'd be nice if some1 already knows the issue and has a solution ! thx Sreeji Want to chat instantly with your online friends? Get the FREE Yahoo! Messenger http://uk.messenger.yahoo.com/
[MP2 BUG] PerlPassEnv issues
Looks like PerlSetEnv's are not propagated as expected. I've pasted my original mail to the list. However, after going through the code, it looks like scfg->PassEnv is not synced with Perl's %ENV structure. Following is a simpler example: $ cat /tmp/test.conf ; PerlPassEnv MY_TEST_VAR print "MY_TEST_VAR is $ENV{MY_TEST_VAR}\n"; system("echo \"shell: MY_TEST_VAR = \$MY_TEST_VAR\""); Listen 43499 $ httpd -X -f /m/aru/conf/test.conf MY_TEST_VAR is shell: MY_TEST_VAR = Hello there MY_TEST_VAR is shell: MY_TEST_VAR = Hello there I think either modperl_cmd_pass_env() should sync the vars. as and when it sees one (but this may not be efficient). Or, modperl_cmd_perldo() should sync (by calling modperl_env_table_populate() ?) before doing the eval(). I tried doing this, but couldn't figure out how to get a pTHX_ ! (The same problem would be applicable to PerlSetEnv as well, I guess). Any temporary hacks to fix this, so that I can continue my testing ? thx Sreeji --- Hi It looks like when I @Include a file from a section, the sections in that file get processed first, though there are other stuff before the sections. Following is an example (simplified from my real-life config) : $ cat /tmp/test.conf @Include = "/tmp/testvar.conf"; Listen 43499 $ cat /tmp/testvar.conf PerlPassEnv MY_TEST_VAR print "MY_TEST_VAR = $ENV{MY_TEST_VAR}\n"; $ httpd -X -f /tmp/test.conf [Sun Jul 06 06:15:09 2003] [warn] Syntax error at /tmp/testvar.conf:5 Use of uninitialized value in concatenation (.) or string at (eval 3) line 1. So when an Include is found, all perlsections in that file are processed. However, as in the above case, these sections could be depending on the directives defined previously in the file. It works if I move the PerlPassEnv to test.conf, above the section. Any thoughts ? thx Sreeji (this is 1.99_10-dev on Linux, with httpd-2.0.45) Want to chat instantly with your online friends? Get the FREE Yahoo! Messenger http://uk.messenger.yahoo.com/
Re: is anybody using mp2 in production?
>... >... > > I'd be interested in what you thought of the switch > after going live, we > were never sure (but getting there now) if we should > have started with MP2 > or not, never got a chance to see MP1 in action. We have found MP1 to be stable. (We had a lot of issues with PerlFreshRestart & I had to patch MP1 to get around this issue. Otherwise there were no problems) I'm not very sure about MP2. We want to play around with MP2 on development as much as possible before going live. I'm also worried about the differing opinion on perl-ithreads (especially after reading http://groups.google.com/groups?dq=&hl=en&lr=&ie=UTF-8&threadm=b7fpt9%24q9a%241%40agate.berkeley.edu&prev=/groups%3Fdq%3D%26num%3D25%26hl%3Den%26lr%3D%26ie%3DUTF-8%26group%3Dcomp.lang.perl.moderated%26start%3D25) We plan to get mp2 working on development & test the performance. Once we find it's stable on dev., it's time to go live. Sreeji __ Yahoo! Plus - For a better Internet experience http://uk.promotions.yahoo.com/yplus/yoffer.html
Re: is anybody using mp2 in production?
That's cool & is yet another example of the power of mod_perl. And you're right about the documentation. I was blown away by the amount of docs. available at perl.apache.org; thanks to all the hard work of Stas Beckman !! We had been using mod_perl & had been having a very stable site for quite a long time. Now we're planning to shift to mod_perl-2. I could get everything compiled, but mp2 bombed while parsing our config. files. I've reported this bug (search for PerlSection + recurse/recursive) and hopefully some1 is working on it ;-) Anyway, I plan to spend my weekends reading mod_perl code and see if I can fix this issue. Once the above issue is fixed, we'd be able to move on to the next level of testing & report any further issues. (Btw, Chris, are you using the worker mpm ? Is it stable ? We'd like to go the worker mpm way & would like to know if any1 is using it yet in production.) thx Sreeji --- Chris Faust <[EMAIL PROTECTED]> wrote: > Our mod_perl success story. > > > > As consultants we were hired to repair, revamp and > rebuild a online > classifieds site in which a lot of cost and effort > was placed in promoting > the site and generating traffic but the site itself > was based on a 3rd party > product that simply could not handle the half > million hits a day the site > was getting. > > > > Without a lot of effort the decision was made to > build a custom solution > from the ground up using Perl and Apache under > Linux. > > After completing the project and having some > difficult issues with the > current ISP we moved the entire site to an ISP that > we have had a long term > relationship with and who provides us with > everything one would need to > properly maintain such a project. > > > > Little did we know that the second we moved to our > new ISP it was like > opening up the flood gates (long story relating to > other ISP), overnight > this CGI driven site went from a half million hits a > day to a million and > with it came a number of problems, a lot of which > were unfixable without > adding more hardware - there was simply far too much > traffic coming through > during the peak times of the day. > > > > Having spent a week doing everything we could, > optimizing everything > possible it was clear that at best, we may be able > to gain enough to just > keep our heads above water. > > > > Reluctantly we knew we had no choice but to give > mod_perl a try, we really > didn't think it was going to make that much of a > difference but every little > bit counted at this point. > > We knew that it was going to be very difficult to > setup apache and > especially convert our code over - I mean after all > I've heard as many > stories of nightmare conversions as success stories. > > > > After about the first week of pouring through the > documentation and > experimenting on our development server, I realized > HOW WRONG I WAS.. > > > > Once we understood what was expected, conversion of > the current code was > less painful and a lot more interesting to do then > some of the phone calls > or meetings that led up to getting the contract for > the project itself J. > > > > Once everything was done we could see instantly the > improvement on our dev > server, what we didn't know nor what we were > prepared for was what would > happen once this was running in production, I mean > sure it was fast when > there is only 2 of us on the machine, so was the old > site. > > > > What we saw after going live was one of those > moments when you are just > blown away, where you are sitting there saying "I > see it but I just don't > believe it". > > At our best estimate we gained more then a 300% > performance increase, during > peak hours we were seeing load times of 20 - 30, > processing going defunct > etc. etc. prior to mod_perl. > > Since the day we went live we haven't seen the > machines even sweat, even the > DB machine was impacted by the change in a positive > way. > > We are currently up over 2 million hits a day, the 1 > million hits gained > since going live with mod_perl has resulted in > practically nothing > (everything is still saying "Give me More!!!") > > > > We'd like to think it was easy moving to mod_perl > because we are such > awesome coders, but of course the truth is it's due > to the awesome > documentation at http://perl.apache.org, the > fantastic support of mod_perl > in all those perl modules we have all come to depend > on, the invaluable > mailing lists and mailing list archives, and what I > personally think is the > coolest thing of all, Stas Bekman who never left me > or anyone else I've seen > on the mailing list hanging for any answer. > > > > We have just completed a re-design of the site and > have been up and running > under Apache 2 and mod_perl 2 for about 6 months now > with as few problems as > anyone could ever hope to have. > > > > Mod_perl is clearly the solution for high traffic > sites, however because of > our
Re: DSO on Solaris - child dies with seg fault
Thanx Doug for the reply. Unfortunately I still get segfaults :-( No difference. Once I have the time, I'll get the stacktrace & see for any clues. Right now I have kept DSO in the backburner, as I have got PerlFreshRestart fully up and runnig (with a no. of patches to mod_perl) Sreeji --- Doug MacEachern <[EMAIL PROTECTED]> wrote: > you might actually be hitting a problem i just found > on solaris with 2.0 > and perl 5.6.1. a problem that is fixed in > 5.8.0-tobe, where > certain DynaLoader and XSLoader combo prevents > modperl from closing all of > the dlhandles. try adding this to your startup.pl > before use-ing any > other modules: > > use DynaLoader (); > > > __ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com
Re: DSO on Solaris - child dies with seg fault
Hi Stas, Thanx for the reply. However, I had already read the doc. and done everything mentioned there. I had recompiled perl with -Ubincompat5005 as mentioned. I've attached some additional info., generated by trussing the child, as it was being restarted: $truss -ef -o ~/truss.out -r0,1,2 -w0,1,2 -p 26978 Note: I have also tried setting ENV PERL_DESTRUCT_LEVEL to -1 and also to 2, but got the same results. Thanx for any help. Sreeji --- Stas Bekman <[EMAIL PROTECTED]> wrote: > Sreeji K Das wrote: > > Hi, > > > > I was trying to run mod_perl as DSO on Solaris. I > see > > the following line in the logs: > > > > [notice] child pid 24323 exit signal Segmentation > > Fault (11) > > > > This happens whenever I send a USR1 to the server > for > > restart. Also I see the same message whenever the > > child is about to exit (ie. after handling the > > prescribed no.of requests). > > > > Is DSO stable enough to be used under Solaris ? I > have > > searched through the archives & see differing > > opinions. > > > > Additional Info: > > > > > > $perl -V:uselargefiles -V:bincompat5005 > > uselargefiles='define'; > > bincompat5005='undef'; > > > > perl: 5.6.1, Apache: 1.3.23, mod_perl: 1.26 > > Using SunOS 5.6 Generic_105181-16 sun4u sparc > > SUNW,Ultra-80 > > > > I've compiled mod_perl with PERL_USELARGEFILES=0 > and > > USE_DSO. > > The above problem is repeatable with > PerlFreshRestart > > On and Off. > > > > Any clues ? > > > > Thanx > > Sreeji > > (BTW, make test has gone through w/o any errors) > > > > See if it helps > you:http://perl.apache.org/guide/install.html#When_DSO_can_be_Used > > > > __ > Stas BekmanJAm_pH --> Just Another > mod_perl Hacker > http://stason.org/ mod_perl Guide ---> > http://perl.apache.org > mailto:[EMAIL PROTECTED] http://use.perl.org > http://apacheweek.com > http://modperlbook.org http://apache.org > http://ticketmaster.com > __ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com 26978: accept(16, 0xEFFFE95C, 0xEFFFE97C) (sleeping...) 26978: signotifywait() = 16 26978: Received signal #16, SIGUSR1, in accept() [caught] 26978:siginfo: SIGUSR1 pid=26322 uid=300528 26978: lwp_sigredirect(1, SIGUSR1) = 0 26978: accept(16, 0xEFFFE95C, 0xEFFFE97C) Err#4 EINTR 26978: sigprocmask(SIG_SETMASK, 0xEF276450, 0x) = 0 26978: setcontext(0xEFFFE5A8) 26978: sigaction(SIGHUP, 0xEFFFE6D0, 0xEFFFE7D4) = 0 26978: sigaction(SIGUSR1, 0xEFFFE6D0, 0xEFFFE7D4) = 0 26978: write(2, " `", 1) = 1 26978: write(2, 0xEF547EE4, 20)= 20 26978: P e r l C h i l d E x i t H a n d l e r 26978: write(2, 0xEF51E8E3, 33)= 33 26978: ' p u s h _ h a n d l e r s ( ) s t a c k i s e m p t y 26978:\n 26978: write(2, 0xEF547EE4, 20)= 20 26978: P e r l C h i l d E x i t H a n d l e r 26978: write(2, 0xEF51E05A, 19)= 19 26978: h a n d l e r s r e t u r n e d 26978: write(2, " - 1\n", 3) = 3 26978: write(2, " r u n n i n g ", 8) = 8 26978: write(2, " 3", 1) = 1 26978: write(2, 0xEF51F95E, 16)= 16 26978: E N D b l o c k s f o r 26978: write(2, 0xEF547DCC, 13)= 13 26978: p e r l _ s h u t d o w n 26978: write(2, "\n", 1) = 1 26978: getcontext(0xEFFFE320) 26978: getcontext(0xEFFFE158) 26978: write(2, 0x00E90A80, 48)= 48 26978: T S T F o r m s s e r v e r p r o c e s s 2 6 9 7 8 s 26978: h u t t i n g d o w n . . .\n 26978: write(2, 0x013725C0, 40)= 40 26978: R e s e t t i n g c o n n e c t i o n t o d a t a b a s e 26978: @ s i g t e s t 26978: write(2, "\n", 1) = 1 26978: getcontext(0xEFFFE320) 26978: getcontext(0xEFFFE158) 26978: getcontext(0xEFFFE320) 26978: getcontext(0xEFFFE158) 26978: write(2, 0xEF51D770, 48)= 48 26978: d e s t r u c t i n g a n d f r e e i n g P e r l i n t 26978: e r p r e t e r ( l e v e l = 26978: write(2, " 0", 1)
DSO on Solaris - child dies with seg fault
Hi, I was trying to run mod_perl as DSO on Solaris. I see the following line in the logs: [notice] child pid 24323 exit signal Segmentation Fault (11) This happens whenever I send a USR1 to the server for restart. Also I see the same message whenever the child is about to exit (ie. after handling the prescribed no.of requests). Is DSO stable enough to be used under Solaris ? I have searched through the archives & see differing opinions. Additional Info: $perl -V:uselargefiles -V:bincompat5005 uselargefiles='define'; bincompat5005='undef'; perl: 5.6.1, Apache: 1.3.23, mod_perl: 1.26 Using SunOS 5.6 Generic_105181-16 sun4u sparc SUNW,Ultra-80 I've compiled mod_perl with PERL_USELARGEFILES=0 and USE_DSO. The above problem is repeatable with PerlFreshRestart On and Off. Any clues ? Thanx Sreeji (BTW, make test has gone through w/o any errors) __ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com
Re: How to reload PERL module in all Apache children
Hi Stas, > > I was wondering if there is a possibility to > reload PERL module compiled > > into Apache > > with Apache::Registry > > (and I want to reload this module in all Apache > children processes) by running reload-program once. > > Currently Apache::Reload or its equivalent your only > solution. With > mod_perl 2.0 it'll be doable, if you run a single > threaded server. So you mean any modules changed can be reloaded to all children, without actually terminating and starting the server ? (or does single threaded means there are no children ?) Sreeji __ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com
Re: Ordering in %INC for PerlRestart
Hi Perrin/Ged, Thanx for the reply (I hardly get replies for subjects with restart :-( I guess I'm the only one using PerlFreshRestart (sic !). My requirement is to do a neat kill of children and then do a complete restart. I don't want any existing connections to be terminated abruptly. Also I want a complete restart (ie. any modified files should be loaded - using Apache::Reload/StatINC does a lot of stat()'s & further each children would get a separate copy). Restart was working perfectly until mod_perl-1.19. After that a lot has changed. Now I have fixed a lot in mod_perl to get Restart fully working. Sreeji --- Perrin Harkins <[EMAIL PROTECTED]> wrote: > Ged Haywood wrote: > > Hi there, > > > > On Tue, 2 Apr 2002, [iso-8859-1] Sreeji K Das > wrote: > > > > > >>I use PerlFreshRestart on to reload my modules. > > > > [snip] > > > >>However, here my modules are getting loaded before > the > >>PerlRequire'd is loaded (since %INC is a hash). > >> > >>First, can some1 suggest a solution for this ? > > > > > > I always stop (with SIGTERM) and start my servers > rather than using > > restart (SIGUSR1) as I find that there are fewer > surprises. I think > > that Perrin will agree. There are very few > systems that can't cope > > with a few seconds of downtime. > > It's certainly a lot safer, and it won't trash your > shared memory the > way PerlFreshRestart will. > > - Perrin > __ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com
Re: IPC::Open3 Corrected code version
This is a known issue with latest mod_perl. Search the archives for details. This is the temp. solution. Before you call open3() do: untie(*STDIN); untie(*STDOUT); Sreeji --- Rasoul Hajikhani <[EMAIL PROTECTED]> wrote: > Hello folks, > I am writing a web based interface to gpg and am > using IPC::Open3 and > IO::Select to manage STDIN, STDOUT and STDERR > handles. But, I can not > get stdin to work properly. Here is my code: > > $gpgCommand = "gpg --homedir $home > --no-default-keyring > --secret-keyring rasoul.asc --decrypt > $encryptedFile"; > print "$gpgCommand\n"; > $pid= > open3(*FIN,*FOUT,*FERR,"$gpgCommand"); > $SIG{CHLD} = sub { print "REAPER: status $? on > $pid\n" if > waitpid($pid,0) > 0 }; > > > $selector = IO::Select->new(); > $selector->add(*FIN,*FOUT,*FERR); > while (@handles = $selector->handles) > { > foreach my $fh (@handles) > { > if (fileno($fh) == fileno(FERR)) > { > print "STDERR: ", scalar > > } > elsif (fileno($fh) == fileno(FOUT)) > { > @out= ; > } > elsif ((fileno($fh) == fileno(FIN)) > { > print FIN "$passPhrase\n"; > } > $selector->remove($fh) if eof($fh); > } > } > $pf->close; > close FERR; > close FIN; > close FOUT; > > I am using perl 5.053 and Apache/1.3.14 Ben-SSL/1.42 > (Unix) PHP/4.0.3pl1 > mod_perl/1.24_01. > Can anyone see what am I doing wrong? > Thanks in advance > -r __ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com
Ordering in %INC for PerlRestart
Hi I use PerlFreshRestart on to reload my modules. This is the problem I face: I have PerlRequire "bin/startup.pl" which "require"s a lot of perl modules. However, on restart (kill USR1), mod_perl does something like: %temp = %INC; %INC = (); while (($k, $v) = each %temp)) { require $k; } However, here my modules are getting loaded before the PerlRequire'd is loaded (since %INC is a hash). First, can some1 suggest a solution for this ? I'd like to have the PerlRequire modules to load first before the other modules. One solution I could think of is to modify perl_reload_inc() in perl_util.c to load cls->PerlRequire, before loading anything else. However, I find that cls->PerlRequire->nelts = 0, eventhough it's > 0 in perl_starup() in mod_perl.c. Any clues as to why it's getting reset in perl_reload_inc ?? Thanx for any suggestions. Sreeji (BTW, the same setup works w/o a problem in mod_perl-1.19 using perl-5.005. Somehow, ordering of %INC seems to be different in perl-5.6.1) __ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com
Re: PerlFreshRestart, mod_perl DSO, and Apache::StatINC
We had been using Option 1 for a long time & we had absolutely no problems (with mod_perl-1.19/Apache-1.3.14/Perl-5.005). However on upgrading to mod_perl-1.26, we were getting hell lot of errors. I have tracked this to a bug in perl_util.c & on fixing this PerlFreshRestart works w/o any problems. I have posted this details 2/3 weeks back but haven't got any reply. I had to go for option 1, since I was not sure about DSO & StatINC does stats() for every request that comes in - not too good. (even with a touchfile, it has to do stat() !) Sreeji --- Gordon Henriksen <[EMAIL PROTECTED]> wrote: > I'm looking at how to best avoid downtime during a > code upgrade, as we often > do spot releases of critical code fixes and we're > getting to the usage level > that I don't want to interrupt service to deploy > that code. At the same > time, I want to avoid running 200 stat()'s per > request for all of the loaded > modules. > > We're presently running in this configuration: > > Apache 1.3.22 > static mod_perl 1.26 > Apache::StatINC <--Want to get rid of it. > PerlFreshRestart OFF > > I see three options open to me: > > 1. static mod_perl w/ PerlFreshRestart > Reloads %INC. > downside: Heresay claims historical > instablity. > > 2. dynamic mod_perl > Tears down & cleans up Perl interpreter on > graceful restart. > downside: Heresay claims historical > instablity. > > 3. static mod_perl w/ Apache::StatInc > Runs many stat()'s per request. > downside: Runs many stat()'s per request. > > Aside from the historical instability, the second > option strikes me as the > cleanest and most robust. How has the current > stability of these mechanisms? > Is it enterprise-worthy? I'm variously running on > RedHat Linux 7.0 and 7.1. > > -- > > Gordon Henriksen > IT & Engineering > ICLUBcentral Inc. > [EMAIL PROTECTED] > __ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com
PerlFreshRestart bug - comments please
Hi I didn't get a response for my first post :-( So I'm making another try (Sorry for cross-posting - but I guess it's relevant to dev list as well) PerlFreshRestart (is anyone using this feature ?) was giving me a lot of problems giving a lot of 'Undefined Subroutine' errors when I restart (USR1) httpd. I found that it's due to a bug in mod_perl (perl_util.c - perl_reload_inc()). ie. the following seems to be wrong: while (($k, $v) = each(%INC)) { delete($INC{$k}); eval("require $k"); } When you do a require $k, any further 'use' or 'require' in $k will not be loaded, since they are already loaded as per %INC. However that's not the case, since I've used Apache::Symbol to undefine all those (otherwise I'd get a Subroutine redefined error) in PerlRestartHandler. mod_perl-1.19 seems to implement it correctly - but that part of the code was removed in later versions - Any idea why ? ie. there was this line GvHV(incgv) = Nullhv; in perl_util.c (perl_reload_inc), but was removed on later versions. So basically I reintroduced this line to the current version (mod_perl-1.26) & the problems are gone. Can this patch go into the next version ? I guess this is the reason for so many 'Evil things' happening if Restart was on ? I'd like to get some comments before I put this change to production. Expecting a reply this time Thanx Sreeji __ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com
[BUG?] PerlFreshRestart gives undef. subs (not the one in FAQ !!)
Hi All, I had been banging my head on this problem for a while & finally I guess I've found a solution. Following was the problem: I had PerlFreshRestart On PerlRestartHandler Apache::Symbol in my conf. I needed the restart func. & didn't want to use other alternates (like Apache::Reload, StatINC ..etc.). Whenever I did a kill -USR1 I used to get random 'Undefined subroutine xyz called at..'. Following seems to be the problem: mod_perl does something like the following on restart: while (($k, $v) = each(%INC)) { delete($INC{$k}); eval("require $k"); } Now assume that %INC has keys a.pm, File::Basename in that order in %INC. So following is the sequence: delete a.pm from %INC require a.pm Now let's say a.pm does a 'use File::Basename' & then calls basename($temp) (ie. some func in Basename.pm). However 'use File::Basename' will not happen, since perl sees that it exists in %INC (see man perldoc & the entry of use/require/do). However, the truth is All functions in File::Basename had been undef'd by Apache::Symbol (this needs to be done, otherwise I get a func. redefined for all functions on restart). So the call basename($temp) fails with a fatal error 'Undefined subroutine File::Basename::basename called at ...' !! Since %INC is a hash, each time you'd get a different 'Undefined sub' message. For eg. in the above example, if File::Basename had come b4 a.pm in %INC, then we wouldn't have got any errors. So the work around that I did is to undef %INC after making a copy. Now perl would load all modules properly. I went back in time (!) for a while & found that mod_perl-1.19 implements things correctly. Attached simple patch corrected my problem. Would some mod_perl guru do a proper fix (I dunno the internals much) & release a version ? BTW, there was another bug in Apache::Symbol. ie. the following perl -MDevel::Symdump -e '$t = new Devel::Symdump; foreach ($t->packages) { print "$_\n"; "' prints as one of the packages (Only in perl 5.6.1). A work around for the same is also attached. Hope I've made things clear. I can prepare some test scripts to demo these problems, if some1 really requires that. Thanx Sreeji Attached is the patch __ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com patch.mod_perl Description: patch.mod_perl patch.symbol Description: patch.symbol
PerlFreshRestart (Was: Re: Apache::Symbol-calling ->can('undef_functions'))
Hi True, I had already read that doc & also the 'Namespace' collision docs. However, there's no name space collission in my scripts since: 1) The entire code with same config. works with old mod_perl+perl+apache combo. 2) The errors that I get are like 'Undefined subroutine &File::Basename::basename called at ...' Just before this if I check File::Basename->can('basename') I get true & if check %INC, File/Basename.pm exists there. I also did an explict symbol table check (using glob) & found that the function is there ! But funnily perl says it's undefined subroutine ! The actual module & method names change randomly, even if I run with -X ! As for Apache::Reload, the problem is it's going to stat all the files, which I don't want. Alternatively, I'll have to put use Apcahe::Reload, which again is a problem, since I have to modify many files & they all would be unnecessarily stat'ed. I just want Apache to load all the modules, when I give a USR1 - I'm really stuck at this ! (Another option I read somewhere is to compile mod_perl as a DSO, in which case for every restart the entire perl interp. is torn down & reloaded - may be I'll look into that) Thanx Sreeji --- Geoffrey Young <[EMAIL PROTECTED]> wrote: > Sreeji K Das wrote: > > > > Hi > > > > Well, it's only a small part of my big problem :-( > > I'm trying to get PerlFreshRestart working. I had > been > > banging my head against it for almost 5 days & I > was > > thinking about preparing a small test case & > posting. > > > > Well I want apache to load all my perl stuff on > > restart (USR1) - so I enabled PerlFreshRestart (I > > don't want Apache to stat modules on every > request). > > Since I was getting 'subroutine redefined' > warnings, I > > had put > > 'PerlRestartHandler Apache::Symbol' - you got the > > reason for the problem ? > > > > I'm having hell lot of problems with > PerlFreshRestart. > > you will :) see > > http://perl.apache.org/guide/troubleshooting.html#Evil_things_might_happen_when_us > > and the rest of the guide for more details. > > just FYI, but Apache::Reload is much better at > reloading scripts, and > has features that can do pretty much what you want. > > HTH > > --Geoff __ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com
Apache::Symbol-calling ->can('undef_functions')
Hi The following perl -MDevel::Symdump -e '$t = Devel::Symdump->new(main); print $t->packages, "\n";' in perl 5.6.1 returns as one the packages ! Apache::Symbol (mod_perl-1.26) seems to call a 'can('undef_function..' on this values & as a result, a fatal error is thrown ! I have done a 'next if /\/' in Apache::Symbol to work around this. There is no problem in perl-5.005. No one else faced similar problem ? BTW, all this is in Solaris 2.6 Sreeji __ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com