|
From: John R.
|
omo wrote: > I've prototyped a simple fault injector for malloc()-like routines, > called "Failgrind". > The tool can make fail malloc() and its variants ... This is good! I would use it more if it were integrated into memcheck, with features activated depending on existence of environment variables. If an environment variable exists, then activate the corresponding feature. I suggest a related feature: FAILGRIND_MALLOC_ACTIVATIONS=min,max which would cause malloc never to fail [on purpose] on the first min-1 calls, nor on any calls after the first max calls. So the possibility of injected failure is restricted to calls numbered in the interval [min, max]. The rationale is that my programs have three phases: startup, choose strategy based on input and environment (including how much space is available), execute strategy. I want to concentrate on one phase at a time. It would be nice to have an optional error message: Injecting fault at malloc #12345; 678 bytes requested at foo (bar.c, line 234) by <<usual traceback...>> for each intentional fault. --- |