I'd be quite surprised that it has much to do with the vector.
RealStateMachine sma; RealStateMachine smb( sma );
At the moment I'm not sure exactly what makes it a recursive call. Was the generated state machine not thought to be copied, or did I made a mistake?