» Sun Jun 10, 2012 10:43 am
http://www.gamesas.com/topic/1331838-riften-goes-bonkers-and-spawns-hostile-stormcloaks/page__p__20035642#entry20035642 a while back, too. For future reference if it ever happens again, you can avoid the slaughter-fest by pickpocketing one of the guards at the guard towers outside and then having them take you to prison.
The only thing I can think of is that the game somehow thinks you've accrued a truly massive bounty in the Riften hold (enough to cause the guards to try to murder you on sight), even when you most likely very much haven't. My character never even committed so much as a murder, much less a crime spree that would result in that kind of bounty. (In fact, when it happened, she had no bounty whatsoever, and indeed never had.)