The oddest thing I've written - code that crashed, deliberately, in different ways based on use selection.
I was working a project where we built atop an "abstraction layer" designed to insulate us from OS changes (this was the 90s, such things were in vogue). The team doing the abstraction layer, at another site, rolled out a new version. The best I can say of it is, it compiled.
Different parts of my code started exploding. Almost literally - I had one test case cause a kernel panic in AIX, which was no small challenge. Of course, it was all blamed on my "bad code practices" and couldn't POSSIBLY be flaws in their update.
Over the course of two weeks of core dump analysis, discussion with the AIX team at IBM, and heated exchanges going up the chain of command, I crafted a 200-line program which three different options to crash the system. Pick your choice, guaranteed crash, including the kernel panic. Once I delivered THAT through channels, they got silent quick. It took them another month to fix their internal bugs and re-deliver. The memory leak I found in that version required another "prove it!" program, but my management had my back by then.