How to debug crashes?
So I've created my game project but it seems to be crashing a lot and I'm not sure how to figure out what the cause is. The game is built entirely out of blueprints and it doesn't seem like it's very intensive but something in my script is causing the problem. How does one go about figuring out why the game is crashing? It just hard locks and I have to shut it down in the task manager.
asked Feb 22 '17 at 02:53 AM in Using UE4
Most basic things you can do is check the logs after crash in /Saved/Logs in you project directory, UE4 if it was controlled crash (assert fail for example, engine has assertion check expection of specific state, if it's false engine will crash it self as it can't ensure stability) it will leave crash log with reason of crash, it should also leave stack trace (list of functions what function called what function) you might figure what caused crash just by look of it. In case of assert fail you will give a condition that failed in C++ code, and where that happened (file + line number) you need to search engine code and search for check() function with that condition and figure why it is false. If it was not controllable crash, cause for example by tring to call function on not existing object or any CPU level error, OS will stop execution without question and you will have cutter log that suddenly stop, because engine could not do anything, those crashes are harder to debug, thats why it has this assertion checks mentioned above.
Other solution is code debuging, you run UE4 in debugger in Visual Studio and when crash happens it will halt the code execution nad VS will tell you where crash happened and give you stack trace and you can also probe memoery for varable states. This debugging works on any crash, when OS will detect issue and halt the application, you can also put break points in the code and deugger will stop at that program point like it crash but you can resume.
But as you not doing C++ this might be hard to do, so mostly what you can do is check the log, look above in log there might be some hints what went wrong, if this won't help try to reproduce the crash so you know when it happens, the you can raport it us a bug with step by step instruction how to reproduce it and Epic or someone else can look at it, even if it's assert fail since it should not happen so submit also your log too. There no solution for random crashes sadly without proper code debugging, which will be hard wither way if you don't know when crash happens.
answered Feb 22 '17 at 05:15 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here