Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zsh-3.0-pre2 cores on irix 5.3 (?)



On Jul 7, 12:50pm, Andreas Koenig wrote:
} Subject: Re: zsh-3.0-pre2 cores on irix 5.3 (?)
}
} I started investigating, and reduced the bug (see below)
} 
}   > 1. Do you start getting the `alloc_stackp != 0' error immediately upon
}   >    starting zsh?  Or only after doing some completions?  Or only after
}   >    the periodic function starts firing?
} 
} Immediately after starting and then every $PERIOD seconds.
} 
} Here's my current .zshrc:
} 
} PERIOD=1800
} periodic () { . $HOME/.zlogout }
} 
} Here's my .zlogout:
} 
} echo "In .zprofile 1"
} #dirs >! $HOME/.zdirhistory
} #echo -n ]1\;$USERNAME@$HOST]2\;$USERNAME@$HOST $$
} 
} You see the lines it had before commented out. It turns out that ANY
} command in the file triggers _one_ alloc_stackp message.

Turns out that "source" or "." inside any shell function will trigger
that BUG warning, which isn't really a bug at all -- it's doshfunc()
calling loop() recursively, so the allocation stack depth reflects the
depth of recursion.

zagzig<3> echo echo foo > foo
zagzig<4> blat() { . foo }
zagzig<5> blat
foo
BUG: alloc_stackp != 0 in loop()
zagzig<6>

The for(;;) in loop() continues before reaching the DPUTS() call on any
blank or commented line, which is why I didn't see it when I first tried
to reproduce it, and which is why you see it once for each command.

Try this patch.

*** Src/init.c.orig	Fri Jul  5 10:57:45 1996
--- Src/init.c	Sun Jul  7 09:07:57 1996
***************
*** 128,134 ****
  	    if (toplevel)
  		noexitct = 0;
  	}
! 	DPUTS(alloc_stackp, "BUG: alloc_stackp != 0 in loop()");
  	if (ferror(stderr)) {
  	    zerr("write error", NULL, 0);
  	    clearerr(stderr);
--- 128,134 ----
  	    if (toplevel)
  		noexitct = 0;
  	}
! 	DPUTS(alloc_stackp > locallevel, "BUG: alloc_stackp > locallevel in loop()");
  	if (ferror(stderr)) {
  	    zerr("write error", NULL, 0);
  	    clearerr(stderr);

-- 
Bart Schaefer                             Brass Lantern Enterprises
http://www.well.com/user/barts            http://www.nbn.com/people/lantern

New male in /home/schaefer:
>N  2 Justin William Schaefer  Sat May 11 03:43  53/4040  "Happy Birthday"




Messages sorted by: Reverse Date, Date, Thread, Author