You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Batara Kesuma <bk...@ml.gaijinweb.com> on 2003/05/25 21:04:01 UTC

PerlRun error - Not a CODE reference

Hi,

I have problem running PerlRun. My version is:
mod_perl-1.99_05-3
httpd-2.0.40-8

My setting looks like this:
** httpd.conf **
LoadModule perl_module modules/mod_perl.so
PerlRequire /etc/httpd/conf/startup.pl
SetHandler perl-script
PerlHandler ModPerl::PerlRun
PerlOptions +ParseHeaders
Options +ExecCGI

** startup.pl **
#!/usr/bin/perl
use Apache2;
use Apache::compat ();
1;

Then I tried to run some scripts:
** test.cgi **
#!/usr/bin/perl
use strict;
use CGI;
require "/var/www/html/require.pl";
my $cgi = CGI::->new();
print $cgi->header();
print "Perl Run";

** require.pl **
#!/usr/bin/perl
use strict;
sub from_require {
  print "<br>This is inside require.pl<br><br>";
}
1;

And then I restart Apache and I access test.cgi. The first 8 times are
fine, and no errrors. But after the 9th reload, I got:
Server error!

    The server encountered an internal error and was unable to complete
your request. 

    Error message:
    Not a CODE reference at /var/www/html/test.cgi line 8. 

    If you think this is a server error, please contact the webmaster 

What happened? And how can I fix this? Please help, and thank you very
much.




Re: PerlRun error - Not a CODE reference

Posted by Perrin Harkins <pe...@elem.com>.
Batara Kesuma wrote:
> my $cgi = CGI::->new();

Should be:
my $cgi = CGI->new();

- Perrin


Re: PerlRun error - Not a CODE reference

Posted by Batara Kesuma <bk...@ml.gaijinweb.com>.
Hi Dale,

> I tried to run the same configuration a while back using the stock
> release of RedHat 8.0 and received the same problem.  Stas gave me a few
> ideas to try but nothing worked, so I gave up using Apache 2.0 with
> PerlRun mode and had to drop back to Apache 1.3 with mod_perl 1.27.  I
> think you might be at the same dead end that I hit and I spend dozens of
> hours trying to get it to work to no avail.
> 
> If you do find the magic bullet, please make sure to post the fix to the
> list so I can benefit from your experience.

I upgraded to 1.99_09 and it works perfectly now. Just go and get it here:
http://perl.apache.org/dist/mod_perl-2.0-current.tar.gz

And you also need to upgrade your CGI.pm to 2.93 to pass the test.

I also have built RPM for my system (RedHat 8.0), you can ask for it if
you want.



Re: PerlRun error - Not a CODE reference

Posted by Dale Lancaster <da...@123hire.com>.
Hi Batara,

I tried to run the same configuration a while back using the stock release
of RedHat 8.0 and received the same problem.  Stas gave me a few ideas to
try but nothing worked, so I gave up using Apache 2.0 with PerlRun mode and
had to drop back to Apache 1.3 with mod_perl 1.27.  I think you might be at
the same dead end that I hit and I spend dozens of hours trying to get it to
work to no avail.

If you do find the magic bullet, please make sure to post the fix to the
list so I can benefit from your experience.

thanks
dale

----- Original Message ----- 
From: "Batara Kesuma" <bk...@ml.gaijinweb.com>
To: <mo...@perl.apache.org>
Sent: Sunday, May 25, 2003 3:04 PM
Subject: PerlRun error - Not a CODE reference


> Hi,
>
> I have problem running PerlRun. My version is:
> mod_perl-1.99_05-3
> httpd-2.0.40-8
>
> My setting looks like this:
> ** httpd.conf **
> LoadModule perl_module modules/mod_perl.so
> PerlRequire /etc/httpd/conf/startup.pl
> SetHandler perl-script
> PerlHandler ModPerl::PerlRun
> PerlOptions +ParseHeaders
> Options +ExecCGI
>
> ** startup.pl **
> #!/usr/bin/perl
> use Apache2;
> use Apache::compat ();
> 1;
>
> Then I tried to run some scripts:
> ** test.cgi **
> #!/usr/bin/perl
> use strict;
> use CGI;
> require "/var/www/html/require.pl";
> my $cgi = CGI::->new();
> print $cgi->header();
> print "Perl Run";
>
> ** require.pl **
> #!/usr/bin/perl
> use strict;
> sub from_require {
>   print "<br>This is inside require.pl<br><br>";
> }
> 1;
>
> And then I restart Apache and I access test.cgi. The first 8 times are
> fine, and no errrors. But after the 9th reload, I got:
> Server error!
>
>     The server encountered an internal error and was unable to complete
> your request.
>
>     Error message:
>     Not a CODE reference at /var/www/html/test.cgi line 8.
>
>     If you think this is a server error, please contact the webmaster
>
> What happened? And how can I fix this? Please help, and thank you very
> much.
>
>


Re: mp2.0 - make test failed compat/apache_util.t

Posted by Stas Bekman <st...@stason.org>.
Batara Kesuma wrote:
> Hi Stas,
> 
> 
>>glib uses LC_ env vars. This is from the bash manpage:
>>
>>        LANG   Used to determine the  locale  category  for  any 
>>        category  not
>>               specifically selected with a variable starting with LC_.
>>        LC_ALL This  variable  overrides  the  value  of LANG and any
>>        other LC_
>>               variable specifying a locale category.
> 
> 
> 
> Thank you for the information. Changing LC_ALL will change all LC_* except
> LANG, and changing LANG will change LC_* _if_ LC_ALL is not set. If LC_ALL
> is set, then chaning LANG will only affect LANG itself.

This doesn't happen on my setup / glibc-2.3.1 (looks like a bug in glibc)/

> My locale looks like:
> [root@shibuya-dv1 mod_perl-1.99_09]# locale
> LANG=ja_JP.eucJP
> LC_CTYPE="ja_JP.eucJP"
> LC_NUMERIC="ja_JP.eucJP"
> LC_TIME="ja_JP.eucJP"
> LC_COLLATE="ja_JP.eucJP"
> LC_MONETARY="ja_JP.eucJP"
> LC_MESSAGES="ja_JP.eucJP"
> LC_PAPER="ja_JP.eucJP"
> LC_NAME="ja_JP.eucJP"
> LC_ADDRESS="ja_JP.eucJP"
> LC_TELEPHONE="ja_JP.eucJP"
> LC_MEASUREMENT="ja_JP.eucJP"
> LC_IDENTIFICATION="ja_JP.eucJP"
> LC_ALL=
> 
> Without your apache_util.pm patch, make test will fail on apache_util
> test. After I applied your apache_util.pm patch, then make test can pass
> apache_util test. Thank you very much.

Doi toshimashte, however all I did is change the code to skip that test if we 
aren't running under $ENV{LANG} =~ /^en_/. I'm not sure if it's better to try 
to make it working for any locale setting. If you know how to fix that, by all 
means send a patch.

> PS. I have sent the cgi.t error report too, please check it out if you
> have time.

sure


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: mp2.0 - make test failed compat/apache_util.t

Posted by Batara Kesuma <bk...@ml.gaijinweb.com>.
Hi Stas,

> glib uses LC_ env vars. This is from the bash manpage:
> 
>         LANG   Used to determine the  locale  category  for  any 
>         category  not
>                specifically selected with a variable starting with LC_.
>         LC_ALL This  variable  overrides  the  value  of LANG and any
>         other LC_
>                variable specifying a locale category.


Thank you for the information. Changing LC_ALL will change all LC_* except
LANG, and changing LANG will change LC_* _if_ LC_ALL is not set. If LC_ALL
is set, then chaning LANG will only affect LANG itself.

My locale looks like:
[root@shibuya-dv1 mod_perl-1.99_09]# locale
LANG=ja_JP.eucJP
LC_CTYPE="ja_JP.eucJP"
LC_NUMERIC="ja_JP.eucJP"
LC_TIME="ja_JP.eucJP"
LC_COLLATE="ja_JP.eucJP"
LC_MONETARY="ja_JP.eucJP"
LC_MESSAGES="ja_JP.eucJP"
LC_PAPER="ja_JP.eucJP"
LC_NAME="ja_JP.eucJP"
LC_ADDRESS="ja_JP.eucJP"
LC_TELEPHONE="ja_JP.eucJP"
LC_MEASUREMENT="ja_JP.eucJP"
LC_IDENTIFICATION="ja_JP.eucJP"
LC_ALL=

Without your apache_util.pm patch, make test will fail on apache_util
test. After I applied your apache_util.pm patch, then make test can pass
apache_util test. Thank you very much.

PS. I have sent the cgi.t error report too, please check it out if you
have time.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: mp2.0 - make test failed compat/apache_util.t

Posted by Stas Bekman <st...@stason.org>.
Batara Kesuma wrote:
> Hi Stas,
> 
> 
>>You don't need to recompile with LANG=en_US, it's a run-time setting.
>>
>>However I'll need your help to resolve this for all those who have a
>>different LC setting. BTW, according to strftime it's LC_TIME env var
>>that matters. or is LANG affecting all other LC_* env vars?
> 
> 
> How can I check this? But since I don't have LC_TIME variable set, I think
> it is LANG that is affecting.

glib uses LC_ env vars. This is from the bash manpage:

        LANG   Used to determine the  locale  category  for  any  category  not
               specifically selected with a variable starting with LC_.
        LC_ALL This  variable  overrides  the  value  of LANG and any other LC_
               variable specifying a locale category.

I can affect the whole locate by changing LC_ALL:

% locale
LANG=en_US
LC_CTYPE=en_US
LC_NUMERIC=en_US
LC_TIME=en_US
LC_COLLATE=en_US
LC_MONETARY=en_US
LC_MESSAGES=en_US
LC_PAPER="en_US"
LC_NAME="en_US"
LC_ADDRESS="en_US"
LC_TELEPHONE="en_US"
LC_MEASUREMENT="en_US"
LC_IDENTIFICATION="en_US"
LC_ALL=

% env LC_ALL=en_UK locale
LANG=en_US
LC_CTYPE="en_UK"
LC_NUMERIC="en_UK"
LC_TIME="en_UK"
LC_COLLATE="en_UK"
LC_MONETARY="en_UK"
LC_MESSAGES="en_UK"
LC_PAPER="en_UK"
LC_NAME="en_UK"
LC_ADDRESS="en_UK"
LC_TELEPHONE="en_UK"
LC_MEASUREMENT="en_UK"
LC_IDENTIFICATION="en_UK"
LC_ALL=en_UK

Notice that LANG didn't change, even though the manpage says that it should.

however changing LANG affects only half vars, and not LC_TIME.

LANG=en_UK
LC_CTYPE=en_US
LC_NUMERIC=en_US
LC_TIME=en_US
LC_COLLATE=en_US
LC_MONETARY=en_US
LC_MESSAGES=en_US
LC_PAPER="en_UK"
LC_NAME="en_UK"
LC_ADDRESS="en_UK"
LC_TELEPHONE="en_UK"
LC_MEASUREMENT="en_UK"
LC_IDENTIFICATION="en_UK"
LC_ALL=

I suppose that this setting is very implementation-specific.

However we could try to set:

LANG=en_US
LC_ALL=en_US

>>Does the test pass as-is if you apply this patch?
> 
> 
> Yes, I pass t/TEST -v compat/apache_util.t after I add:
> $ENV{LANG} = 'en_US';
> in modperl_extra.pl
> 
> But, same error comes up again when I compile. 
> compat/apache_util.............FAILED test 13                             
>   
>         Failed 1/15 tests, 93.33% okay

I'm not quite following your mentioning of 'compile', you *don't* have to 
recompile anything when changing locale settings. Those things get set when a 
shared library is loaded or a binary is started. I suppose that changing 
modperl_extra.pl is too late. It should be changed before httpd is started.

I'd suggest to simply skip this test on machines with non en_ locales, please 
try again with the patch at the end of this email (removing all previous patches).

> The only way I can go through the compat/apache_util test when compiling
> is to set LANG=en_US before I compile.
> 
> When I set LANG=en_US before I compile, I can pass compat/apache_util
> test, but this error comes up:
> cgi................ok 1/2# Failed test 2 in cgi.t at line 19
> cgi................FAILED test 2              
>   
>         Failed 1/2 tests, 50.00% okay
> 
> I will report about this on another thread. 

Yes please.

Index: t/response/TestCompat/apache_util.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/t/response/TestCompat/apache_util.pm,v
retrieving revision 1.2
diff -u -r1.2 apache_util.pm
--- t/response/TestCompat/apache_util.pm        13 Mar 2003 02:12:49 -0000     1.2
+++ t/response/TestCompat/apache_util.pm        27 May 2003 07:32:10 -0000
@@ -28,10 +28,15 @@

  my $crypt_ok = $crypt_supported{lc $^O} ? 1 : 0;

+my $locale = $ENV{LANG} || $ENV{LC_TIME} || '';
+
+# XXX: will any en_XXX work with http_parse?
+my $parse_time_ok = $locale =~ /^en_/ ? 1 : 0;
+
  sub handler {
      my $r = shift;

-    plan $r, tests => 13 + $crypt_ok*2;
+    plan $r, tests => 12 + $parse_time_ok*1 + $crypt_ok*2;

      $r->send_http_header('text/plain');

@@ -71,13 +76,15 @@

      # ht_time(), parsedate()
      my $time = time;
+
      my $fmtdate = Apache::Util::ht_time($time);

      ok t_cmp($fmtdate, $fmtdate, "Apache::Util::ht_time");

-    my $ptime = Apache::Util::parsedate($fmtdate);
-
-    ok t_cmp($time, $ptime, "Apache::Util::parsedate");
+    if ($parse_time_ok) {
+        my $ptime = Apache::Util::parsedate($fmtdate);
+        ok t_cmp($time, $ptime, "Apache::Util::parsedate");
+    }

      if ($crypt_ok) {
          # not all platforms support C-level crypt

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: mp2.0 - make test failed compat/apache_util.t

Posted by Batara Kesuma <bk...@ml.gaijinweb.com>.
Hi Stas,

> You don't need to recompile with LANG=en_US, it's a run-time setting.
> 
> However I'll need your help to resolve this for all those who have a
> different LC setting. BTW, according to strftime it's LC_TIME env var
> that matters. or is LANG affecting all other LC_* env vars?

How can I check this? But since I don't have LC_TIME variable set, I think
it is LANG that is affecting.

> Does the test pass as-is if you apply this patch?

Yes, I pass t/TEST -v compat/apache_util.t after I add:
$ENV{LANG} = 'en_US';
in modperl_extra.pl

But, same error comes up again when I compile. 
compat/apache_util.............FAILED test 13                             
  
        Failed 1/15 tests, 93.33% okay

The only way I can go through the compat/apache_util test when compiling
is to set LANG=en_US before I compile.

When I set LANG=en_US before I compile, I can pass compat/apache_util
test, but this error comes up:
cgi................ok 1/2# Failed test 2 in cgi.t at line 19
cgi................FAILED test 2              
  
        Failed 1/2 tests, 50.00% okay

I will report about this on another thread. 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: mp2.0 - make test failed compat/apache_util.t

Posted by Stas Bekman <st...@stason.org>.
> I think it failed
> because my locale is set to japanese environment (ja_JP.eucJP). When the
> LANG=ja_jp.eucJP, then t/TEST -v will be like:
> 
> [root@shibuya-dv1 mod_perl-1.99_09]# t/TEST -v compat/apache_util.t
[...]
> # testing : Apache::Util::ht_time
> # expected: '火, 27  5月 2003 04:44:03 GMT'
> # received: '火, 27  5月 2003 04:44:03 GMT'
> ok 12
> # testing : Apache::Util::parsedate
> # expected: 1054010643
> # received: '0'
> not ok 13
[...]
> And then if I set it to English (en_US) it will be like:
> [root@shibuya-dv1 mod_perl-1.99_09]# LANG=en_US t/TEST -v
> compat/apache_util.t

> All tests successful.
> Files=1, Tests=15,  1 wallclock secs ( 0.62 cusr +  0.05 csys =  0.67 CPU)
> *** server localhost.localdomain:8529 shutdown
> 
> I will try to compile again with LANG=en_US and post the result again
> here.

You don't need to recompile with LANG=en_US, it's a run-time setting.

However I'll need your help to resolve this for all those who have a different
LC setting. BTW, according to strftime it's LC_TIME env var that matters. or
is LANG affecting all other LC_* env vars?

Does the test pass as-is if you apply this patch?

Index: t/conf/modperl_extra.pl
===================================================================
RCS file: /home/cvs/modperl-2.0/t/conf/modperl_extra.pl,v
retrieving revision 1.29
diff -u -r1.29 modperl_extra.pl
--- t/conf/modperl_extra.pl     14 May 2003 02:26:53 -0000      1.29
+++ t/conf/modperl_extra.pl     27 May 2003 05:28:24 -0000
@@ -1,6 +1,8 @@
 use Socket (); #test DynaLoader vs. XSLoader workaround for 5.6.x
 use IO::File ();

+$ENV{LANG} = 'en_US';
+
 use Apache2 ();

 use ModPerl::Util (); #for CORE::GLOBAL::exit


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: mp2.0 - make test failed compat/apache_util.t

Posted by Batara Kesuma <bk...@ml.gaijinweb.com>.
Hi Stas,

> You forgot to paste the output of the t/TEST -v run (in addition to 
> t/logs/error_log). I thought I made that clear at:
> http://perl.apache.org/docs/2.0/user/help/help.html#_C_make_test___Failures
> Please suggest how to make that even clearer. Thanks.

Wow that was fast reply. Ok, sorry I missed that part. I think it failed
because my locale is set to japanese environment (ja_JP.eucJP). When the
LANG=ja_jp.eucJP, then t/TEST -v will be like:

[root@shibuya-dv1 mod_perl-1.99_09]# t/TEST -v compat/apache_util.t
*** setting ulimit to allow core files
ulimit -c unlimited; t/TEST -v 'compat/apache_util.t'
*** root mode: changing the fs ownership to 'nobody' (99:99)
/usr/sbin/httpd  -d /usr/src/redhat/BUILD/mod_perl-1.99_09/t -f
/usr/src/redhat/BUILD/mod_perl-1.99_09/t/conf/httpd.conf -DAPACHE2
-DPERL_USEITHREADS
using Apache/2.0.40 (prefork MPM)

waiting for server to start: .[Tue May 27 13:43:58 2003] [info] 19
Apache:: modules loaded
[Tue May 27 13:43:58 2003] [info] 3 APR:: modules loaded
[Tue May 27 13:43:58 2003] [info] base server + 8 vhosts ready to run
tests
....
waiting for server to start: ok (waited 3 secs)
server localhost.localdomain:8529 started
server localhost.localdomain:8530 listening (TestProtocol::echo_filter)
server localhost.localdomain:8531 listening (TestProtocol::echo)
server localhost.localdomain:8532 listening (TestPreConnection::note)
server localhost.localdomain:8533 listening (TestFilter::in_str_msg)
server localhost.localdomain:8534 listening (TestFilter__both_str_con_add)
server localhost.localdomain:8535 listening (TestFilter::in_bbs_msg)
server localhost.localdomain:8536 listening (TestDirective::perlmodule)
server localhost.localdomain:8537 listening (TestDirective::perlrequire)
server localhost.localdomain:8538 listening
(TestDirective::perlloadmodule4)
server localhost.localdomain:8539 listening
(TestDirective::perlloadmodule5)
server localhost.localdomain:8540 listening
(TestDirective::perlloadmodule3)
server localhost.localdomain:8541 listening
(TestDirective::perlloadmodule6)
compat/apache_util....1..15
# expected: '40054M'
# received: '40054M'
ok 1
# expected: '   1k'
# received: '   1k'
ok 2
# expected: '40.1M'
# received: '40.1M'
ok 3
# expected: '  41k'
# received: '  41k'
ok 4
# expected: '   0k'
# received: '   0k'
ok 5
# expected: '    -'
# received: '    -'
ok 6
# testing : Apache::Util::escape_uri
# expected: 'http://foo.com/a%20file.html'
# received: 'http://foo.com/a%20file.html'
ok 7
# testing : Apache::Util::escape_path
# expected: 'http://foo.com/a%20file.html'
# received: 'http://foo.com/a%20file.html'
ok 8
# testing : Apache::URI::unescape_uri vs Apache::Util::unescape_uri
# expected: 'http://foo.com/a file.html'
# received: 'http://foo.com/a file.html'
ok 9
# testing : Apache::URI::unescape_uri vs Apache::Util::unescape_uri
# expected: 'http://foo.com/a file.html'
# received: 'http://foo.com/a file.html'
ok 10
# testing : Apache::Util::escape_html
# expected: '&lt;p&gt;&quot;hi&quot;&amp;foo&lt;/p&gt;'
# received: '&lt;p&gt;&quot;hi&quot;&amp;foo&lt;/p&gt;'
ok 11
# testing : Apache::Util::ht_time
# expected: '火, 27  5月 2003 04:44:03 GMT'
# received: '火, 27  5月 2003 04:44:03 GMT'
ok 12
# testing : Apache::Util::parsedate
# expected: 1054010643
# received: '0'
not ok 13
# expected: 1
# received: 1
ok 14
# expected: 0
# received: 0
ok 15
FAILED test 13
        Failed 1/15 tests, 93.33% okay
Failed Test          Stat Wstat Total Fail  Failed  List of Failed
-------------------------------------------------------------------------
------
compat/apache_util.t               15    1   6.67%  13
*** server localhost.localdomain:8529 shutdown
!!! error running tests (please examine t/logs/error_log)


And then if I set it to English (en_US) it will be like:
[root@shibuya-dv1 mod_perl-1.99_09]# LANG=en_US t/TEST -v
compat/apache_util.t
*** setting ulimit to allow core files
ulimit -c unlimited; t/TEST -v 'compat/apache_util.t'
*** root mode: changing the fs ownership to 'nobody' (99:99)
/usr/sbin/httpd  -d /usr/src/redhat/BUILD/mod_perl-1.99_09/t -f
/usr/src/redhat/BUILD/mod_perl-1.99_09/t/conf/httpd.conf -DAPACHE2
-DPERL_USEITHREADS
using Apache/2.0.40 (prefork MPM)

waiting for server to start: .[Tue May 27 13:44:30 2003] [info] 19
Apache:: modules loaded
[Tue May 27 13:44:30 2003] [info] 3 APR:: modules loaded
[Tue May 27 13:44:30 2003] [info] base server + 8 vhosts ready to run
tests
...
waiting for server to start: ok (waited 3 secs)
server localhost.localdomain:8529 started
server localhost.localdomain:8530 listening (TestProtocol::echo_filter)
server localhost.localdomain:8531 listening (TestProtocol::echo)
server localhost.localdomain:8532 listening (TestPreConnection::note)
server localhost.localdomain:8533 listening (TestFilter::in_str_msg)
server localhost.localdomain:8534 listening (TestFilter__both_str_con_add)
server localhost.localdomain:8535 listening (TestFilter::in_bbs_msg)
server localhost.localdomain:8536 listening (TestDirective::perlmodule)
server localhost.localdomain:8537 listening (TestDirective::perlrequire)
server localhost.localdomain:8538 listening
(TestDirective::perlloadmodule4)
server localhost.localdomain:8539 listening
(TestDirective::perlloadmodule5)
server localhost.localdomain:8540 listening
(TestDirective::perlloadmodule3)
server localhost.localdomain:8541 listening
(TestDirective::perlloadmodule6)
compat/apache_util....1..15
# expected: '40054M'
# received: '40054M'
ok 1
# expected: '   1k'
# received: '   1k'
ok 2
# expected: '40.1M'
# received: '40.1M'
ok 3
# expected: '  41k'
# received: '  41k'
ok 4
# expected: '   0k'
# received: '   0k'
ok 5
# expected: '    -'
# received: '    -'
ok 6
# testing : Apache::Util::escape_uri
# expected: 'http://foo.com/a%20file.html'
# received: 'http://foo.com/a%20file.html'
ok 7
# testing : Apache::Util::escape_path
# expected: 'http://foo.com/a%20file.html'
# received: 'http://foo.com/a%20file.html'
ok 8
# testing : Apache::URI::unescape_uri vs Apache::Util::unescape_uri
# expected: 'http://foo.com/a file.html'
# received: 'http://foo.com/a file.html'
ok 9
# testing : Apache::URI::unescape_uri vs Apache::Util::unescape_uri
# expected: 'http://foo.com/a file.html'
# received: 'http://foo.com/a file.html'
ok 10
# testing : Apache::Util::escape_html
# expected: '&lt;p&gt;&quot;hi&quot;&amp;foo&lt;/p&gt;'
# received: '&lt;p&gt;&quot;hi&quot;&amp;foo&lt;/p&gt;'
ok 11
# testing : Apache::Util::ht_time
# expected: 'Tue, 27 May 2003 04:44:34 GMT'
# received: 'Tue, 27 May 2003 04:44:34 GMT'
ok 12
# testing : Apache::Util::parsedate
# expected: 1054010674
# received: '1054010674'
ok 13
# expected: 1
# received: 1
ok 14
# expected: 0
# received: 0
ok 15
ok
All tests successful.
Files=1, Tests=15,  1 wallclock secs ( 0.62 cusr +  0.05 csys =  0.67 CPU)
*** server localhost.localdomain:8529 shutdown

I will try to compile again with LANG=en_US and post the result again
here.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: mp2.0 - make test failed compat/apache_util.t

Posted by Stas Bekman <st...@stason.org>.
Batara Kesuma wrote:
> Hi Stas,
> 
> 
>>>Failed Test          Stat Wstat Total Fail  Failed  List of Failed
>>>---------------------------------------------------------------------
>>>----------
>>>compat/apache_util.t               15    1   6.67%  13
>>
>>Please follow these guidelines to report problems with 'make test':
>>http://perl.apache.org/docs/2.0/user/help/help.html#_C_make_test___Failures
>>
>>And also please make sure to follow these notes:
>>http://perl.apache.org/docs/2.0/user/help/help.html#Reporting_Problems
> 
> 
> Thank you for the reply. Here is the information of my system. If there is
> any more information that you need, please ask. Thank you very much.

You forgot to paste the output of the t/TEST -v run (in addition to 
t/logs/error_log). I thought I made that clear at:
http://perl.apache.org/docs/2.0/user/help/help.html#_C_make_test___Failures
Please suggest how to make that even clearer. Thanks.

     ok t_cmp($time, $ptime, "Apache::Util::parsedate");

The error is:

> # Failed test 13 in
> # /usr/src/redhat/BUILD/mod_perl-1.99_09/t/response/TestCompat/apache_uti
> # l.pm at line 80

which is:

     ok t_cmp($time, $ptime, "Apache::Util::parsedate");

but I need to see the output of t/TEST -v, which shows why the test has failed.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


mp2.0 - make test failed compat/apache_util.t

Posted by Batara Kesuma <bk...@ml.gaijinweb.com>.
Hi Stas,

> > Failed Test          Stat Wstat Total Fail  Failed  List of Failed
> > ---------------------------------------------------------------------
> > ----------
> > compat/apache_util.t               15    1   6.67%  13
> 
> Please follow these guidelines to report problems with 'make test':
> http://perl.apache.org/docs/2.0/user/help/help.html#_C_make_test___Failures
> 
> And also please make sure to follow these notes:
> http://perl.apache.org/docs/2.0/user/help/help.html#Reporting_Problems

Thank you for the reply. Here is the information of my system. If there is
any more information that you need, please ask. Thank you very much.

This is what I get from t/TEST -v compat/apache_util.t:

[root@shibuya-dv1 mod_perl-1.99_09]# cat t/logs/error_log
[Tue May 27 13:06:23 2003] [info] mod_unique_id: using ip addr
219.106.230.74
END in modperl_extra.pl, pid=32103
[Tue May 27 13:06:25 2003] [notice] Digest: generating secret for digest
authentication ...
[Tue May 27 13:06:25 2003] [notice] Digest: done
[Tue May 27 13:06:25 2003] [info] mod_unique_id: using ip addr
219.106.230.74
[Tue May 27 13:06:26 2003] [notice] Apache/2.0.40 (Red Hat Linux)
mod_perl/1.99_09 Perl/v5.8.0 DAV/2 configured -- resuming normal
operations
[Tue May 27 13:06:26 2003] [info] Server built: Sep  4 2002 17:20:34
[Tue May 27 13:06:26 2003] [debug] prefork.c(1039): AcceptMutex: sysvsem
(default: sysvsem)
[Tue May 27 13:06:27 2003] [error] server reached MaxClients setting,
consider raising the MaxClients setting
# Failed test 13 in
# /usr/src/redhat/BUILD/mod_perl-1.99_09/t/response/TestCompat/apache_uti
# l.pm at line 80
[Tue May 27 13:06:27 2003] [info] Child process pid=32106 is exiting
[Tue May 27 13:06:27 2003] [info] removed PID file
/usr/src/redhat/BUILD/mod_perl-1.99_09/t/logs/httpd.pid (pid=32105)
[Tue May 27 13:06:27 2003] [notice] caught SIGTERM, shutting down
END in modperl_extra.pl, pid=32105


And here is output from t/REPORT:

[root@shibuya-dv1 mod_perl-1.99_09]# t/REPORT > mybugreport
[root@shibuya-dv1 mod_perl-1.99_09]# cat mybugreport 

-------------8<---------- Start Bug Report ------------8<----------
1. Problem Description:

I couldn't compile. The error was:

Failed Test          Stat Wstat Total Fail  Failed  List of Failed
-------------------------------------------------------------------------
compat/apache_util.t               15    1   6.67%  13


2. Used Components and their Configuration:

*** using lib/Apache/BuildConfig.pm
*** Makefile.PL options:
  MP_APXS        => /usr/sbin/apxs
  MP_COMPAT_1X   => 1
  MP_GENERATE_XS => 1
  MP_LIBNAME     => mod_perl
  MP_USE_DSO     => 1
  MP_USE_STATIC  => 1


*** /usr/sbin/httpd -V
Server version: Apache/2.0.40
Server built:   Sep  4 2002 17:20:34
Server's Module Magic Number: 20020628:0
Architecture:   32-bit
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D HTTPD_ROOT="/etc/httpd"
 -D SUEXEC_BIN="/usr/sbin/suexec"
 -D DEFAULT_PIDLOG="logs/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="logs/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"


*** /usr/bin/perl -V
Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
  Platform:
    osname=linux, osvers=2.4.18-11smp, archname=i386-linux-thread-multi
    uname='linux daffy.perf.redhat.com 2.4.18-11smp #1 smp thu aug 15
06:41:59 edt 2002 i686 i686 i386 gnulinux '
    config_args='-des -Doptimize=-O2 -march=i386 -mcpu=i686
-Dmyhostname=localhost -Dperladmin=root@localhost -Dcc=gcc -Dcf_by=Red
Hat, Inc. -Dinstallprefix=/usr -Dprefix=/usr -Darchname=i386-linux
-Dvendorprefix=/usr -Dsiteprefix=/usr -Duseshrplib -Dusethreads
-Duseithreads -Duselargefiles -Dd_dosuid -Dd_semctl_semun -Di_db -Ui_ndbm
-Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio
-Dinstallusrbinperl -Ubincompat5005 -Uversiononly -Dpager=/usr/bin/less
-isr'
    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='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
    optimize='-O2 -march=i386 -mcpu=i686',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing
-I/usr/include/gdbm'
    ccversion='', gccversion='3.2 20020822 (Red Hat Linux Rawhide 3.2-5)',
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
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lgdbm -ldb -ldl -lm -lpthread -lc -lcrypt -lutil
    perllibs=-lnsl -ldl -lm -lpthread -lc -lcrypt -lutil
    libc=/lib/libc-2.2.92.so, so=so, useshrplib=true, libperl=libperl.so
    gnulibc_version='2.2.92'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic
-Wl,-rpath,/usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl): 
  Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES
PERL_IMPLICIT_CONTEXT
  Built under linux
  Compiled at Sep  1 2002 23:56:49
  %ENV:
    PERL_LWP_USE_HTTP_10="1"
  @INC:
    /usr/lib/perl5/5.8.0/i386-linux-thread-multi
    /usr/lib/perl5/5.8.0
    /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
    /usr/lib/perl5/site_perl/5.8.0
    /usr/lib/perl5/site_perl/5.6.1
    /usr/lib/perl5/site_perl
    /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
    /usr/lib/perl5/vendor_perl/5.8.0
    /usr/lib/perl5/vendor_perl/5.6.1
    /usr/lib/perl5/vendor_perl
    .


3. This is the core dump trace: (if you get a core dump):

  No core dump.

This report was generated by t/REPORT on Tue May 27 04:10:18 2003 GMT.

-------------8<---------- End Bug Report --------------8<----------

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: PerlRun error - Not a CODE reference

Posted by Batara Kesuma <bk...@ml.gaijinweb.com>.
Hi Stas,

On Tue, 27 May 2003 10:26:10 +1000
Stas Bekman <st...@stason.org> wrote:

> Please follow these guidelines to report problems with 'make test':
> http://perl.apache.org/docs/2.0/user/help/help.html#_C_make_test___Failures
> 
> And also please make sure to follow these notes:
> http://perl.apache.org/docs/2.0/user/help/help.html#Reporting_Problems

I have sent the error report to dev@perl.apache.org. 

Re: PerlRun error - Not a CODE reference

Posted by Stas Bekman <st...@stason.org>.
Batara Kesuma wrote:
> Hi Stas, 
> 
> 
>>8 times? Have you tried running in a single server mode? httpd
>>-DONE_PROCESS
> 
> 
> If I run with httpd -DONE_PROCESS, only the first request will success.
> Also I noticed that if I changed StartServers to 10 instead of 8, then I
> would get 10 success requests. I am running Apache 2 with prefork.c.

That's correct. Therefore if you want to debug things the easy way, you should
use -DONE_PROCESS (only for debugging of course).

>>First upgrade to 1.99_09. Then run its test suite.
> 
>  
> I couldn't compile 1.99_09. 

You did build mod_perl 1.99_09 alright, you have a problem with a single test.

> Here is the error message:
> 
> [... snip ...]
> protocol/echo_filter...........ok                                         
>   
> Failed Test          Stat Wstat Total Fail  Failed  List of Failed
> -------------------------------------------------------------------------
> ------
> compat/apache_util.t               15    1   6.67%  13

Please follow these guidelines to report problems with 'make test':
http://perl.apache.org/docs/2.0/user/help/help.html#_C_make_test___Failures

And also please make sure to follow these notes:
http://perl.apache.org/docs/2.0/user/help/help.html#Reporting_Problems

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: PerlRun error - Not a CODE reference

Posted by Batara Kesuma <bk...@ml.gaijinweb.com>.
Hi Stas, 

> 8 times? Have you tried running in a single server mode? httpd
> -DONE_PROCESS

If I run with httpd -DONE_PROCESS, only the first request will success.
Also I noticed that if I changed StartServers to 10 instead of 8, then I
would get 10 success requests. I am running Apache 2 with prefork.c.


> First upgrade to 1.99_09. Then run its test suite.
 
I couldn't compile 1.99_09. Here is the error message:

[... snip ...]
protocol/echo_filter...........ok                                         
  
Failed Test          Stat Wstat Total Fail  Failed  List of Failed
-------------------------------------------------------------------------
------
compat/apache_util.t               15    1   6.67%  13
*** server localhost.localdomain:8529 shutdown
!!! error running tests (please examine t/logs/error_log)
make: *** [run_tests] エラー 1
エラー: Bad exit status from /var/tmp/rpm-tmp.44395 (%build)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.44395 (%build)

[root@shibuya-dv1 mod_perl-1.99_09]# cat t/logs/error_log 
[Mon May 26 21:06:38 2003] [info] mod_unique_id: using ip addr
219.106.230.74
END in modperl_extra.pl, pid=28317
[Mon May 26 21:06:40 2003] [notice] Digest: generating secret for digest
authentication ...
[Mon May 26 21:06:40 2003] [notice] Digest: done
[Mon May 26 21:06:40 2003] [info] mod_unique_id: using ip addr
219.106.230.74
[Mon May 26 21:06:41 2003] [notice] Apache/2.0.40 (Red Hat Linux)
mod_perl/1.99_09 Perl/v5.8.0 DAV/2 configured -- resuming normal
operations
[Mon May 26 21:06:41 2003] [info] Server built: Sep  4 2002 17:20:34
[Mon May 26 21:06:41 2003] [debug] prefork.c(1039): AcceptMutex: sysvsem
(default: sysvsem)
[Mon May 26 21:06:42 2003] [error] server reached MaxClients setting,
consider raising the MaxClients setting
[Mon May 26 21:06:52 2003] [info] [client 127.0.0.1] TestAPI::aplog test
in progress
[Mon May 26 21:06:52 2003] [debug]
/usr/src/redhat/BUILD/mod_perl-1.99_09/t/response/TestAPI/aplog.pm(43):
log_serror test ok
[Mon May 26 21:06:52 2003] [debug]
/usr/src/redhat/BUILD/mod_perl-1.99_09/t/response/TestAPI/aplog.pm(46):
(20007)No time was provided and one was required.: log_serror test 2 ok
[Mon May 26 21:06:52 2003] [debug]
/usr/src/redhat/BUILD/mod_perl-1.99_09/t/response/TestAPI/aplog.pm(49):
[client 127.0.0.1] (20007)No time was provided and one was required.:
log_rerror test ok
[Mon May 26 21:06:52 2003] [error] $r->log_error test ok
[Mon May 26 21:06:52 2003] [error] $s->log_error test ok
[Mon May 26 21:06:52 2003] [debug]
/usr/src/redhat/BUILD/mod_perl-1.99_09/t/response/TestAPI/aplog.pm(63):
TestAPI::aplog test done
[Mon May 26 21:06:52 2003] [warn] ApacheApache->warn test ok
[Mon May 26 21:06:52 2003] [warn] $s->warn test ok
[Mon May 26 21:07:09 2003] [error] Apache::log_error test ok
# Failed test 13 in
# /usr/src/redhat/BUILD/mod_perl-1.99_09/t/response/TestCompat/apache_uti
# l.pm at line 80

*** The following error entry is expected and it is harmless ***
[Mon May 26 21:07:25 2003] [error] [client 127.0.0.1] Undefined subroutine
&TestError::runtime::no_such_func called at
/usr/src/redhat/BUILD/mod_perl-1.99_09/t/response/TestError/runtime.pm
line 19.


*** The following error entry is expected and it is harmless ***
[Mon May 26 21:07:26 2003] [error] failed to resolve handler
`TestError::syntax'
[Mon May 26 21:07:26 2003] [error] [client 127.0.0.1] syntax error at
/usr/src/redhat/BUILD/mod_perl-1.99_09/t/response/TestError/syntax.pm line
22, near "\;"
Compilation failed in require at (eval 110) line 3.

[echo_filter] get_brigade: 成功です

*** The following error entry is expected and it is harmless ***
[Mon May 26 21:07:47 2003] [error] [client 127.0.0.1] File does not exist:
/usr/src/redhat/BUILD/mod_perl-1.99_09/t/htdocs/nope

*** The following error entry is expected and it is harmless ***
[Mon May 26 21:07:59 2003] [error] [client 127.0.0.1] need AuthName:
/TestModperl__setauth
[Mon May 26 21:08:06 2003] [info] Child process pid=28320 is exiting
[Mon May 26 21:08:06 2003] [info] removed PID file
/usr/src/redhat/BUILD/mod_perl-1.99_09/t/logs/httpd.pid (pid=28319)
[Mon May 26 21:08:06 2003] [notice] caught SIGTERM, shutting down
END in modperl_extra.pl, pid=28319

Whats wrong, and how can I fix this? Thank you very much.




Re: PerlRun error - Not a CODE reference

Posted by Batara Kesuma <bk...@ml.gaijinweb.com>.
Hi Stas,

> First upgrade to 1.99_09. Then run its test suite.
> 
> After, I think Dale, has reported a similar problem, I have written a 
> dedicated test for this report. You can verify whether it works for you
> 
> cd ModPerl-Registry/
> t/TEST -v t/perlrun_require.t
> 
> If it doesn't, please report here. If it does, please check what's
> different in your code from this test. Notice that this test ensures
> that it hits the same interpreter, which you can reproduce with your
> code using 'httpd -DONE_PROCESS'

I have upgraded to 1.99_09, and it works now :) You are my savior, thank
you very much :)


Re: PerlRun error - Not a CODE reference

Posted by Stas Bekman <st...@stason.org>.
Batara Kesuma wrote:
> Hi,
> 
> I have problem running PerlRun. My version is:
> mod_perl-1.99_05-3
> httpd-2.0.40-8
> 
> My setting looks like this:
> ** httpd.conf **
> LoadModule perl_module modules/mod_perl.so
> PerlRequire /etc/httpd/conf/startup.pl
> SetHandler perl-script
> PerlHandler ModPerl::PerlRun
> PerlOptions +ParseHeaders
> Options +ExecCGI
> 
> ** startup.pl **
> #!/usr/bin/perl
> use Apache2;
> use Apache::compat ();
> 1;
> 
> Then I tried to run some scripts:
> ** test.cgi **
> #!/usr/bin/perl
> use strict;
> use CGI;
> require "/var/www/html/require.pl";
> my $cgi = CGI::->new();
> print $cgi->header();
> print "Perl Run";
> 
> ** require.pl **
> #!/usr/bin/perl
> use strict;
> sub from_require {
>   print "<br>This is inside require.pl<br><br>";
> }
> 1;
> 
> And then I restart Apache and I access test.cgi. The first 8 times are
> fine, and no errrors. But after the 9th reload, I got:
> Server error!

8 times? Have you tried running in a single server mode? httpd -DONE_PROCESS

>     The server encountered an internal error and was unable to complete
> your request. 
> 
>     Error message:
>     Not a CODE reference at /var/www/html/test.cgi line 8. 
> 
>     If you think this is a server error, please contact the webmaster 
> 
> What happened? And how can I fix this? Please help, and thank you very
> much.
> 
> 

First upgrade to 1.99_09. Then run its test suite.

After, I think Dale, has reported a similar problem, I have written a 
dedicated test for this report. You can verify whether it works for you

cd ModPerl-Registry/
t/TEST -v t/perlrun_require.t

If it doesn't, please report here. If it does, please check what's different 
in your code from this test. Notice that this test ensures that it hits the 
same interpreter, which you can reproduce with your code using 'httpd 
-DONE_PROCESS'

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com