Apple markets it as 'the world's most advanced operating system'.
People believe that it never crashes!
I was testing system calls in x86-64 version of Mac OS X. I wrote a very very very simple hello world application. Actually, I was curious and used Linux x86-64 ABI on Mac OS X. I assembled it, linked it, ran it, and expected a Segmentation Fault or something like that.
Surprisingly, I saw the Mac OS X version of BSOD! The kernel crashed! With a very simple user-space program running without root privileges!
I'm still surprised by it! A USER SPACE APPLICATION RUNNING IN RING 3 CAN THIS EASILY CRASH THE ENTIRE OS X!
You can try reproducing it yourself (you need yasm)
Open up a terminal, save this code snippet as "a.asm":
UPDATE 3: The old one will more reliably crash the system than the new one! I've tested it many times and it worked every single time! The new one strangely stopped to work! I have absolutely no idea about the Darwin kernel and I can't speculate the cause.
UPDATE 2: I've found out that this happens when you issue a syscall instruction with rax=1 and rdi=1, therefore, I could take my system down with a smaller code:
New code:
SECTION .text
global start
start: mov rax, 1
mov rdi, 1
syscall
Original code:
SECTION .data
hello db 'hello world', 10
hellolen equ $-hello
SECTION .text
global start
start: mov rax, 1
mov rdi, 1
mov rsi, qword hello
mov rdx, hellolen
syscall Assemble, link and run it. Make sure no important app is running since your OS will probably crash!
yasm -f macho64 a.asm
ld a.o
./a.out
Please leave a comment if your have any explanation on this problem or you're able to reproduce it, as I only ran it on my system.
UPDATE 2: This problem is fixed in Mac OS X 10.5.5 update.

UPDATE: I've tested the code on my system after 10.5.4 update, the problem still exists