Thread: [Perlgssapi-developer] DESTROY as constant
Brought to you by:
achimgrolms
From: Achim G. <per...@gr...> - 2006-02-23 19:26:12
|
Hello, during my testing on Authen::SASL::Perl::GSSAPI i got warnings from GSSAPI from the constants-Autoload code. looking a bit deeper I found out that on some circumstances the module tried to 'DESTROY' to the autoload handling. (I don't know why) My first-shot workaround is --- GSSAPI.pm (revision 69) +++ GSSAPI.pm (working copy) @@ -117,6 +117,7 @@ croak "& not defined" if $constname eq 'constant'; my $val = constant($constname, @_ ? $_[0] : 0); if ($! != 0) { + if ( $constname ne 'DESTROY' ) { if ($! =~ /Invalid/ || $!{EINVAL}) { $AutoLoader::AUTOLOAD = $AUTOLOAD; goto &AutoLoader::AUTOLOAD; @@ -124,6 +125,7 @@ else { croak "Your vendor has not defined GSSAPI macro $constname"; } + } } That makes the warnings go away. Do you think the patch may cause any problems? Thank you, Achim |
From: Merijn B. <me...@il...> - 2006-02-24 12:59:27
|
Quoting Achim Grolms (per...@gr...): > Hello, > > during my testing on Authen::SASL::Perl::GSSAPI > > i got warnings from GSSAPI from the constants-Autoload code. > > looking a bit deeper I found out that on some circumstances > the module tried to 'DESTROY' to the autoload handling. > (I don't know why) > Normally you provide a simple sub DESTROY {} or check in your autoloader and return if it is DESTROY that is autoloaded. Cheers, -- Merijn Broeren | Sometime in the middle ages, God got fed up with us Software Geek | and put earth at sol.milky-way.univ in his kill-file. | Pray all you want, it just gets junked. |
From: Achim G. <per...@gr...> - 2006-02-24 13:43:53
|
On Friday 24 February 2006 13:59, Merijn Broeren wrote: > Quoting Achim Grolms (per...@gr...): > > Hello, > > > > during my testing on Authen::SASL::Perl::GSSAPI > > > > i got warnings from GSSAPI from the constants-Autoload code. > > > > looking a bit deeper I found out that on some circumstances > > the module tried to 'DESTROY' to the autoload handling. > > (I don't know why) > > Normally you provide a simple sub DESTROY {} or check in your > autoloader and return if it is DESTROY that is autoloaded. Just to be sure if I got that right: I got the warnings in cleanup, when one of the destructors of the xs objects is searched, like GSSAPI::Name::DESTROY. The desctructor is found by perl, but i get that warnings. 1. where do I have to place the "sub DESTROY {} "? 2. what means "check in your autoloader"? Can you make an example? But the problem I have to understand is: *Why* to I get the warnings when GSSAPI pm ist used in the Authen::SASL::Perl::GSSAPI module? (One difference is that init() is called twice because of MUTAL_FLAG) Thank you, Achim |
From: Merijn B. <me...@il...> - 2006-02-24 14:48:11
|
Quoting Achim Grolms (per...@gr...): > On Friday 24 February 2006 13:59, Merijn Broeren wrote: > > Quoting Achim Grolms (per...@gr...): > > > Hello, > > > > > > during my testing on Authen::SASL::Perl::GSSAPI > > > > > > i got warnings from GSSAPI from the constants-Autoload code. > > > > > > looking a bit deeper I found out that on some circumstances > > > the module tried to 'DESTROY' to the autoload handling. > > > (I don't know why) > > > > Normally you provide a simple sub DESTROY {} or check in your > > autoloader and return if it is DESTROY that is autoloaded. > > Just to be sure if I got that right: > I got the warnings in cleanup, when one of the destructors > of the xs objects is searched, like GSSAPI::Name::DESTROY. > > The desctructor is found by perl, but i get that warnings. > > 1. where do I have to place the "sub DESTROY {} "? > In each module that you have an autoloader in. > 2. what means "check in your autoloader"? > sub AUTOLOAD { my ($self, $search, $params) = @_; my $name = our $AUTOLOAD; $name =~ s/.*://; # special case -- need to handle DESTROY or we'll get warnings # during destruction return if ($name eq "DESTROY"); is a traditional way to start your autoloader. > > But the problem I have to understand is: > *Why* to I get the warnings when GSSAPI pm ist used > in the Authen::SASL::Perl::GSSAPI module? > (One difference is that init() is called twice because of MUTAL_FLAG) > init() is called twice as well in gss-server.pl if you connect with -mutual. Did you try that? Cheers, -- Merijn Broeren | Sometime in the middle ages, God got fed up with us Software Geek | and put earth at sol.milky-way.univ in his kill-file. | Pray all you want, it just gets junked. |
From: Achim G. <per...@gr...> - 2006-02-24 15:44:16
|
On Friday 24 February 2006 15:48, Merijn Broeren wrote: > > 2. what means "check in your autoloader"? > > sub AUTOLOAD { > my ($self, $search, $params) = @_; > > my $name = our $AUTOLOAD; > $name =~ s/.*://; > > # special case -- need to handle DESTROY or we'll get warnings > # during destruction > > return if ($name eq "DESTROY"); > > is a traditional way to start your autoloader. Yes. But the changes I have sent in my patch are Changes of the AUTLOAD sub of GSSAPI.pm (and checking for 'DESTROY' and returning in that case). Do I have made things wrong? > > But the problem I have to understand is: > > *Why* to I get the warnings when GSSAPI pm ist used > > in the Authen::SASL::Perl::GSSAPI module? > > (One difference is that init() is called twice because of MUTAL_FLAG) > > init() is called twice as well in gss-server.pl if you connect with > -mutual. Did you try that? At the moment not with gss-server.pl, but will do. Do you get that warnings with your client/server setup and MUTAL_FLAG or is the Perl/SASL module the special case? Thank you, Achim |