Question: I'm trying to set up the way my server handles core dumps. In order to test it, I'd need a program that always segfaults.

Is there a simple example program that always segfaults?

Answer: 
You can try:

```
main() {
char *p = NULL;
char c = *p;
}

```
this should die:

```
int main() {
    char *die;
    printf("%d",(int *)die * 200);
    return 0;
}

```

edit:

```
int main() {
    char *die;
    int killer = 200;
    while(1) {
       printf("%d",(int *)die * killer);
       killer = killer * killer;
    }
    return 0;
}

```