This is my list of practical suggestions to people developing a pintool. Since I dealt with these previously I thought to jot them down to help others. By applying this you should be somewhat closer to avoid your pintool from unexpected termination.
more here................http://reversingonwindows.blogspot.com/2014/07/practical-suggestions-for-writing.html?spref=tw
more here................http://reversingonwindows.blogspot.com/2014/07/practical-suggestions-for-writing.html?spref=tw