Aaron Margosis is posting a series of posts on "LUA" bugs, including what they are (and what aren't bugs) and how to fix them. As always, excellent work by Aaron to keep developers aware of the issues.
He also mentions briefly the tool he has been developing called "LUA BugLight" which will help developers to find these kinds of bugs. I have seen a demo of this tool, and it looks great -- simple and to the point. Currently, the newly updated Microsoft Application Verifier has this feature, but it is proving to be difficult to use with the mountain of data you need to wade through. So this new tool will be a nice addition to the developer's toolkit (along with the invaluable tools from SysInternals: RegMon, FileMon, and the recently updated Process Explorer [found by way of Sam Gentile]). Stay tuned to Aaron's blog for more information on the new "LUA BugLight" tool.