# Dump core on Linux [duplicate]

Write the shortest program which, when run with no arguments, stdin, or user input, triggers a core dump.

Your code must behave this way when run on some common out-of-the-box Linux distribution. Other than installing support for your target language, you may not reconfigure the system to make it more fragile than it is as provided.

25-byte C example: int main(){*((int*)0)=0;} on my Ubuntu outputs

Segmentation fault (core dumped)

• related – Arnauld Dec 2 '16 at 11:53
• I'm posting here since I'm not sure if this is right, but is perl -ue '' a valid solution? (question intended for people knowing perl) – Dada Dec 2 '16 at 12:40
• @Dada, when running that I get Aborted (core dumped) instead of Segmentation fault (core dumped). – redstarcoder Dec 2 '16 at 13:42
• @redstarcoder It doesn't have to be a segfault, so that would work. – mbomb007 Dec 2 '16 at 14:37
• We already have questions for the fastest way to create a SIGSEGV and the fastest way to create a SIGILL. Dumping core on Linux without a signal is likely to be very verbose compared to crashing in a way that creates a core file, so this question is basically "shortest way to cause a SIGQUIT, SIGILL, SIGABRT, SIGFPE, SIGSEGV, SIGBUS, SIGSYS, SIGTRAP, SIGXCPU, or SIGXFSZ". I think we'd be better off with those as separate questions, rather than having a combined question for any (especially as some of the existing SIGSEGV/SIGILL are very short). – user62131 Dec 2 '16 at 16:19

# C, 5 bytes

main;


Try it online!

## Slightly longer, 7 bytes

main=0;

• Why did I get downvoted? This is my first post ever. – Henrik Hasell Dec 2 '16 at 15:57
• I can't guarantee this is what happened, but it's possible that your post was flagged as low-quality because it was short, and then the system itself casted a downvote because you edited. We really dislike this behavior, but it's something the system does that we can't change. – James Dec 2 '16 at 16:13
• Welcome to Programming Puzzles & Code Golf! The downvote was cast automatically by the Community user when you edited your answer. I consider this a bug. – Dennis Dec 2 '16 at 16:15
• The "maximum golfed" answer counts as 9 bytes; it's 2 in the file itself, but has 7 bytes of penalties (Dm=main) because it requires an unusual compiler configuration (you'd write it as "2+7 = 9 bytes"). In general, trying to hide code in the compiler configuration or the program's filename is a cheap tactic, and the penalties are intended to prevent it improving your score except in cases where it's interesting. – user62131 Dec 2 '16 at 16:22
• Well said! I will remove it. – Henrik Hasell Dec 5 '16 at 11:04

# Jelly, 2 bytes

×ß


TryItOnline!

A dyadic atom (here ×, but there are swathes of others) followed by the quick ß which instructs to call the same link (the whole line of code) with the same arity - calling it once more with any arity would also work, so, since it is the only line of code, ß could be replaced by any of ¢ÇçÑñ (last link as a nilad, last link as a monad, last link as a dyad, next link as a monad, or next link as a dyad).

## NASM, 3 bytes

ret


I guess it tries to jump to whatever is on the default stack and immediately segfaults :).

Built with: nasm -f elf64 golf.asm && ld golf.o -o golf

## BASH, 10 bytes

kill -6 


kill -6 precisely does this

# C, 14 bytes

main(c){c/=0;}


It's that simple 8-)