From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18069 invoked from network); 22 Apr 2002 22:09:20 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 22 Apr 2002 22:09:20 -0000 Received: (qmail 20706 invoked by alias); 22 Apr 2002 22:08:52 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 17023 Received: (qmail 20684 invoked from network); 22 Apr 2002 22:08:47 -0000 Sender: sewardj Message-ID: <3CC48A41.17564396@acm.org> Date: Mon, 22 Apr 2002 23:10:09 +0100 From: Julian Seward Reply-To: jseward@acm.org X-Mailer: Mozilla 4.78 [en] (X11; U; Linux 2.4.9-31 i686) X-Accept-Language: en MIME-Version: 1.0 To: Bart Schaefer CC: Felix Rosencrantz , zsh-workers Subject: Re: valgrind: useful memory checker References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit > > One of the problems was that zsh calls malloc() during signal handlers. > > Which Julian pointed out is not a particularly safe thing to do.... (I > > figure Bart or others might comment about this.) > > It's "not particularly safe" only if you don't know what you're doing. > > We went to some trouble a while ago to assure that signals are blocked > while zsh is performing other memory allocations, so that we don't have > re-entry problems with calling malloc() from inside the handlers when they > do get called. Yes, it's fairer to say that until recently valgrind had a really nasty hack to do with delivering signals to processes blocked in system calls, which apparently zsh does. So valgrind was somewhat limited in what it could do safely in this situation. Valgrind snapshots >= 20020420 have completely new signal simulation stuff, and all those limitations have gone away. > Also, I ran valgrind on zsh interactively for a little bit, did > some completions and found a couple leaks. Of course, adding valgrind > to the automated tests would be quite useful. Valgrind's -s flag makes it completely silent apart from reporting errors. This was added specifically to help people who want to add it to automated regression test systems. You might find it useful. J