If you encounter system crashes suddenly without changing anything in the environment and source code, I would also consider some hardware issues, e.g. overheating or a weak PSU (or a faulty one).
Do you see any errors or is your terminal just printing the seg fault message and stops?
Could you check the temp. sensors and see how hot the system is before it crashes?