Re: highscalability.com report
LOL - Original Message - From: Rolf Banting To: Perrin Harkins Cc: Jim Schueler ; modperl@perl.apache.org Sent: Wednesday, April 04, 2012 9:13 AM Subject: Re: highscalability.com report On Wed, Apr 4, 2012 at 1:31 PM, Perrin Harkins wrote: ... If they were to rewrite it in Perl today, it would go up again! - Perrin No performance anxiety there then.
Re: Segment Fault when creating a thread
Thanks for the tip Fred. I just now upgraded to 2.0.5 but still get the same error. Mike - Original Message - From: "Fred Moyer" To: "Mike OK" Cc: "mod_perl list" Sent: Tuesday, August 23, 2011 5:26 PM Subject: Re: Segment Fault when creating a thread Might want to try 2.0.5 which is about 6 months old. On Tue, Aug 23, 2011 at 2:23 PM, Mike OK wrote: I must have a problem with my mod_perl set up. When I try to run this script, I get a "child pid 451 exit signal Segmentation fault (11)". It seems that creating the thread causes the error. This is the startup line from the log file with the apache, mod_perl, and perl versions. Apache/2.2.11 (Unix) mod_perl/2.0.4 Perl/v5.8.5 configured -- resuming normal operations The script that causes a failure is #!/usr/bin/perl -wT use strict; use threads; use threads::shared; my $temp = threads->new(\&foo,"mike"); exit; sub foo { my $input = shift; my $number = int(rand(10)); print "this went in the thread\n"; return($number); }
Segment Fault when creating a thread
I must have a problem with my mod_perl set up. When I try to run this script, I get a "child pid 451 exit signal Segmentation fault (11)". It seems that creating the thread causes the error. This is the startup line from the log file with the apache, mod_perl, and perl versions. Apache/2.2.11 (Unix) mod_perl/2.0.4 Perl/v5.8.5 configured -- resuming normal operations The script that causes a failure is #!/usr/bin/perl -wT use strict; use threads; use threads::shared; my $temp = threads->new(\&foo,"mike"); exit; sub foo { my $input = shift; my $number = int(rand(10)); print "this went in the thread\n"; return($number); }
Re: PerlRun Subroutine redefine warnings
This error occurs when you have two subroutines with the same name. Mike O'Krongli President and CTO Acorg Inc 519 432-1185 - Original Message - From: "Kiran Kumar" To: Sent: Wednesday, August 26, 2009 8:07 PM Subject: PerlRun Subroutine redefine warnings Hi, I am running mod_perl/2.0.4 on Linux , I keep getting the subroutine redefined warnings. Perlrun reloads the cgi on each request so why do I keep getting these warnings ? Is there any other way to avoid this other than no warnings qw/redefine/ in my scripts. Am I missing something here ?. Here is a minimal script I tested with #!/usr/bin/perl use strict; use warnings; print "Content-type:text/html \n\n"; test(); test(); sub test { print " in test \n"; } and here is my httpd.conf PerlModule ModPerl::PerlRun SetHandler perl-script PerlHandler ModPerl::PerlRun PerlSetVar ReloadAll Off PerlResponseHandler +ModPerl::PerlRun PerlOptions +ParseHeaders PerlSendHeader On Options +ExecCGI PerlRequire "/opt/nms/www/cgi-bin/startup.pl" # I modify @INC in startup.pl and do not load any modules Error in the error_log Subroutine test redefined at /opt/nms/www/cgi-bin/test1.pl line 22. Subroutine test redefined at /opt/nms/www/cgi-bin/test1.pl line 10. Thanks, Kiran
Re: quick pure perl question
Check out this man page http://perldoc.perl.org/functions/open.html For encoding UTF8, the example is open(FH, "<:encoding(UTF-8)", "file") Mike - Original Message - From: "André Warnier" To: "mod_perl list" Sent: Sunday, June 28, 2009 11:41 AM Subject: quick pure perl question Hi. By curiosity, and just in case anyone knows off-hand : perl 5.8.8 In a script, I substantially do this : open(FIRST,'<:utf8',$name1); open(SECOND,'>:raw',$name2); while(defined($line = )) { print SECOND $line; } and I get warnings : "wide character in print to ,.." I mean, I know that my data is UTF-8, and I know that some characters are going to be "wide", and that's how I want them. I also know that I could specify the output I/O layer as 'utf8' (which avoids the warning). But why do I get warnings when I specified 'raw' as the I/O layer ? Doesn't 'raw' mean like 'as is' ?
Re: compiling problems with mod_perl 2.0.3 and Apache 2.2.6
Hi Arthur Are you building a static apache or dynamic that uses .so modules?? Mike - Original Message - From: "ArthurG" To: Sent: Tuesday, June 16, 2009 4:05 PM Subject: Re: compiling problems with mod_perl 2.0.3 and Apache 2.2.6 I have encountered the same mod_perl make problem working with these releases: Perl 5.8.9 Apache 2.2.3 mod_perl 2.0.4 a...@arthur-desktop:~/Downloads/mod_perl-2.0.4$ make cd "src/modules/perl" && make make[1]: Entering directory `/home/artg/Downloads/mod_perl-2.0.4/src/modules/perl' cc -I/home/artg/Downloads/mod_perl-2.0.4/src/modules/perl -I/home/artg/Downloads/mod_perl-2.0.4/xs -I/home/artg/Downloads/httpd-2.2.3/include -I/home/artg/Downloads/httpd-2.2.3/srclib/apr/include -I/home/artg/Downloads/httpd-2.2.3/srclib/apr-util/include -I/home/artg/Downloads/httpd-2.2.3/os/unix -fno-strict-aliasing -pipe -I/usr/local/include -I/usr/local/lib/perl5/5.8.9/i686-linux/CORE -DMOD_PERL -DMP_COMPAT_1X -O2 -c mod_perl.c In file included from /home/artg/Downloads/httpd-2.2.3/include/ap_config.h:25, from /home/artg/Downloads/httpd-2.2.3/include/httpd.h:43, from modperl_apache_includes.h:27, from mod_perl.h:20, from mod_perl.c:17: /home/artg/Downloads/httpd-2.2.3/srclib/apr/include/apr.h:270: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘apr_off_t’ Making apr via pushd ../httpd-2.2.3/srclib/apr make sudo make install proceeds without problems. John D Groenveld-2 wrote: In message <4795b02302c100047...@agrippa.hbz-nrw.de>, "Heiko Jansen" writes : No - at least not for me (Solaris 10, 64Bit, Sun cc): 2.0.3 won't build Working for me so far. $ cd /tmp/httpd-2.2.8 $ env PATH=/usr/bin:/usr/ccs/bin:/opt/SUNWspro/bin:/usr/sfw/bin \ CC=cc CFLAGS="-m64 -xO3" LDFLAGS="-m64 -L/usr/sfw/lib/64 -R/usr/sfw/lib/64" \ ./configure --with-expat=/usr/sfw --with-ssl=/usr/sfw --enable-ssl \ --enable-proxy --enable-rewrite --enable-modules=all --enable-mods-shared=all \ --prefix=/opt/apache2 # make install Edit apr_rules.mk and config_vars.mk in /opt/apache2/build and add "-m64" to EXTRA_LDFLAGS Add "-m64" to LDFLAGS in /opt/apache2/bin/apr-1-config $ cd /tmp/perl-5.10.0 $ env PATH=/usr/bin:/usr/ccs/bin:/opt/SUNWspro/bin \ ./Configure -Dprefix=/opt/apache2/perl-5.10.0 -Dcc=cc -Duseshrplib \ -Uusemymalc -Duselargefiles -Ubincompat5005 -Doptimize=-xO3 -Duse64bitall # make install $ cd /tmp/mod_perl-2.0.3 $ env PATH=/usr/bin:/usr/ccs/bin:/opt/SUNWspro/bin \ /opt/apache2/perl-5.10.0/bin/perl Makefile.PL MP_APXS=/opt/apache2/bin/apxs # make install John groenv...@acm.org -- View this message in context: http://www.nabble.com/compiling-problems-with-mod_perl-2.0.3-and-Apache-2.2.6-tp14946923p24061845.html Sent from the mod_perl - General mailing list archive at Nabble.com.
Re: Problem installing mod_perl2 on Clarkconnect [solved]
Hi Fred Thanks for your help. I removed all of apache 2.0 and upgraded to 2.2 I also removed all previous files that were installed while building mod_perl. I then rebuilt mod_perl from the command line with 2.0.4. Those two tests still failed while running make test. Since it was a system wide config, I then su'd to root and forced the install. After adding the LoadModule line and ensuring it was in the correct directory, I got the mod_perl message in error_log. I am hoping that's all I need. Mike - Original Message - From: "Fred Moyer" To: "Mike OK" Cc: Sent: Monday, June 15, 2009 7:15 PM Subject: Re: Problem installing mod_perl2 on Clarkconnect On Mon, Jun 15, 2009 at 4:04 PM, Mike OK wrote: Thanks for the reply Fred. Today I upgraded from apache 2.0 to 2.2 and still are having the test errors. I will continue through and install without test to see what happens. You are probably fine unless you have some complex authentication code that isn't working ok. My app uses some auth handlers and didn't have any issues with those failures under 2.0.4. Any idea where I can find 2.0.5-dev?? Mike You can pull it from subversion here: http://perl.apache.org/download/source.html#Development_mod_perl_2_0_Source_Distribution - Original Message - From: "Fred Moyer" To: "Mike OK" Cc: Sent: Monday, June 15, 2009 6:52 PM Subject: Re: Problem installing mod_perl2 on Clarkconnect On Mon, Jun 15, 2009 at 8:19 AM, Mike OK wrote: t/hooks/authen_basic.t (Wstat: 0 Tests: 4 Failed: 1) Failed test: 4 t/hooks/authz.t (Wstat: 0 Tests: 4 Failed: 1) Failed test: 4 Files=238, Tests=2557, 193 wallclock secs ( 3.25 usr 0.91 sys + 151.19 cusr 26.60 csys = 181.95 CPU) Result: FAIL Failed 2/238 test programs. 2/2557 subtests failed. Pretty sure those are fixed in 2.0.5-dev I ignored the error and forced an install as root anyway and my machine says mod_perl2 is up to date. When I restart apache, I get no mod_perl enabled message in error_log. You could try adding this after the LoadModule directive: PerlModule Apache2::Const; PerlChildInitHandler sub { say("process $$ is born to serve"); return Apache2::Const::OK } or some variation on that, and you'll see a message in the log for each mod_perl enabled child process that starts up I have include the loadmodule line inside of httpd.conf. LoadModule perl_module modules/mod_perl.so /httpd/logs/error_log [Sun Jun 14 22:43:41 2009] [notice] Apache configured -- resuming normal operations [Mon Jun 15 00:12:24 2009] [notice] caught SIGTERM, shutting down [Mon Jun 15 00:12:24 2009] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) [Mon Jun 15 00:12:24 2009] [notice] Digest: generating secret for digest authentication ... [Mon Jun 15 00:12:24 2009] [notice] Digest: done [Mon Jun 15 00:12:24 2009] [notice] LDAP: Built with OpenLDAP LDAP SDK [Mon Jun 15 00:12:24 2009] [notice] LDAP: SSL support unavailable [Mon Jun 15 00:12:24 2009] [notice] Apache configured -- resuming normal operations Any help would be greatly appreciated Thanks Mike
Re: Problem installing mod_perl2 on Clarkconnect
Thanks for the reply Fred. Today I upgraded from apache 2.0 to 2.2 and still are having the test errors. I will continue through and install without test to see what happens. Any idea where I can find 2.0.5-dev?? Mike - Original Message - From: "Fred Moyer" To: "Mike OK" Cc: Sent: Monday, June 15, 2009 6:52 PM Subject: Re: Problem installing mod_perl2 on Clarkconnect On Mon, Jun 15, 2009 at 8:19 AM, Mike OK wrote: t/hooks/authen_basic.t (Wstat: 0 Tests: 4 Failed: 1) Failed test: 4 t/hooks/authz.t (Wstat: 0 Tests: 4 Failed: 1) Failed test: 4 Files=238, Tests=2557, 193 wallclock secs ( 3.25 usr 0.91 sys + 151.19 cusr 26.60 csys = 181.95 CPU) Result: FAIL Failed 2/238 test programs. 2/2557 subtests failed. Pretty sure those are fixed in 2.0.5-dev I ignored the error and forced an install as root anyway and my machine says mod_perl2 is up to date. When I restart apache, I get no mod_perl enabled message in error_log. You could try adding this after the LoadModule directive: PerlModule Apache2::Const; PerlChildInitHandler sub { say("process $$ is born to serve"); return Apache2::Const::OK } or some variation on that, and you'll see a message in the log for each mod_perl enabled child process that starts up I have include the loadmodule line inside of httpd.conf. LoadModule perl_module modules/mod_perl.so /httpd/logs/error_log [Sun Jun 14 22:43:41 2009] [notice] Apache configured -- resuming normal operations [Mon Jun 15 00:12:24 2009] [notice] caught SIGTERM, shutting down [Mon Jun 15 00:12:24 2009] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) [Mon Jun 15 00:12:24 2009] [notice] Digest: generating secret for digest authentication ... [Mon Jun 15 00:12:24 2009] [notice] Digest: done [Mon Jun 15 00:12:24 2009] [notice] LDAP: Built with OpenLDAP LDAP SDK [Mon Jun 15 00:12:24 2009] [notice] LDAP: SSL support unavailable [Mon Jun 15 00:12:24 2009] [notice] Apache configured -- resuming normal operations Any help would be greatly appreciated Thanks Mike
Problem installing mod_perl2 on Clarkconnect
Hi I am experiencing some trouble getting mod_perl installed using cpan. After much research online, I have found a bug report that seems to match with the following output generated after a test. Test Summary Report --- t/hooks/authen_basic.t (Wstat: 0 Tests: 4 Failed: 1) Failed test: 4 t/hooks/authz.t (Wstat: 0 Tests: 4 Failed: 1) Failed test: 4 Files=238, Tests=2557, 193 wallclock secs ( 3.25 usr 0.91 sys + 151.19 cusr 26.60 csys = 181.95 CPU) Result: FAIL Failed 2/238 test programs. 2/2557 subtests failed. [warning] server localhost.localdomain:8529 shutdown [ error] error running tests (please examine t/logs/error_log) ++ | Please file a bug report: http://perl.apache.org/bugs/ | ++ make: *** [run_tests] Error 1 GOZER/mod_perl-2.0.4.tar.gz /usr/bin/make test -- NOT OK I ignored the error and forced an install as root anyway and my machine says mod_perl2 is up to date. When I restart apache, I get no mod_perl enabled message in error_log. I have include the loadmodule line inside of httpd.conf. LoadModule perl_module modules/mod_perl.so /httpd/logs/error_log [Sun Jun 14 22:43:41 2009] [notice] Apache configured -- resuming normal operations [Mon Jun 15 00:12:24 2009] [notice] caught SIGTERM, shutting down [Mon Jun 15 00:12:24 2009] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) [Mon Jun 15 00:12:24 2009] [notice] Digest: generating secret for digest authentication ... [Mon Jun 15 00:12:24 2009] [notice] Digest: done [Mon Jun 15 00:12:24 2009] [notice] LDAP: Built with OpenLDAP LDAP SDK [Mon Jun 15 00:12:24 2009] [notice] LDAP: SSL support unavailable [Mon Jun 15 00:12:24 2009] [notice] Apache configured -- resuming normal operations Any help would be greatly appreciated Thanks Mike
Re: Sort issue
After a few off list hints and hours of searching and reading I have solved the issue. Here is the link to the page I found helpful. Very belated thanks (almost 6 years) goes to Stas Bekman. Mike http://www.gossamer-threads.com/lists/modperl/modperl/35645?search_string=so rt%20subroutine;#35645 - Original Message - From: "Mike OK" <[EMAIL PROTECTED]> To: Sent: August 13, 2006 11:32 AM Subject: Sort issue > Hi > > I would like to do some custom sorting with some hash data that I have > stored. It will be used in a mod_perl application so I would like to ensure > that the variables are safe and local. My worry is that I plan to call a > subroutine with sort but I have no idea how to pass the variables or if I > even have to. Here is what I am planning. Any advice or links would help. > Thanks a lot. Mike > > @sortedkeys = sort by_field keys(%names); > > sub by_fields { >my ($first_compare,$first_extra) = $names{$a}; >my ($second_compare,$second_extra) = $names{$b}; >### I am spliting the value to sort on a secondary field other than the > key >($first_compare <=> $second_compare || $first_extra <=> $second_extra); > } > > > > -- > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.1.405 / Virus Database: 268.10.7/411 - Release Date: 2006-08-07 > >
Sort issue
Hi I would like to do some custom sorting with some hash data that I have stored. It will be used in a mod_perl application so I would like to ensure that the variables are safe and local. My worry is that I plan to call a subroutine with sort but I have no idea how to pass the variables or if I even have to. Here is what I am planning. Any advice or links would help. Thanks a lot. Mike @sortedkeys = sort by_field keys(%names); sub by_fields { my ($first_compare,$first_extra) = $names{$a}; my ($second_compare,$second_extra) = $names{$b}; ### I am spliting the value to sort on a secondary field other than the key ($first_compare <=> $second_compare || $first_extra <=> $second_extra); }
Re: up2date mess continued: serious leakage!
Hi Why not try declaring the variables with "my" instead. A quote from O'Reilly's Perl in a Nutshell Dynamic variables are visible to other subroutines called from within their scope. Dynamic variables are defined with local, and they are not private variables, but rather they are global variables with temporary values. When a subroutine is executed, the global value is hidden away, and the local value is used. Once the scope is exited, the original global value is used. Most of the time you will want to use my to localize parameters in a subroutine. Mike - Original Message - From: Andre To: modperl@perl.apache.org Sent: August 11, 2006 9:42 PM Subject: up2date mess continued: serious leakage! Hello Now the variables leak despite what I do. Can you guys confirm if this script isn't supposed to leak? It's totally mad, confusing all usernames. Thanks André PS: it's a simple test.cgi wich I am calling with test.cgi?username=jane test.cgi?username=jack test.cgi?username=stacey ... and it keeps confusing all names. I'm using 'local our's, so I think it shouldn't be leaking, and this is a problem at my mod_perl installation. So what could be causing this there? What do I do? #!/usr/bin/perl -wT use strict; use CGI; local our $q = new CGI; local our $username = $q->param('username'); print "Content-type: text/html\n\n"; defined $username and print "Hello there, your username is $username "; ! defined $username and print "[no username provided]"; No virus found in this incoming message.Checked by AVG Free Edition.Version: 7.1.405 / Virus Database: 268.10.7/411 - Release Date: 2006-08-07
Re: -M in modperl
OK, I can see that. I really don't have much more information to add. I pulled my hair out for days trying to get the opendir readdir combination to work. While searching, I came across another post that pointed at the specific kernal I am using. I believe it was the way perl behaved with it. This is the kernal image I have currently in my box /boot/vmlinuz-2.4.18-27.7.x I cannot say 100% that I have not rebuilt that box but I think it's still the same. For clarity, I have no experience in kernal programming and was only repeating what I saw in a post and worked for me. Mike - Original Message - From: "Randal L. Schwartz" To: "Mike OK" <[EMAIL PROTECTED]> Cc: "LUKE" <[EMAIL PROTECTED]>; Sent: January 12, 2006 1:53 PM Subject: Re: -M in modperl > >>>>> "Mike" == Mike OK <[EMAIL PROTECTED]> writes: > > Mike> The problem may lie in the kernal itself. I had a similar problem > Mike> and found that the kernal was to blame. > > This is a broad statement, and generates FUD. Can you be more specific? Can > you say where you thought the Kernel was to blame? Can you show an example? > > This is a bit like blaming the car when you hit the curb while parking. > *Maybe* it's the car, but when millions of people manage to park a car just > fine, it might not be the car. :) > > -- > Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 > http://www.stonehenge.com/merlyn/> > Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. > See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! > > > -- > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.1.371 / Virus Database: 267.14.17/227 - Release Date: 2006-01-11 > >
Re: -M in modperl
Hi The problem may lie in the kernal itself. I had a similar problem and found that the kernal was to blame. Here is the code I can use in place of the READDIR. Mike my $name; $file = $file . '/'; if ( -d $file ) { if ( $readdir_hack eq "yes" ) { $directory = $file; $directory = $directory . "*"; @files = <${directory}>; chop $directory; for ( $i = 0; $i < @files; $i++ ) { $files[$i] =~ s/$directory//ig; $name = $files[$i]; if ( $name !~ /\b\.+/ ) { } elsif ( $name =~ /stat$/ ) { $name =~ s/\.stat//; } } } - Original Message - From: "LUKE" <[EMAIL PROTECTED]> To: Sent: January 12, 2006 11:58 AM Subject: -M in modperl > opendir( DIR, "/path" ); > my @dots = grep(/recovery/,sort { -M $a <=> -M $b } readdir(DIR)); > closedir(DIR); > > Can not work in mod_perl?? How to solve it?? > > > > -- > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.1.371 / Virus Database: 267.14.17/227 - Release Date: 2006-01-11 > >
Re: Why does my MP2 crash intermittently?
Hi Looks like you should have done a Google search. The problem looks to be an operating system error. Here is a quote from the Microsoft Knowledge base (http://support.microsoft.com/?kbid=262490) "This behavior occurs because the operating system does not allocate a large enough buffer for the maximum string length permitted. When the data is greater than the buffer size, the Winlogon service terminates abnormally and your computer generates the error message. " Gotta love Microsoft eh??? Mike - Original Message - From: Foo Ji-Haw To: modperl@perl.apache.org Sent: September 12, 2005 10:51 PM Subject: Why does my MP2 crash intermittently? Hello all, I have set up my MP2 application, which in the course of development has been reasonably stable. But when I put it under reasonably load (I have a daemon with 5 threads that call it periodically, and I browse around the pages with 2 other collegues), sometimes I get this error (see attached for the actually screenshot): The instruction at "0x280877f1" referenced memory at "0x515ee28". The memory coudl not be "read". The application basically freezes at this point. Clicking on the OK button seems to bring MP2 back to operations immediately. Looking at the log, Apache seems to have restarted. This is very annoying, as my app is generally ready to go, but intermittent errors like this makes it otherwise. Nothing else is capture in the log, so I don't know where to go to discover the culprit. Can anyone please advise me on this? Appreciate it! No virus found in this incoming message.Checked by AVG Anti-Virus.Version: 7.0.344 / Virus Database: 267.10.21/96 - Release Date: 2005-09-10
Saving files to another server
Hi I am looking for some opinions on how to best handle this situation. I am willing to do all of the research about each topic but would like some points of view on how others would handle this. Thanks Mike - I have developed a search engine that caches the results - Currently I save the results in a text file on the local machine that runs apache - This system works well for the test system but I need to have a central storage system for these requests - I plan on having over 250 and up to 1000's different servers saving and retrieving information from this central system - I currently have a linux box with the reiser filesystem installed ready for this central system because it handles lots and lots of small files very well - My thought is that the file system would be quicker for lookups than a MySQL database (I use it in other areas of the system) - I have looked at cpan and have found a module file::remote that I could use but I feel there might be a more efficient solution - Since this is happening on a local network, I could assign a port for each server to save connection overhead Any thoughts on this subject would be greatly appreciated. Thanks again.