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

Re: BUG: permanent allocation in mathevall



On Sep 26,  4:02pm, Peter Stephenson wrote:
} Subject: Re: BUG: permanent allocation in mathevall
}
} "Bart Schaefer" wrote:
} > I'm getting the "BUG: permanent allocation in mathevall" message every time
} > my TRAPALRM function fires.
} > 
} > It's happening below getiparam("TMOUT"):
} 
} It doesn't seem to be happening with TRAPUSR1, though: compare
} 
} TRAPUSR1() { integer i; i=4; print i is $i; }
} kill -USR1 $$
} 
} with the same function as TRAPALRM with a non-zero timeout.  Slightly odd.

I should have looked more closely at this before reporting it ...

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.

It looks like that's the only place where getiparam() is called in a
global allocation context, so maybe it'd be sufficient to put HEAPALLOC()
around that one call, rather than inside mathevall().

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



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