Before I start, I'm leaving out details, can we just focus on the question please, he really isn't just this problem.
Ok, DH is, well, there is no quicker way to explain, a bit aspergersy. Very very clever (people queue up to ask him facts, he can argue the part of anyone in a debate) but with very few social skills - he admits that people are 'a mystery, why they act so strangly and illogically'
He keeps saying things that are blatently insenstive. Eg, me and childless (but very broody) sister talking about my severe mental illness and hospitalisation - first proper talk about it. 'Well, I should be careful. If they get hold of me they will lock me up. If fact I often think that if I dosn't have kids I would just stab someone and get locked up and then I wouldn't have to meet people and be nice. You wouldb't know, you don't have children.'
He was obviously making a very awkward joke to lighten the mood, but not an appropiate one.
This is quite a common event (not usually talking about violence, but just being completely unaware of what other people might think or feel)
Is there anything I can do? He is normally lovely, but comes out with these howlers several times a day and just doesn't seem to notice them.