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

Re: valgrind: useful memory checker



> > 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



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