The following code will cause a stack overflow in visual studio 2012 express:
std::cout << "boom";
I looked in the standard and it seems that you should be allowed to tie a stream to itself. This is a somewhat silly example but it is useful in other cases. For example, in the asio networking library it is useful and common to have a tcp iostream tied to itself so that read attempts cause automatic flushing.
Other people seem to have run into this problem as well. For example, see: http://stackoverflow.com/questions/11924601/runtime-error-of-boost-asynchronous-i-o-example
The poster at stackoverflow.com is experiencing the same error as I am. In particular, what happens is that ostream::flush() constructs a sentry which then calls ostream::flush() and this repeats until the stack runs out.