Before bothering to look through your code to see if I can find the error, just to test, can you try commenting out the lines that you added prior to this crash occurring? After that, build in Visual Studio again and try opening your project. If that doesn’t work, please post the information that you get from Crash Reporter and the related code so I can take a look.
Hello, I was following a tutorial on working with Unreal, I successfully compiled my project from within the Unreal Editor and played with it. Then the guy in the video said that I can also build the project from Visual Studio and just click play on the editor. So after making some changes (just showing something to the log) I build the solution from Visual Studio. The build succeeded but Unreal Editor crashed and since then I can’t open my project.
Hi. When I comment out the new lines and build the project the Unreal Editor works. Then I added these lines FString ObjectName = GetOwner()->GetName(); UE_LOG(LogTemp, Warning, TEXT("Position report for %s"), *ObjectName); and clicked compile and the Editor crashed.
What is the Call Stack (crash information) that is listed in the Crash Reporter window to pops up when the editor crashes? This may be due to GetOwner returning a null reference or something of the sort. I would need to see that information to know for sure.
It says this:
“You do not have any debugging symbols required to display the callstack for this crash.” But in the dump file that I found it says “The thread tried to read from or write to a virtual address for which it does not have the appropriate access.”
Exception code: 0xC0000005
I’d like to point out that Visual Studio is installed on disk C: while Unreal Editor on external drive D. I don’t know if that has anything to do about it.
Ah, the message about debugging symbols would be due to not having the debugging symbols installed which became an option as of the 4.10 release. They take up quite a bit of space (9 GB) but will allow you to see your own callstacks and help when debugging issues, if you would like to install them. This can be done inside of the Epic Games Launcher by finding the installation in the Library, selecting the dropdown arrow beside it. You can then select “Options” and check “Editor Symbols for Debugging”.
Otherwise, that other message told me exactly what I needed to know. If it is having an access violation error, something that is set to Null is being called, which is most likely the value returned from GetOwner or GetName. To be safe, create an if statement that checks to see if GetOwner != NULL and then place the FString declaration line inside of it. This should stop the editor from attempting to call that line unless GetOwner returns something. If the same thing still occurs, then that means that GetName is the culprit. In that case, try creating an if for that as well.
It’s common practice to check values before attempting to use them due to cases like this where the function might get called before the items in question are initalized.
Now it works, and it works like it should work. So, is this some kind of security feature because when delete the if statement the program crashes but when I have the if statement checking if GetOwner() != NULL it runs and shows me the data, for this example I called the getName() property.
When a pointer is pointing to a NULL value and then you try to use it, you’re given a memory address as you would with any pointer value. The only problem is that this memory address is completely random and pointed to somewhere in memory. This particular bit of memory could be used by this program, but could also be used by any other program on your computer. As soon as you try to access that, Windows basically says “No” and stops the program. It’s something you have to be on the look out for yourself as, if it was allowed, it could cause a lot of issues.
Install the debug symbols it helps a TON to show you in which class and line number the issue is. Thanks a million times, i thought it was the engine fault but it was actually my c++ code that was run on instantiating the actors in the level that would crash the editor with null references and such.