|
From: omo <om...@do...> - 2008-06-18 14:38:12
|
Hello Florian, Thank you for your advice. > The hard part will be how to control where you want to insert the failure. Certainly. We may keep it simple and declarative to give it from clo. Another, more ambitious idea is to build a DSL to control these conditions. Such an approach may be similar to Dtrace-like aspect orientation. But it will be too long way to go... BTW, funtion wrapping functionaly looks very interesting, if it is available in the framework rather than in the client-side. I'll try it later. -- morita On Wed, Jun 18, 2008 at 1:24 AM, Florian Krohm <br...@ac...> wrote: > On Monday 16 June 2008 10:17:54 am omo wrote: >> Hello, >> >> I've prototyped a simple fault injector for malloc()-like routines, >> called "Failgrind". >> The tool can make fail malloc() and its variants which are called from >> specific functions. >> the basic idea is similar to the bug: >> http://bugs.kde.org/show_bug.cgi?id=163266 >> and failmalloc http://www.nongnu.org/failmalloc/ . >> >> This is just a small, proof-of-concept prototype, and there will be a >> lot of TODOs. >> Which is better to the patch to massif or current "separate tool" style? >> What are missing features? How should they be implemented? >> How to intercept specific functions? >> Does this type of tool make sense at all? >> > > This would be a very useful tool to have. And you already got a great name > for it.. As the bugzilla entry suggests it would be good to not restrict it > to just malloc etc. failures. File system failures, temporary network > unavailability and other such things that are difficult to test otherwise > could be emulated nicely this way. > The hard part will be how to control where you want to insert the failure. > This could be something as John has suggested. More difficult control > mechanisms could include > - make function foo in "bar.c", line 100 fail (whenever it is reached) > - make some function fail only in a particular calling context > - restrict failures to functions in a given DSO > > and so on. > Valgrind provides a way to wrap/replace functions. Described here > http://www.valgrind.org/docs/manual/manual-core-adv.html#manual-core-adv.wrapping > > This might be useful in case you want to extend the tool beyond handling > malloc and friends. > > Florian > -- -- morita |