By assigning {5, 2, 1, 4}
int *nums = {5, 2, 1, 4};
you are assigning 5 to nums (after an implicit typecast from int to pointer to int). Dereferring it makes an access call to memory location at 0x5. That might not be allowed for your program to access.
Try
printf("%p", (void *)nums);