git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Eliminate Scalar::Util usage from private-Error.pm

From
Petr Baudis <pasky@suse.cz>
Date
Jul 26, 2006, 02:15 UTC
Message-ID
<20060726021550.GX13776@pasky.or.cz>
In-Reply-To
<7vhd15cfaj.fsf@assigned-by-dhcp.cox.net>

Dear diary, on Wed, Jul 26, 2006 at 03:42:44AM CEST, I got a letter where Junio C Hamano <junkio@cox.net> said that...

Show 46 quoted lines
> Petr Baudis <pasky@suse.cz> writes:
> 
> > diff --git a/perl/private-Error.pm b/perl/private-Error.pm
> > index ebd0749..8fff866 100644
> > --- a/perl/private-Error.pm
> > +++ b/perl/private-Error.pm
> > @@ -290,6 +288,14 @@ use vars qw(@EXPORT_OK @ISA %EXPORT_TAGS
> >  
> >  @ISA = qw(Exporter);
> >  
> > +
> > +sub blessed {
> > +	my $item = shift;
> > +	local $@; # don't kill an outer $@
> > +	ref $item and eval { $item->can('can') };
> > +}
> 
> Hmmm.  I wonder how this relates to what Merlyn actually said?
> 
>         From: merlyn@stonehenge.com (Randal L. Schwartz)
>         Subject: Re: [PATCH] Eliminate Scalar::Util usage from private-Error.pm
>         Date: 10 Jul 2006 18:42:35 -0700
>         Message-ID: <863bd8nchg.fsf@blue.stonehenge.com>
>         Cc: Junio C Hamano <junkio@cox.net>, <git@vger.kernel.org>
>         To: Petr Baudis <pasky@suse.cz>
> 
>         >>>>> "Randal" == Randal L Schwartz <merlyn@stonehenge.com> writes:
>         Randal> sub blessed {
>         Randal> my $item = shift;
>         Randal> local $@; # don't kill an outer $@
>         Randal> ref $item and eval { $item->can('can') };
>         Randal> }
> 
>         Randal> Oops, lose the local $@ line.  Just found out this is a
>         Randal> broken thing in current Perls.  The rest is good though.
> 
>         And thirdly, ignore what I *just* said, and concentrate on what
>         I *previously* said, becaused my testing was off.
> 
> My reading is that (1) the part of the patch should read
> something like this:
> 
>         sub blessed {
>                 my $item = shift;
>                 ref $item and eval { $item->can('can') };
>         }

I don't know, from my late-night understanding it should have the local line... :-)

> and (2) Merlyn thinks there is a bigger problem than using Scalar::Util
> which should be dealt with first.  Was the use of try{}catch{}
> syntax sugar (and it is easy to leak memory) the issue?  How was
> that resolved?

We never got to producing anything that could trigger the memleak, at least I wasn't able to reproduce it based on the rather vague description.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Snow falling on Perl. White noise covering line noise.
Hides all the bugs too. -- J. Putnam
Previous: Petr Baudis
Message 21 of 21 in “cvsserver: avoid warning about active db handles”
  1. cvsserver: avoid warning about active db handlesJohannes Schindelin, Jul 25, 2006
  2. Martin Langhoff (CatalystIT)Jul 25, 2006
  3. Johannes SchindelinJul 25, 2006
  4. Petr BaudisJul 25, 2006
  5. Git.xs problem, was Re: [PATCH] cvsserver: avoid warning about active db handlesJohannes Schindelin, Jul 25, 2006
  6. Eliminate Scalar::Util usage from private-Error.pmPetr Baudis, Jul 26, 2006
  7. Johannes SchindelinJul 26, 2006
  8. Johannes SchindelinJul 26, 2006
  9. Petr BaudisJul 26, 2006
  10. Johannes SchindelinJul 26, 2006
  11. Petr BaudisJul 26, 2006
  12. Johannes SchindelinJul 26, 2006
  13. Jakub NarebskiJul 26, 2006
  14. Johannes SchindelinJul 26, 2006
  15. Luben TuikovJul 26, 2006
  16. Randal L. SchwartzJul 27, 2006
  17. Johannes SchindelinJul 27, 2006
  18. Randal L. SchwartzJul 27, 2006
  19. Johannes SchindelinJul 27, 2006
  20. Petr BaudisJul 26, 2006
  21. Petr BaudisJul 26, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.