Please try it with gdb. Maybe your code is encountering a return null pointer.
example can be gdb ./yourApplication
and then follow gdb steps to troubleshoot the problem.
Further Reads or Ref → Problem with visualizing the detector or running the simulation - #4 by allison
VRS