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

Re: BUG: permanent allocation in mathevall



"Bart Schaefer" wrote:
> If you look again at the stack trace I sent, you'll see that TMOUT is a
> special case; the code looks like this:
> 
> 	    int tmout;
>             dotrap(SIGALRM);
>             if ((tmout = getiparam("TMOUT")))
>                 alarm(tmout);           /* reset the alarm */
> 
> Outside of dotrap(), global allocation is in effect.  Inside the trap
> function itself, heap allocation is.

OK, then use this instead of 8049.  The allocation at this point is
undetermined, since it's in the signal handler, so this certainly seems
safeer.  Presumably global allocation is in effect only because it is in
zleread().

--- Src/signals.c.ha	Thu Sep  2 10:09:24 1999
+++ Src/signals.c	Sun Sep 26 18:52:31 1999
@@ -523,8 +523,10 @@
         if (sigtrapped[SIGALRM]) {
 	    int tmout;
             dotrap(SIGALRM);
-            if ((tmout = getiparam("TMOUT")))
-                alarm(tmout);           /* reset the alarm */
+	    HEAPALLOC {
+		if ((tmout = getiparam("TMOUT")))
+		    alarm(tmout);           /* reset the alarm */
+	    } LASTALLOC;
         } else {
 	    int idle = ttyidlegetfn(NULL);
 	    int tmout = getiparam("TMOUT");

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxx>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy



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