perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Moneymaker" <vbmonyma...@hotmail.com>
Subject Re: Apache2::Reload Segmentation Fault
Date Mon, 25 Apr 2005 21:01:29 GMT
Stas Bekman wrote:
> > I discovered what was causing the problem.  Even though I had used the
> > following in the startup.pl file
> >
> > use Apache2::Const -compile => ':common';
> >
> > the Apache modules were segfaulting on the straight 'OK' constant
> > declarations in them.
>
> Vincent, what do you mean by 'declaration' here? You mean you've used it?

In modules where a constant such as 'OK' gets returned (like so)

sub handler {
  print "a\n";
  return OK;
}

I had to change the 'OK' constant to the following

sub handler {
  print "a\n"
  return Apache2::Const::OK;
}

Bear in mind that 'return OK' worked fine if I didn't change a module, but
if I changed something in the module like a print statement and
Apache2::Reload was on and the module was then reloaded, that is when the
segfault would occur

Also, if the module had a 'use Apache2::Const qw(OK);' statement, I had to
remove those like so

package Apache2::Menus;

#use Apache2::Const qw(OK);

sub handler {
  print "a\n";
  return Apache2::Const::OK;
}

So now, whenever I change a module, the change shows up and no segfault
occurs.  With respect to duplicating the problem, I will keep trying to
duplicate it in the test tarball that you sent me so that I can duplicate it
for you.

> > However, the other modules I have in the Melior namespace are not
> > getting reloaded.  Apparently the reason for this as noted in the
> > following post at
> >
http://forums.devside.net/viewtopic.php?t=671&start=0&postdays=0&postorder=asc&highlight=
> >
> > is that they are being called from within the Apache2 modules.  In other
> > words, because the Melior modules only get requested by modules in the
> > Apache2 namespace, they don't get reloaded even though their own
> > separate namespace is declared within them, as well as in the Apache2
> > modules and the startup.pl file.
>
> Vincent, please send in a tarball with a minimum setup reproducing the
> problem. I don't undestand from your description what's not right.
>
> > With regard to debugging this problem, the reload debugger shows that
> > the Melior modules do get reloaded when they change but the change
> > doesn't show up on the page that gets spit out.  Here is a sample from
> > the error_log
> >
> > #Apache2::Reload: process 24620 reloading Melior::Menus from
> > Melior/Menus.pm
> > # Apache2::Reload::handler('Apache2::RequestRec=SCALAR(0xcce5d18)')
> > called at /opt/prod/apache/Melior/Menus.pm line 0
> > # eval {...} called at /opt/prod/apache/Melior/Menus.pm line 0
> > # Apache2::Reload: Checking mtime of CCMckErrno3_2.pm
> > # Apache2::Reload::handler('Apache2::RequestRec=SCALAR(0xcce5d18)')
> > called at -e line 0
> > # eval {...} called at -e line 0
>
> Have you looked at this item?
>
http://perl.apache.org/docs/2.0/api/Apache2/Reload.html#Problems_with_Scripts_Running_with_Registry_Handlers_that_Cache_the_Code
>
> > BTW, as I mentioned last time, I believe this problem first cropped up
> > with modperl version 1.99.17.  If you have any suggestions on what I
> > should tinker with in order to get modules called by other modules
> > reloaded that would be great.
>
> The only suggestion I have at the moment is that we need to be able to
> reproduce the problem... :)
>

With regard to the reload problem where one *.pm file calls another *.pm
file but changes in the second *.pm file don't show up, I have fixed that
problem by using the old Apache::Reload code (i.e. version 0.08) where
Modperl::Util::unload_package doesn't get used.  Using that old code,
everything works fine.





Mime
View raw message