I'm developing OpenGL game and I've copied portion of code with similar function code was partially modified for it's new function, but there was still some bugs. This code was calling OpenGL rendering functions with wrong data, parameters.After calling OpenGL functions with wrong data/arguments whole system freezes and I'm not even able to switch to console CtrlAltF1. This disappoints me, because Linux should be stable software/OS. Then, why can bugged OpenGL program crash whole system?
How can bad OpenGL calls cause whole system crash?
xorg;opengl;crash
Given the monolithic nautre of the Linux kernel, an error in code that runs in the highest privilege level of the CPU, usually entitled kernel-mode, can crash the whole system.  There are three reasons for this:Such code can directly access the memory space of any other code.  So it is possible for such code to corrupt the kernel itself, running drivers, etc.  Such code can directly access I/O devices.  It's quite possible to misconfigure or set the wrong bits at wrong times on I/O devices in a way that causes the entire system to lockup.  Non-buggy device drivers won't let user code do anything to hardware that could cause an unstable system, but buggy, beta, or poorly written (or wrong) drivers just might. Code that encounters a problem or exception it can't handle doesn't have a higher level to throw to.  So a kernel exception will crash the system.So I don't know to what extent OpenGL works in the kernel or with the graphics driver but I hope this helps.