Segmentation fault (core dumped)
Why
- you tried to access memory that you do not have access to.
Whenever you get a segfault you know you are doing something wrong with memory – accessing variable that has already been freed, writing to a read-only portion of the memory, or to overwrite part of the operating system, etc. - A common way to get a segfault is to dereference a null pointer:
Reference1
Reference2