While I do see his point, in one case you prevent the memory corruption so you're not in an invalid state, you can display some message and crash right at the problem, not somewhere later (or maybe never).
It's all about the tradeoff between never letting the kernel run in a potential bad state and just praying nothing bad happens.
At least you know of the problem right away, instead of it not doing anything for years because that memory was untouched and then breaks things years later.
I do agree there can be better options than just crashing to report the errors, but silently ignoring it is I believe the worst option.
1
u/meneldal2 Apr 16 '21
UB solves the problem? At least if your kernel systematically panics you know your driver is shit, you don't get surprise memory corruption.