I was talking to a friend on gchat the other day and noticing my jokes, which normally trend towards subjects like debtor's prison and being flogged at the mast, were getting rather alarmingly gruesome (it was the point where I said something involving a slurpee made of human kidneys, I think). It was hard to avoid this kind of talk, even when actively trying to rein it in.
Gallows humor has a long and storied history, of course, for the simple reason that it's an easy way for a person to relieve psychological pressure and reassert some control over a situation, however hopeless. Lincoln was famous for his inappropriate stories and dark jokes—those that knew him said it was a critical stress-relief tactic.
Internally, the hyper-violent imagery I keep producing feels like something that needs to be vented. I've got a fairly bottomless well of bitterness and hatred, but normally it's not the artesian kind. But serious emotional turmoil can change that, and I think various subsystems are trying to vent the contents onto ridiculous nonsense rather than just take it out on whoever happens to be closest. (Of course, grim jokes by themselves can be obnoxious too, so maybe it's just a passive-aggressive way of taking it out on people.)
But in any case, if you're talking to me and I keep bring up death by nerve gas or the like, rest assured it's just an emotional blowoff valve.