I don't know about other countries but in Canada, self-defense comes with an extra "to a reasonable extent" clause.
So to a normal person, they'd see "Oh a crazy gunman is killing people" and think "Lethal force to stop the killing is pretty reasonable". They thought wrong.
There are a lot of news stories here where if attackers and aggressors are killed by civilians, the heroic guy who just saved everyone usually gets cuffed on the spot and hauled to jail. The Crown's argument is usually that lethal force was completely unnecessary and that the guy (and others) could've done something else to stop the attack. Which is bullshit.
But then you'd think "Oh then I can just beat them up like Batman or something" and you'd still be wrong. There is a very large chance that if you just beat up a guy in a similar life or death situation, you'd be charged with assault. And again, the Crown would argue that you knocking the dual-wielded AK-47s out of the wannabe terrorist's hands and then breaking an arm before pinning him down with two others was excessive and unreasonable.
As much as I am scared of America and its rootin' tootin' gun totin' craziness (among other things), I'm jealous of the fact that self-defense is a pretty solid and respectable defense there. You can just tell the cops that it was self-defense, they'd see that it's true, and they'd just leave you alone on the spot. Of course this opens up a different set of problems but at least there's almost no chance of you getting cuffed in front of your kids after you shot or beat up a crazed gunman who was most likely going to shoot them if he was left alone.