views:

757

answers:

8

I am interested to learn: what are the most common technical causes (from the perspective of operating system programming) of an operating system crash (not limited to Windows crashes)? I'm looking for an answer not like "too many apps open", but what specifically happens when too many apps are open that causes the crash.

A: 

No you are way off. Typically there is nothing an application can do that can cause the OS to crash. OS crashes are generally caused by buggy device drivers and hardware failures.

1800 INFORMATION
+3  A: 

It's Buggy Drivers that cause OS crashes. Only the OS itself and drivers are able to harm the system.

To your suggestions:

  1. No OS has problems if an application accesses the same memory as the OS. Either the memory is accessible or it is not. If an application tries to access memory that it should not the CPU generates a segmentation-fault. The OS hands this over to the application and the problem is solved. (in 99% the app will crash afterwards, but that's not the fault of the OS).

  2. You're suggesting that slower programs are more safe. That's not true. The OS does not need to know what exactly your program is doing.

Nils Pipenbrinck
1. "Segmentation fault" (or GPF in Windows land) is the term you are looking for when an application tries to access memory that it's not allowed to. "Page fault" refers to when a section of memory is accessed but it's been swapped out to virtual memory.
Dan Harper - Leopard CRM
dan, thanks for pointing that out. I've edited the post.
Nils Pipenbrinck
A: 

Two different sources trying to access a locked area is one problem. Getting all mutexes, monitors and locks to work 100% is not trivial.

Vargen
I am voting this up because deadlocks and livelocks *are* a very common cause of operating system failure.
Zan Lynx
+5  A: 

In my opinion

  1. Bad drivers
  2. Kernel bugs
  3. Hardware failure
  4. End of resources

A modern operating system will not let a mere application crash it.

Sklivvz
Nice list, however "end of resources" should not cause a crash unless there is a bad driver, or bad kernel. Good code should handle all resource allocation failures gracefull. It is however true that this is quite common type of driver bug.
Suma
I was thinking about "fork bombs" and root file system full
Sklivvz
+2  A: 

In modern OS, application code and OS code run in separate address spaces. The application code cannot crash the operating system. See here:

http://en.wikipedia.org/wiki/Ring_(computer_security)

The most common readon for a crash is code that is acting as part of the OS interfearing with other code that is acting as part of the OS. A common cause is poorly written device drivers that live in the OS's address space.

Less often, crashes are caused by hardware faulures.

Kramii
A: 

If we use Vista as an example - drivers ... NVidia in particular http://arstechnica.com/news.ars/post/20080325-vista-capable-lawsuit-paints-picture-of-buggy-nvidia-drivers.html. It's the OS that dictates memory allocation, not applications. Well, that's the theory.

CAD bloke
A: 

os crash may also cause due to some sectors crash in harddisk this is because i all pcs os presents in primary drive in the hardidsk.

M.anvesh
A: 

The User. They keep finding those pesky bugs and never report them.

Tim Post