Segmentation fault (core dumped) error

With segfaults, the best solution is always to run the application through a debugger such as GDB which can trace which sequence of code/line causes the problem. See this post: Using gdb debugger in an efficient way for some guidance here, or search of GDB on the forums or places like Stack Overflow.