Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!psuvax1!wuarchive!sdd.hp.com!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: memory leak Message-ID: <11484@jpl-devvax.JPL.NASA.GOV> Date: 18 Feb 91 22:20:53 GMT References: <284@carssdf.UUCP> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Distribution: usa Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 52 In article <284@carssdf.UUCP> usenet@carssdf.UUCP (John Watson) writes: : Lary, While you are fixing up 4.0, please look for a memory leak in : eval, possibly you are not freeing up tmpstr? The only memory leak in eval I'm aware of is that if the eval fails, I don't currently attempt to free the syntax tree. If there's some other problem, could you mail me a test case? : Also please update your perldb to include something like: : : *** /usr/lib/perl/perldb.pl Wed Jan 23 10:53:39 1991 : --- perldb.pl Sun Jan 13 19:25:08 1991 : *************** : *** 499,511 **** : push(@stack, $single); : $single &= 1; : $single |= 4 if $#stack == $deep; : if (wantarray) { : ! @i = &$sub; : $single |= pop(@stack); : @i; : } : else { : ! $i = &$sub; : $single |= pop(@stack); : $i; : } : --- 494,507 ---- : push(@stack, $single); : $single &= 1; : $single |= 4 if $#stack == $deep; : + local(@args) = @_; : if (wantarray) { : ! @i = &$sub(@args); : $single |= pop(@stack); : @i; : } : else { : ! $i = &$sub(@args); : $single |= pop(@stack); : $i; : } : : : So that we can pass arguments to a "usersub" defined subroutine. I think : this code used to be there about a dozen revisions back. Unfortunately, this would break all scripts that pass arguments by reference. The right way to handle it is simply not to call the debugging subroutine on usersub routines. That entails a fix to do_subr(). Larry