perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Moneymaker" <>
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 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
> >
> >
> > 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 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/
> > # Apache2::Reload::handler('Apache2::RequestRec=SCALAR(0xcce5d18)')
> > called at /opt/prod/apache/Melior/ line 0
> > # eval {...} called at /opt/prod/apache/Melior/ line 0
> > # Apache2::Reload: Checking mtime of
> > # Apache2::Reload::handler('Apache2::RequestRec=SCALAR(0xcce5d18)')
> > called at -e line 0
> > # eval {...} called at -e line 0
> Have you looked at this item?
> > 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.

View raw message