I don’t have any code of the kind you requested to share. But I suspect that no one else will be able to either, unless you are more specific about what kind of crashes you care about.
Unless there is some mechanism to prevent this that I am unaware of, I would think that a root user would be able to arbitrarily corrupt the OS code on disk, such that on the next boot some arbitrary condition could cause arbitrary memory to be corrupted arbitrarily, with or without a crash.
Presumably, cases like that are uninteresting. But which interesting cases are left after those are removed?
I am unaware of any mechanism that limits the potential scope of bugs in Linux itself to corrupt memory. But I guess there might be ones I am
Assuming we leave out Linux bugs, and assume that you are running non-corrupted OS code, I am not sure what remaining sources of OS crashes there are.
Theoretically, even things like OOM conditions, for example, would be recoverable because a random high memory process would be killed. Is that the kind of thing you were referring to when you said “OS crashes”?