Shortest code that raises a SIGSEGV
C, 5 characters
main;
It's a variable declaration - int
type is implied (feature copied from B language) and 0
is default value. When executed this tries to execute a number (numbers aren't executable), and causes SIGSEGV
.
Try it online!
Bash, 11
kill -11 $$
Assembly (Linux, x86-64), 1 byte
RET
This code segfaults.