Skip Menu |

This queue is for tickets about the Module-Refresh CPAN distribution.

Report information
The Basics
Id: 14879
Status: resolved
Priority: 0/
Queue: Module-Refresh

People
Owner: Nobody in particular
Requestors: ivan-cpan-rt [...] 420.am
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.06
Fixed in: (no value)



Subject: [patch] trap fatal error: Can't undef active subroutine at /usr/share/perl5/Module/Refresh.pm line 154.
I'm using Module::Refresh under HTML::Mason (1.30) / mod_perl (1.29) on Debian unstable. Without this patch, I was getting a fatal error: Can't undef active subroutine at /usr/share/perl5/Module/Refresh.pm line 154. This patch changes this to a warning and adds the name of the subroutine that triggered it. I now get the non-fatal warning: HTML::Mason::handler: Can't undef active subroutine at /usr/share/perl5/Module/Refresh.pm line 154. Perhaps I wedged Module::Refresh in my Mason handler.pl incorrectly, but it otherwise seems to work with the patch and it does still throw a warning, so... --- Refresh.pm-0.06 2005-10-02 04:08:31.000000000 -0700 +++ Refresh.pm 2005-10-02 04:28:50.000000000 -0700 @@ -151,7 +151,8 @@ grep { index( $DB::sub{$_}, "$file:" ) == 0 } keys %DB::sub ) { warn "Deleting $sym from $file" if ($sym =~ /freeze/); - undef &$sym; + eval { undef &$sym }; + warn "$sym: $@" if $@; delete $DB::sub{$sym}; }
Date: Sun, 2 Oct 2005 14:12:38 -0400
From: jesse <jesse [...] fsck.com>
To: Guest via RT <bug-Module-Refresh [...] rt.cpan.org>
Subject: Re: [cpan #14879] [patch] trap fatal error: Can't undef active subroutine at /usr/share/perl5/Module/Refresh.pm line 154.
RT-Send-Cc:
Before I go about changing the module, can you show us how you were using Module::Refresh? On Sun, Oct 02, 2005 at 11:42:52AM -0400, Guest via RT wrote: Show quoted text
> > This message about Module-Refresh was sent to you by guest <> via rt.cpan.org > > Full context and any attached attachments can be found at: > <URL: https://rt.cpan.org/Ticket/Display.html?id=14879 > > > I'm using Module::Refresh under HTML::Mason (1.30) / mod_perl (1.29) on Debian unstable. > > Without this patch, I was getting a fatal error: > Can't undef active subroutine at /usr/share/perl5/Module/Refresh.pm line 154. > > This patch changes this to a warning and adds the name of the subroutine that triggered it. I now get the non-fatal warning: > > HTML::Mason::handler: Can't undef active subroutine at /usr/share/perl5/Module/Refresh.pm line 154. > > Perhaps I wedged Module::Refresh in my Mason handler.pl incorrectly, but it otherwise seems to work with the patch and it does still throw a warning, so... > > --- Refresh.pm-0.06 2005-10-02 04:08:31.000000000 -0700 > +++ Refresh.pm 2005-10-02 04:28:50.000000000 -0700 > @@ -151,7 +151,8 @@ > grep { index( $DB::sub{$_}, "$file:" ) == 0 } keys %DB::sub > ) { > warn "Deleting $sym from $file" if ($sym =~ /freeze/); > - undef &$sym; > + eval { undef &$sym }; > + warn "$sym: $@" if $@; > delete $DB::sub{$sym}; > } >
--
From: ivan-cpan-rt [...] 420.am
[jesse@fsck.com - Sun Oct 2 14:12:41 2005]: Show quoted text
> > Before I go about changing the module, can you show us how you were > using Module::Refresh?
Sure. This from the manpage sounded like what I wanted: # During each request, call this once to refresh changed modules: Module::Refresh->refresh; So I added this code to Mason's handler.pl, at the beginning of the "handler", which is called for each request (and of course I added "use Module::Refresh;" at the top). Seems like a not-uncommon use case. What appears to happen is that the handler sub is "externally" (not by HTML/Mason.pm) placed in the HTML::Mason package by handler.pl (as I understand it normally is, my handler.pl doesn't do anything super strange), and so when you call Module::Refresh->refresh from within it, Module::Refresh walks the symbol table to undef subroutines and tries to undef HTML::Mason::handler, which is currently running. This triggers the fatal error "Can't undef active subroutine". Thereafter, that Apache child will no longer serve pages, just dies with that error every invocation. Hope that's clear for the record, let me know if there's anything else I can do. (resend because I don't see this at rt.cpan.org - looks like my email reply was sent as a comment rather than a reply, so it is private??)
Got it. And Got To It. 0.08 is now on cpan and should have this fix. Thanks for your patience. Jesse