#include <stdlib.h>
int main() {
void *a = malloc(0);
for (;;)
a = ((void *(*)())a)();
return 0;
}
You can make an entirely ISO/IEC 9899 compliant C compiler with which this code never segfaults !
PowerShell, the most cursed shell ever made, can also segfault !
while (1) {
$output = Invoke-WebRequest https://uwu-segfault.eu/api/segfault|out-string -stream
$output = $output -replace '.*:' -replace 'your\s*emergency','your emergency'
$output |Select-String -Pattern '(number\s\d*\w*|cat)'|select -first 1
Write-Host `n
Start-Sleep -Seconds 1
}
As a treat, here is someone who complains about the lack of segfault on Windows
(if you ask me, windows is bad enough as is,,)