Malte Ubl wrote:
Hi,


I'd really appreciate some help with a really weird mod_perl problem we keep running into.

This is mod_perl version 1.29 using Apache::PerlRun

The application servers of our mod_perl site occasionally (once every 2-3 weeks) start spitting out these error messages:


[Sun Jul 3 14:58:01 2005] [error] Modification of a read-only value attempted at /usr/local/lib/perl5/site_perl/5.8.6/i686-linux/Apache/PerlRun.pm line 215.\n

At first only a couple Apache childs seem to be affected but after a while the error comes on every single request, so the whole website comes to a stall.

Can you reproduce the problem at will?

The problem only accurs if the central mainframe we are working against is having a problem and we are doing a lot of error handling. However, the problem does not alway occur if there is a problem with the mainframe and all processing that actually does get started finishes totally fine.

The relevant line in PerlRun.pm is
sub readscript {
    my $pr = shift;
    $pr->{'code'} = $pr->{r}->slurp_filename; # this is line 215
}

My understanding of the "Modfication of read-only..." error is that it cant really occur on that line, since there are no literals being modified.


Any help or pointer in the right direction would be really appreciated. If the solution is to move away from Apache::PerlRun to something else that would be alright, too. We'd like to avoid it though, because we are satisfied with the speed and don't want to repeat the whole testing phase.

Quite often the error line is reported incorrectly. You can always add something like:

#line 215
   $pr->{'code'} = $pr->{r}->slurp_filename;

That's a special directive telling perl that the next line number is 215, so you will know for sure that this is the line it's talking about.

Once you figure out the exact line, you need to figure out where the error is coming from? You could use Devel::Peek to see what variable is readonly. e.g.:

use Devel::Peek;
my $x = 5;
Dump $x;

For example $$ is readonly, so you get:

perl -MDevel::Peek -le 'Dump $$'
SV = IV(0x805d9b0) at 0x805b7cc
  REFCNT = 1
  FLAGS = (IOK,READONLY,pIOK)
  IV = 16911

You can see the readonly flag set.

--
__________________________________________________________________
Stas Bekman            JAm_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

Reply via email to