Why/how can a single program crash freeze my entire FreeBSD system?

I use luakit as my main browser, but multiple times it has frozen the entire system completely. My musicpd music continues to play in the background, though... but no input, not even mouse input is accepted. I'm guessing the program has been caught in an infinite loop or something and is somehow allowed to be taking 99.999% of CPU time and is allowed to eat it all because I can't think of many other scenarios where this sort of thing could happen.

How is it even possible a garden-variety program crash can bring down an entire multi-tasking OS (shouldn't a program like that eventually be killed by the OS or something)?

And most importantly, is there something I can do about it, to make my FreeBSD system as a whole more safe from any program crash while running?
 
How is it even possible a garden-variety program crash can bring down an entire multi-tasking OS (shouldn't a program like that eventually be killed by the OS or something)?
Although programs (basically user accounts) are limited in the things they can do or change on a system this doesn't necessarily include CPU time. So theoretically a program could indeed gobble up a lot of processor time and thus stall your machine.

Of course this is assuming that your userland program was actually responsible. It's also possible that some daemon (running as root) caused a bit of havoc.

But there's something you can do about that, for example by applying resource limitations. You can look into rctl(8) or login.conf(5) to get a rough overview of those options. The FreeBSD handbook also has a whole section about resource limits.

Still, you'd probably get more results by identifying the actual cause of the crash and somehow trying to fix that.
 
Back
Top