#rb Per.Larsson
#preflight 63f8922ab879197e73369f7e
- CL 24316937 made an effort to prevent serialization of bad data from corrupting memory, however the checks were a little too zealous. In some cases the archive provided for serialization is already in an error state in which case we should trust that the calling code has processes the problem correctly. Handling the error at this point from within bulkdata can give misleading errors.
- We now check if the archive is in the error state or not BEFORE we start serialization and if it is in error we just return early with default values.
- This should ensure that the problem is reported by the system creating it rather than always by bulkdata and make things easier to diagnose/fix/
[CL 24406791 by paul chipchase in ue5-main branch]
An optimization to UE_LOG exposed an issue in Clang when targeting Windows. Log statements in inline functions of imported types fail to compile.
#preflight 63f7f350ef1b24bf94367191
#rb Zousar.Shaker
#rnx
[CL 24397809 by devin doucette in ue5-main branch]
1) Add editor-only scope for the load serialization of SoftObjectPaths on editoronly objects; these references should not be added to the cook.
2) Nanite SoftObjectPaths should be declared as editoronly rather than skipped entirely, so that our analytics for hidden dependencies are not triggered.
3) Explore editoronly hard dependencies in the RequestCluster, because these packages will be loaded and we want to avoid incorrectly marking them as hidden dependencies.
4) Skip exploring the soft dependencies of uncookable packages; uncookable packages are the same as not-referenced package as far as the runtime is concerned so we don't need their references.
5) Explore localization refererences - these are similar to AssetRegistry calculated dependencies.
#rb Zousar.Shaker
#rnx
#preflight 63f7e21cc35a141980525e80
[CL 24392154 by Matt Peters in ue5-main branch]
Added extra checks for importing delegate definitions from strings.
#rb johan.torp
#preflight 63f4ec56977ceed915c2d372
[CL 24387136 by steve robb in ue5-main branch]
* Added ScriptDelegateFwd.h and put it in the right module (CoreUObject). before fwd declarations was in Core.
* Fixed problem with StructuredArchive forward declaring and used functions that was force inlined in another file. header units did not like this and caused linker errors (and I'm surprised it worked before)
* Various fixes related to how global variables are defined (static for global variables means that they are not visible outside header units)
* Various fixes related to how global functions are defined (static for global functions means that they are not visible outside header units)
* Move some method implementations to cpp file to work around header unit compile crashes (and they should probably be there firstplace)
* Removed *_API on some types to fix header unit linker errors
* Added WITH_EDITOR around code that only compiles in editor config (these headers were not included anywhere but HU can't know that)
#preflight 63f50161ac06ce789f9c34d2
#rb steve.robb
[CL 24348303 by henrik karlsson in ue5-main branch]
- No additional routing was being done in Exec.
- No default parameter was being provided through the Exec override.
This is so we can turn off Exec overrides in certain configurations.
#rb none
#preflight 63f3fc331d71bcd26256868e
[CL 24343558 by jeanmichel dignard in ue5-main branch]
#rb Per.Larsson
#rnx
#preflight 63f3b1fa52460c3a1f4684ce
- The problem is that our allocation functions take allocation sizes as type SIZE_T which on older 32bit platforms will be int32, but bulkdata stores sizes as int64. If the requested allocation is large enough the size will be truncated and the allocation could still return a valid memory allocation but one much smaller than requested. Later when we try to load into that allocation we will overwrite the end of the buffer. Given our supported platforms and how bulkdata is generally used this is an unlikely scenario but one we still should protect against.
- Added two functions ::SafeMalloc and ::SafeRealloc to replace direct calls to malloc/realloc. These utility functions will check to make sure that we can make allocations of the requested size by making sure that SIZE_T (the type that our allocators take for allocation sizes) is a large enough type.
- If the platform cannot service the request we will issue a fatal log error and halt the process. Technically we could error and return nullptr but in practice very little code checks to see if bulkdata allocations are valid or not and will end up crashing anyway. Given that this problem is only going to show up on 32bit machines and only for very large assets (most likely invalid or broken ones at that) we might as well halt execution as close to the problem as possible to make debugging easier.
- The changes are only applied for platforms where PLATFORM_32BITS is true, should be no cost to 64 bit platforms.
[CL 24335588 by paul chipchase in ue5-main branch]
When on, at load the packages will detect if they where moved and if this is the case they will modify their ImportMap and SoftObjectPathList. The package reference in those that were in the same MountPoint as the asset when it was saved will behave as if they were relative references.
#preflight 63f3e319500c05a624417605
#rb Matt.Peters
[CL 24332127 by julien stjean in ue5-main branch]
Add missing DestructItems FScriptArrayHelper::MoveAssign and FScriptMapHelper::MoveAssign to ensure that destructors of elements are called.
Will be submitted in two parts, one for UnrealTypes.h, and one for the rest of the files.
#rb Andrew Scheidecker Steve Robb
#preflight 63f3e5ba500c05a62441d14a
[CL 24331132 by niklas rojemo in ue5-main branch]
Ditto for any failed actor loads from world partitions
[REVIEW] [at]Daniel.Lamb [at]brian.marshall1
#preflight 63f3cb567064074bd8bf5232
[CL 24328314 by simon barratt in ue5-main branch]
#rb Per.Larsson
#jira UE-172853
#rnx
#preflight 63f3834a61378b7ea0065346
- The main issue we are trying to solve is that we serialize the number of elements when saving/loading the package. On load we multiple the number of elements (int64) by the size of each element (int64) and if either of those values is large enough we could overflow and end up with an incorrect size. We do check for this when saving the package so this is only likely to come up if the package has been corrupted in some way.
- Change FBulkMetaData::FromSerialized to do the actual serialization as well. This lets us set the error flag on the archive if we do detect problems and keep all the error handling in a single place.
-- Note that setting the error flag on an archive while a package is being loaded doesn't seem to do much at the moment, so this is more of an attempt to future proof.
- If we detect an error with serializing FBulkMetaResource we will log an error and immediately return so that FBulkMetaData will remain set to defaults.
- We now calculate the largest value of ElementCount that we can support, given the ElementCount size and if the count is exceeded we will log an error, set the error flag on the archive and return leaving FBulkMetaData as default.
- Note that both before and after this change the package is effectively broken and won't work properly, but this change will stop us from potentially stomping memory.
- Note that at runtime we generally serialize the bulkdata info from the BulkDataMap in the package header, so this is mostly an editor thing.
[CL 24322887 by paul chipchase in ue5-main branch]
COND_Dynamic allows for a property to decide its actual replication condition after instantiation of the actor/component rather than be the same for all instances. The condition can be changed using the macros DOREPDYNAMICCONDITION_INITCONDITION_FAST, when used in the object's GetReplicatedCustomConditionState implementation, or DOREPDYNAMICCONDITION_SETCONDITION_FAST in any other place where it's appropriate to change the condition. If the condition is never modified, thus remaining COND_Dynamic, the property will always replicate when changed. It's possible to use the DOREPCUSTOMCONDITION_ macros too on properties with this condition.
#jira UE-122444
#preflight 63eb3ca1923476b686190e5a
#rb louisphilippe.seguin, ryan.gerleve, mattias.hornlund, brian.bekich
[CL 24307287 by peter engstrom in ue5-main branch]