4.6 and 4.7 Standalone crash in PropertyBaseObject.cpp

I have looked around and I see no reported cases of this particular error, and I cannot seem to find any way of fixing it. Its guaranteed to happen everytime I run in standalone game (launching from the play menu in the editor) but it does not happen immediately.

The world is comprised of a World Composition based world, and the error occurs when loading in a cell, it can be any cell, and it can be any object that causes the crash, there is no pattern. The issue also does not occur when running in editor, and occurs less frequently when a debugger is attached.

Below is the callstack at the moment of the crash:

[2015.02.24-12.03.51:207][140]LogWindows: === Critical error: ===
Fatal error!

Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0xffffffff

UE4Editor-CoreUObject.dll!UObjectPropertyBase::CheckValidObject() (0x00007ffba9143393) + 17 bytes [d:\toolkits\unrealengine\testgame\engine\source\runtime\coreuobject\private\uobject\propertybaseobject.cpp:386]
UE4Editor-CoreUObject.dll!UObjectProperty::SerializeItem() (0x00007ffba91dbeee) + 0 bytes [d:\toolkits\unrealengine\testgame\engine\source\runtime\coreuobject\private\uobject\propertyobject.cpp:28]
UE4Editor-CoreUObject.dll!FPropertyTag::SerializeTaggedProperty() (0x00007ffba910dc2a) + 0 bytes [d:\toolkits\unrealengine\testgame\engine\source\runtime\coreuobject\public\uobject\propertytag.h:129]
UE4Editor-CoreUObject.dll!UStruct::SerializeTaggedProperties() (0x00007ffba910d5b2) + 0 bytes [d:\toolkits\unrealengine\testgame\engine\source\runtime\coreuobject\private\uobject\class.cpp:1167]
UE4Editor-CoreUObject.dll!UObject::SerializeScriptProperties() (0x00007ffba917e65c) + 0 bytes [d:\toolkits\unrealengine\testgame\engine\source\runtime\coreuobject\private\uobject\obj.cpp:887]
UE4Editor-CoreUObject.dll!UObject::Serialize() (0x00007ffba917c616) + 0 bytes [d:\toolkits\unrealengine\testgame\engine\source\runtime\coreuobject\private\uobject\obj.cpp:829]
UE4Editor-Engine.dll!USceneComponent::Serialize() (0x00007ffba2368fc6) + 0 bytes [d:\toolkits\unrealengine\testgame\engine\source\runtime\engine\private\scenecomponent.cpp:1015]
UE4Editor-Engine.dll!UPrimitiveComponent::Serialize() (0x00007ffba230c1c5) + 0 bytes [d:\toolkits\unrealengine\testgame\engine\source\runtime\engine\private\primitivecomponent.cpp:443]
UE4Editor-CoreUObject.dll!ULinkerLoad::Preload() (0x00007ffba916ea92) + 0 bytes [d:\toolkits\unrealengine\testgame\engine\source\runtime\coreuobject\private\uobject\linkerload.cpp:2769]
UE4Editor-CoreUObject.dll!FAsyncPackage::CreateExports() (0x00007ffba90c078d) + 0 bytes [d:\toolkits\unrealengine\testgame\engine\source\runtime\coreuobject\private\serialization\asyncloading.cpp:690]
UE4Editor-CoreUObject.dll!FAsyncPackage::Tick() (0x00007ffba9112ca2) + 8 bytes [d:\toolkits\unrealengine\testgame\engine\source\runtime\coreuobject\private\serialization\asyncloading.cpp:279]
UE4Editor-CoreUObject.dll!ProcessAsyncLoading() (0x00007ffba90f52ee) + 24 bytes [d:\toolkits\unrealengine\testgame\engine\source\runtime\coreuobject\private\serialization\asyncloading.cpp:1034]
UE4Editor-CoreUObject.dll!StaticTick() (0x00007ffba91e2660) + 0 bytes [d:\toolkits\unrealengine\testgame\engine\source\runtime\coreuobject\private\uobject\uobjectglobals.cpp:329]
UE4Editor-Engine.dll!UGameEngine::Tick() (0x00007ffba207fc10) + 0 bytes [d:\toolkits\unrealengine\testgame\engine\source\runtime\engine\private\gameengine.cpp:800]
UE4Editor.exe!FEngineLoop::Tick() (0x00007ff6a1bcb564) + 0 bytes [d:\toolkits\unrealengine\testgame\engine\source\runtime\launch\private\launchengineloop.cpp:2214]
UE4Editor.exe!GuardedMain() (0x00007ff6a1bbf9de) + 0 bytes [d:\toolkits\unrealengine\testgame\engine\source\runtime\launch\private\launch.cpp:131]
UE4Editor.exe!GuardedMainWrapper() (0x00007ff6a1bbfa4a) + 5 bytes [d:\toolkits\unrealengine\testgame\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
UE4Editor.exe!WinMain() (0x00007ff6a1bccbb9) + 17 bytes [d:\toolkits\unrealengine\testgame\engine\source\runtime\launch\private\windows\launchwindows.cpp:202]
UE4Editor.exe!__tmainCRTStartup() (0x00007ff6a1bcdb79) + 21 bytes [f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c:618]
KERNEL32.DLL!UnknownFunction (0x00007ffbc3ff16ad) + 0 bytes [UnknownFile:0]
ntdll.dll!UnknownFunction (0x00007ffbc67c4409) + 0 bytes [UnknownFile:0]
ntdll.dll!UnknownFunction (0x00007ffbc67c4409) + 0 bytes [UnknownFile:0]

In the PropertyBaseObject::CheckValidObject function, Object is not null, but nor is it a valid reference, so when it obtains the class for that object, this class is also invalid and so it crashes trying to access any variables on this class. It looks like the object has been garbage collected at some point, but not removed, but again there appears to be no pattern to why this occurs.

The object in particular is a custom static mesh asset. I cannot provide a repro of this issue, as im not sure why it happens, or how much work it would take to actually create a repro, my world is fairly large and has thousands of objects in it, which may be part of the cause.

Prior to 4.6.1 I have had no issues, when porting to 4.6.1 I changed none of the code (except for the deprecated stuff). So its nothing I have added to the code since.

I noticed that in 4.7.8 preview, there has been a lot of code added around these functions for circular dependencies and other stuff, what I am wondering is, does this code touch on the above issue? and if so, can someone send me the git commit for those fixes in particular, I am not ready to upgrade to 4.7.8 preview at this time due to the changes in rendering (requires a lot of work on my behalf to do so, even just to test). So that I can apply the changes retro actively.

I took the leap and updated to 4.7 and I get the same crash, but it manifests with a different crash log, but I suspect is related to the same issue:

    [2015.02.25-08.28.37:156][733]LogWindows: === Critical error: ===
    Fatal error!
    
    Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0xffffffff
    
    UE4Editor-CoreUObject.dll!UObjectBaseUtility::IsA() (0x00007ff90263062d) + 0 bytes [e:\unrealengine\unrealengine-4.7.0-release\engine\source\runtime\coreuobject\private\uobject\uobjectbaseutility.cpp:254]
    UE4Editor-CoreUObject.dll!ULinkerLoad::DeferPotentialCircularImport() (0x00007ff9024e0899) + 0 bytes [e:\unrealengine\unrealengine-4.7.0-release\engine\source\runtime\coreuobject\private\blueprint\blueprintsupport.cpp:325]
    UE4Editor-CoreUObject.dll!ULinkerLoad::CreateImport() (0x00007ff902563533) + 0 bytes [e:\unrealengine\unrealengine-4.7.0-release\engine\source\runtime\coreuobject\private\uobject\linkerload.cpp:3659]
...

Strange thing is, this is not a blueprint class, and there are no blueprints involved with these objects, they are just custom static mesh objects.

Hi ,

Do you know which assets in particular are linked to the crash? If so, try pulling those objects out and see if the crash still occurs or if it is definitely linked specifically to those objects.

The assets are random, sometimes they will actually load without issue, and then as I run around the world, that level will unload, then when I come back to it, it will crash, even though the asset previously loaded. Originally for 4.6 I put in a safeguard, checking that Object was valid, and it never crashed, but you could see models missing from the level (the ones that would cause the crash) and it was completely random, when it occurred it was generally only one model from a sublevel. (Then if I came back to it later, it would be there, so its very intermittent)

Do you have a sample project that shows this behavior that you’d be willing to share? Unfortunately I haven’t been able to reproduce it on our end, so any additional information or reproduction steps would be greatly appreciated!

I can’t deliver the project that is causing the issue, so I will try to recreate a small example, I wanted to check to ensure its not a problem that has been encountered before, especially considering all the code that was added around the area of the crash as a part of 4.7. Because I do suspect it actually may be something on my end, an intermittent memory leak in part of my code that may be causing other areas to become garbage.

I will try my best to repro it, and if I can I will post, but for now I think this can be marked as resolved, as I do believe it is my end now.

Okay so after days upon days of debugging. I have stripped my code right back to absolute minimum. Basically all I have now is an Asset (CustomMeshAsset) a Component (CustomMeshComponent) and an actor (CustomMeshActor). They do nothing at all now, no rendering, the render data is forced to null, scene proxy doesn’t get created. So its merely just a container.

Populating my world composition world with these actors (about 60+ in each cell). And I continue to get a crash in the above function on a random basis, sometimes it may take 10 minutes, sometimes almost immediately. Looking through the stack trace, I can see that during loading imports, it actually is creating an invalid XObject reference for at least 1 or 2 objects from time to time (this is when the crash occurs). If I bypass this by saying, if invalid then fill with null and allow it to continue, I can then travel back to that same cell and those same objects may load successfully, there is no repeatable pattern.

Some additional notes. From my short testing, i could not get it to occur with static mesh actors, but again with the frequency, I may not have tested thoroughly enough. Also it appears if I set the asset to null (So in my case the CustomMeshComponent has an asset pointer to the CustomMeshAsset) then it will never crash. So the linker for some reason only resolves the assets as invalid when it happens. And lastly this only occurs in standalone, never in editor and has occured in every version of UE4 since v4.6.0 (prior to this it worked fine, I have made no code changes except for the reduction I spoke about above).

The only change I can see that has occurred to the Linker since 4.5 that may have had an impact on my project is the following: https://github.com/EpicGames/UnrealEngine/commit/99fe836a5a04227e9676ea8297358510e027ef8d

I am working on stripping what I can out of my main project into an additional project so that I can send over

Sorry for the double post, but almost out of characters on the above, and forgot to mention also, if I add SetFlags( RF_RootSet ) to the constructor of the asset (So telling it not to be garbage collected ever) then I also get no crash, so at some point, the asset is being GC’ed but a reference internally is not being invalidated - I am not holding any reference to the objects myself.

Hey -

Sorry for the delayed response. Are you still experiencing this crash in the latest version of the engine? If so could you please post the logs from the crash as well as a simplistic version of the code you’re using.

I’m having some difficulty following exactly what is happening in your project. When you mention CustomMeshAsset, CustomMeshComponent, and CustomMeshActor - are each of those a custom code class? Could you walk me through your setup and point out exactly when the crash occurs?

Cheers

Hi ,

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will offer further assistance.

Thank you.

Hey guys,

Was this ever resolved?
We’re currently working with 4.7.1 and seeing this same issue.

Not sure if it’ll help, but here’s our crash stack:Here

we’re also crashing in the same place, in:

UE4Editor_CoreUObject!ULinkerLoad::DeferPotentialCircularImport() + 249 bytes [e:\perforce\submerged_main\engine\source\runtime\coreuobject\private\blueprint\blueprintsupport.cpp:325]

Cheers.

Hey -

Could you also post the log files from the crash as well as the steps taken that cause the crash? Does your crash also involve using custom static mesh object? Does the crash reproduce in a new blank project with no additional content?

Cheers

We are using a custom static mesh component, however i’m not 100% sure it is related to the crash. (As I do not have a reliable repro, and haven’t seen it in the debugger)
We use both the custom and engine standard components/actors.

I currently don’t have a log, but will post one in the next day or so.
Once I do, i’ll attempt to recreate it in a blank project.

I’ll update you in the next few days.

Cheers

Hi ,

We have not heard back from you for a while. Is this issue still occurring for you? I will mark this post as resolved for internal tracking purposes, but please feel free to add a comment and re-open this post if you have any additional information.

I haven’t seen this issue recently, but I also haven’t had the time to look too much further into the issue.
I’ll re-open this bug when I have the time to dig into it further and get a reliable repro.

Cheers.