From: Nicholas N. <nj...@ca...> - 2003-07-02 10:05:58
|
Hi, I've written a new skin for Valgrind. It's called Crocus, and it searches for problems in signal handlers. Because signal handlers can be called at any time, they shouldn't call any functions that are non-reentrant, ie. functions that will screw up if they are interrupted by another call to themselves, usually because some shared or global data structure could be corrupted or overwritten. Many functions are non-reentrant, including lots of common ones like printf() (most standard I/O functions, in fact) and malloc(). You also aren't supposed to call any pthread functions from signal handlers, as this can cause deadlock. Lots of programs don't get this right; Vim, for example. Crocus identifies when a program's interrupt handler calls one of a number of common non-reentrant functions. It also identifies when an interrupt handler doesn't preserve errno as it should. To run this skin, download valgrind-CROCUS.tar.bz2 from: www.cl.cam.ac.uk/~njn25/valgrind.html install as normal, and run it with the --skin=crocus option. It's a little bit experimental, but has been tested reasonably well. Thanks to Steve Grubb for the original idea and testing it on a variety of programs. I welcome any feedback. N |