Re: Apache2::Reload Segmentation Fault

[prev] [thread] [next] [Date index for 2005/04/25]

From: Stas Bekman
Subject: Re: Apache2::Reload Segmentation Fault
Date: 22:29 on 25 Apr 2005
Vincent Moneymaker wrote:
> 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;
> }

You can't use OK, unless you do:

use Apache2::Const qw(OK);

in each module you use it. It needs to be imported.

> 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.

Great. Thanks. But post it to the list.

> 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.

Cool. So we know whose fault is that. Hopefully you will make up another 
tarball that reproduces this problem too. Thanks!


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

(message missing)

Apache2::Reload Segmentation Fault
Vincent Moneymaker 04:35 on 23 Apr 2005

Re: Apache2::Reload Segmentation Fault
Stas Bekman 05:10 on 23 Apr 2005

Re: Apache2::Reload Segmentation Fault
Vincent Moneymaker 07:23 on 23 Apr 2005

Re: Apache2::Reload Segmentation Fault
Stas Bekman 16:20 on 23 Apr 2005

Re: Apache2::Reload Segmentation Fault
Vincent Moneymaker 17:35 on 23 Apr 2005

Re: Apache2::Reload Segmentation Fault
Stas Bekman 18:13 on 23 Apr 2005

Re: Apache2::Reload Segmentation Fault
Vincent Moneymaker 19:40 on 23 Apr 2005

Re: Apache2::Reload Segmentation Fault
Stas Bekman 20:57 on 23 Apr 2005

Re: Apache2::Reload Segmentation Fault
Vincent Moneymaker 03:54 on 24 Apr 2005

Re: Apache2::Reload Segmentation Fault
Stas Bekman 20:23 on 25 Apr 2005

Apache2::Reqest
Dan Brian 20:48 on 25 Apr 2005

Re: Apache2::Reqest
Philip M. Gollucci 20:56 on 25 Apr 2005

Re: Apache2::Reload Segmentation Fault
Vincent Moneymaker 21:01 on 25 Apr 2005

Re: Apache2::Reload Segmentation Fault
Stas Bekman 22:29 on 25 Apr 2005

Re: Apache2::Reqest
Dan Brian 21:02 on 25 Apr 2005

Generated at 09:30 on 27 Apr 2005 by mariachi v0.52