Ending Physics and Setting Transform in Same Tick Causes Crash

#Repro

  1. in C++, spawn a StaticMeshActor extending class and then set this mesh to simulate physics
  2. on the press of key or some other event, end physics and set Actor transform in the same tick, from within its own .cpp file

this causes crash that did not occur in 4.0.2

#More Info

Doing one or the other does not cause crash, but doing both in same tick does!

#Code Inside StaticMeshActor Extending Class

In Same Tick

//End Physics
StaticMeshComponent->SetSimulatePhysics(false);
		
//Restore Editor Pos
SetActorTransform(Vibes.RedVibes.VictoryTransform);

#Log
Log file open, 04/26/14 11:27:11
LogInit:Display: Running engine for game: VictoryGame
LogInit: Version: 4.1.0-0+UE4
LogInit: Compiled (64-bit): Apr 26 2014 09:07:33
LogInit: Build Configuration: Development
LogInit: Branch Name: UE4
LogInit: Command line: -ResX=1280 -ResY=960 -WinX=0 -WinY=30 -Fullscreen=false -NoVSync -log -SaveToUserDir -game
LogInit: Base directory: E:/VictoryUE4/UnrealEngine-4.1/Engine/Binaries/Win64/
LogInit: Rocket: 0
[2014.04.26-15.27.11:182][ 0]LogTaskGraph: Started task graph with 3 named threads and 4 total threads.
[2014.04.26-15.27.11:221][ 0]LogOnline:Verbose: NULL: Created thread (ID:7368).
[2014.04.26-15.27.11:225][ 0]LogInit: WinSock: version 1.1 (2.2), MaxSocks=32767, MaxUdp=65467
[2014.04.26-15.27.11:232][ 0]LogInit: Presizing for 0 objects not considered by GC, pre-allocating 0 bytes.
[2014.04.26-15.27.11:237][ 0]LogInit: Object subsystem initialized
[2014.04.26-15.27.11:239][ 0]LogInit: Selected Device Profile: [Windows]
[2014.04.26-15.27.11:239][ 0]LogInit: Applying CVar settings loaded from the selected device profile: [Windows]
[2014.04.26-15.27.11:243][ 0]LogInit: Computer: VICTORY
[2014.04.26-15.27.11:243][ 0]LogInit: User: Rama
[2014.04.26-15.27.11:244][ 0]LogInit: CPU Page size=4096, Cores=4
[2014.04.26-15.27.11:244][ 0]LogInit: High frequency timer resolution =3.515683 MHz
[2014.04.26-15.27.11:244][ 0]LogMemory: Memory total: Physical=7.9GB (8GB approx) Virtual=8192.0GB
[2014.04.26-15.27.11:244][ 0]LogMemory: Platform Memory Stats for Windows
[2014.04.26-15.27.11:244][ 0]LogMemory: Process Physical Memory: 69.33 MB used, 69.33 MB peak
[2014.04.26-15.27.11:244][ 0]LogMemory: Process Virtual Memory: 49.71 MB used, 49.71 MB peak
[2014.04.26-15.27.11:245][ 0]LogMemory: Physical Memory: 4014.12 MB used, 8110.17 MB total
[2014.04.26-15.27.11:245][ 0]LogMemory: Virtual Memory: 262.54 MB used, 8388608.00 MB total
[2014.04.26-15.27.11:274][ 0]LogD3D11RHI: Found D3D11 adapter 0: NVIDIA GeForce GTX 680 (Feature Level 11_0)
[2014.04.26-15.27.11:274][ 0]LogD3D11RHI: Adapter has 1994MB of dedicated video memory, 0MB of dedicated system memory, and 2047MB of shared system memory
[2014.04.26-15.27.11:275][ 0]LogD3D11RHI: Chosen D3D11 Adapter Id = 0
[2014.04.26-15.27.11:279][ 0]LogRHI: Texture pool is 1361 MB (70% of 1945 MB)
[2014.04.26-15.27.11:288][ 0]LogD3D11RHI: Async texture creation enabled
[2014.04.26-15.27.11:326][ 0]LogInit:Warning: We appear to have no tool tip localization data? Editor can’t run.
[2014.04.26-15.27.11:327][ 0]LogInit:Warning: We appear to have no property name localization data? Editor can’t run.
[2014.04.26-15.27.11:346][ 0]LogTextLocalizationManager:Warning: Loading localization resources contain conflicting entries for (Namespace:UICommands, Key:ToggleRealtime_ToolTip):
Resource: (E:/VictoryUE4/UnrealEngine-4.1/Engine/Content/Localization/Editor/en/Editor.locres) Hash: (-291638278) String: (Toggle Realtime)
Resource: (E:/VictoryUE4/UnrealEngine-4.1/Engine/Content/Localization/Editor/en/Editor.locres) Hash: (-1913389001) String: (Toggles real time rendering in this viewport)
[2014.04.26-15.27.11:364][ 0]LogContentStreaming: Texture pool size is 1000.000000MB
[2014.04.26-15.27.11:889][ 0]LogTargetPlatformManager:Display: Building Assets For Windows
[2014.04.26-15.27.11:942][ 0]LogTargetPlatformManager:Display: Building Assets For Windows
[2014.04.26-15.27.11:966][ 0]LogDerivedDataCache:Display: Max Cache Size: 512 MB
[2014.04.26-15.27.12:054][ 0]LogDerivedDataCache: Loaded boot cache 0.09s 120MB C:/Users/Rama/Documents/Unreal Projects/VictoryGame/DerivedDataCache/Boot.ddc.
[2014.04.26-15.27.12:054][ 0]LogDerivedDataCache:Display: Loaded Boot cache: C:/Users/Rama/Documents/Unreal Projects/VictoryGame/DerivedDataCache/Boot.ddc
[2014.04.26-15.27.12:055][ 0]LogDerivedDataCache: FDerivedDataBackendGraph: Pak pak cache file C:/Users/Rama/Documents/Unreal Projects/VictoryGame/DerivedDataCache/DDC.ddp not found, will not use a pak cache.
[2014.04.26-15.27.12:055][ 0]LogDerivedDataCache: Unable to find inner node Pak for hierarchical cache Hierarchy.
[2014.04.26-15.27.12:056][ 0]LogDerivedDataCache: FDerivedDataBackendGraph: EnginePak pak cache file …/…/…/Engine/DerivedDataCache/DDC.ddp not found, will not use a pak cache.
[2014.04.26-15.27.12:056][ 0]LogDerivedDataCache: Unable to find inner node EnginePak for hierarchical cache Hierarchy.
[2014.04.26-15.27.12:068][ 0]LogDerivedDataCache: Using Local data cache path …/…/…/Engine/DerivedDataCache: Writable
[2014.04.26-15.27.12:068][ 0]LogDerivedDataCache: Shared data cache path not found in *engine.ini, will not use an Shared cache.
[2014.04.26-15.27.12:068][ 0]LogDerivedDataCache: Unable to find inner node Shared for hierarchical cache Hierarchy.
[2014.04.26-15.27.12:185][ 0]Warning: Unknown property in CustomChannelSetup: ECC_GameTraceChannel10, Name=EditorSelectionTrace)
[2014.04.26-15.27.12:185][ 0]ImportText (DefaultChannelResponses): Missing closing parenthesis: (
[2014.04.26-15.27.12:185][ 0]Warning: ImportText (CustomResponses): Missing opening parenthesis:
[2014.04.26-15.27.12:186][ 0]ImportText(EditProfiles): Not enough closing parenthesis in: (Name=“Pawn”,CustomResponses=(
[2014.04.26-15.27.12:187][ 0]LogCollisionProfile:Warning: Default Setup doesn’t allow for predefined engine channels (0)
[2014.04.26-15.27.12:188][ 0]LogCollisionProfile:Warning: Default Setup doesn’t allow for predefined engine channels (0)
[2014.04.26-15.27.12:188][ 0]LogCollisionProfile:Warning: Profile (Pawn) - Custom Channel Name = ‘None’ hasn’t been found
[2014.04.26-15.27.12:202][ 0]LogMeshUtilities: No automatic mesh reduction module available
[2014.04.26-15.27.12:202][ 0]LogMeshUtilities: No automatic mesh merging module available
[2014.04.26-15.27.12:398][ 0]LogEnum:Warning: Enum Text 1 for Enum ECustomDepth failed to resolve to any value
[2014.04.26-15.27.12:399][ 0]LogEnum:Warning: Enum Text 3 for Enum EEarlyZPass failed to resolve to any value
[2014.04.26-15.27.12:399][ 0]LogEnum:Warning: Enum Text 1 for Enum EClearSceneOptions failed to resolve to any value
[2014.04.26-15.27.12:400][ 0]LogEnum:Warning: Enum Text 4 for Enum ECompositingSampleCount failed to resolve to any value
[2014.04.26-15.27.13:029][ 0]LogSkinnedMeshComp:Warning: GetSocketByName(): No SkeletalMesh for CharacterMesh0
[2014.04.26-15.27.13:030][ 0]LogSkinnedMeshComp:Warning: GetSocketByName(): No SkeletalMesh for CharacterMesh0
[2014.04.26-15.27.13:031][ 0]LogSkinnedMeshComp:Warning: GetSocketByName(): No SkeletalMesh for CharacterMesh0
[2014.04.26-15.27.13:032][ 0]LogSkinnedMeshComp:Warning: GetSocketByName(): No SkeletalMesh for CharacterMesh0
[2014.04.26-15.27.13:033][ 0]LogSkinnedMeshComp:Warning: GetSocketByName(): No SkeletalMesh for CharacterMesh0

[2014.04.26-15.27.13:232][  0]LogClass:Warning: Type mismatch in PreviewSkeletalMesh of Skeleton - Previous (ObjectProperty) Current(AssetObjectProperty) for package:  C:/Users/Rama/Documents/Unreal Projects/VictoryGame/Content/Character/vertex_bothGreaves_Skeleton.uasset
[2014.04.26-15.27.13:241][  0]LogClass:Warning: Type mismatch in PreviewSkeletalMesh of Skeleton - Previous (ObjectProperty) Current(AssetObjectProperty) for package:  C:/Users/Rama/Documents/Unreal Projects/VictoryGame/Content/Character/RoyalSwordSkeleton.uasset
[2014.04.26-15.27.13:244][  0]LogClass:Warning: Type mismatch in PreviewSkeletalMesh of Skeleton - Previous (ObjectProperty) Current(AssetObjectProperty) for package:  C:/Users/Rama/Documents/Unreal Projects/VictoryGame/Content/Warrior/Equipment/CaveSwordSkeleton.uasset
[2014.04.26-15.27.13:246][  0]LogClass:Warning: Type mismatch in PreviewSkeletalMesh of Skeleton - Previous (ObjectProperty) Current(AssetObjectProperty) for package:  C:/Users/Rama/Documents/Unreal Projects/VictoryGame/Content/Warrior/Equipment/Scimitar/Scimitar_Skeleton.uasset
[2014.04.26-15.27.13:288][  0]LogAssetRegistry: FAssetRegistry took 0.0000 seconds to start up
[2014.04.26-15.27.14:599][  0]LogSkinnedMeshComp:Warning: GetSocketByName(): No SkeletalMesh for CharacterMesh0
[2014.04.26-15.27.14:600][  0]LogSkinnedMeshComp:Warning: GetSocketByName(): No SkeletalMesh for CharacterMesh0
[

[2014.04.26-15.27.17:477][  0]SourceControl: Info Source control is disabled
[2014.04.26-15.27.17:486][  0]LogObj: 52794 objects as part of root set at end of initial load.
[2014.04.26-15.27.17:486][  0]LogUObjectAllocator: 15862856 out of 0 bytes used by permanent object pool.
[2014.04.26-15.27.17:672][  0]LogAutomationTest:Warning: Loading localization resources contain conflicting entries for (Namespace:UICommands, Key:ToggleRealtime_ToolTip):
Resource: (E:/VictoryUE4/UnrealEngine-4.1/Engine/Content/Localization/Editor/en/Editor.locres) Hash: (-291638278) String: (Toggle Realtime)
Resource: (E:/VictoryUE4/UnrealEngine-4.1/Engine/Content/Localization/Editor/en/Editor.locres) Hash: (-1913389001) String: (Toggles real time rendering in this viewport)
[2014.04.26-15.27.17:672][  0]LogAutomationTest:Warning: Loading localization resources contain conflicting entries for (Namespace:UICommands, Key:ToggleRealtime_ToolTip):
Resource: (E:/VictoryUE4/UnrealEngine-4.1/Engine/Content/Localization/Editor/en/Editor.locres) Hash: (-291638278) String: (Toggle Realtime)
Resource: (E:/VictoryUE4/UnrealEngine-4.1/Engine/Content/Localization/Editor/en/Editor.locres) Hash: (-1913389001) String: (Toggles real time rendering in this viewport)
[2014.04.26-15.27.17:673][  0]LogAutomationTest:Warning: Loading localization resources contain conflicting entries for (Namespace:UICommands, Key:ToggleRealtime_ToolTip):
Resource: (E:/VictoryUE4/UnrealEngine-4.1/Engine/Content/Localization/Editor/en/Editor.locres) Hash: (-291638278) String: (Toggle Realtime)
Resource: (E:/VictoryUE4/UnrealEngine-4.1/Engine/Content/Localization/Editor/en/Editor.locres) Hash: (-1913389001) String: (Toggles real time rendering in this viewport)
[2014.04.26-15.27.17:674][  0]LogAutomationTest:Warning: ERR: Transient text cannot be serialized "Testing Transient serialization detection".
[2014.04.26-15.27.17:675][  0]LogEngine: Initializing Engine...
[2014.04.26-15.27.17:675][  0]OCULUS: OVR::DeviceManager - initialized.
[2014.04.26-15.27.17:683][  0]OCULUS: OVR::DeviceManagerThread - running (ThreadId=0xBFC).
[2014.04.26-15.27.17:683][  0]LogHMD:Warning: No Oculus HMD detected!
[2014.04.26-15.27.17:684][  0]LogHMD:Warning: No Oculus Sensor detected!
[2014.04.26-15.27.17:685][  0]LogHMD: Oculus Latency Tester not found.
[2014.04.26-15.27.17:690][  0]OCULUS: OVR::DeviceManager - shutting down.
[2014.04.26-15.27.17:690][  0]OCULUS: OVR::DeviceManagerThread - exiting (ThreadId=0xBFC).
[2014.04.26-15.27.17:690][  0]LogHMD: Oculus shutdown.
[2014.04.26-15.27.17:776][  0]LogInit: XAudio2 using 'Speakers (Realtek High Definition Audio)' : 2 channels at 48 kHz using 32 bits per sample (channel mask 0x3)
[2014.04.26-15.27.17:875][  0]LogInit: FAudioDevice initialized.
[2014.04.26-15.27.17:931][  0]LogDerivedDataCache: Saved boot cache 0.06s 120MB C:/Users/Rama/Documents/Unreal Projects/VictoryGame/DerivedDataCache/Boot.ddc.
[2014.04.26-15.27.17:945][  0]LogInit: Texture streaming: Enabled
[2014.04.26-15.27.17:968][  0]LogConsoleResponse:Display: 
[2014.04.26-15.27.17:968][  0]LogNet: Browse: /Game/Maps/Victory?Name=Player
[2014.04.26-15.27.17:969][  0]LogLoad: LoadMap: /Game/Maps/Victory?Name=Player
[2014.04.26-15.27.18:017][  0]LogMemory: Platform Memory Stats for Windows
[2014.04.26-15.27.18:017][  0]LogMemory: Process Physical Memory: 515.97 MB used, 535.53 MB peak
[2014.04.26-15.27.18:017][  0]LogMemory: Process Virtual Memory: 481.35 MB used, 498.20 MB peak
[2014.04.26-15.27.18:018][  0]LogMemory: Physical Memory: 4611.79 MB used, 8110.17 MB total
[2014.04.26-15.27.18:019][  0]LogMemory: Virtual Memory: 828.13 MB used, 8388608.00 MB total
[2014.04.26-15.27.18:019][  0]LogMemory: 
[2014.04.26-15.27.18:020][  0]Allocator Stats for TBB: (not implemented)
[2014.04.26-15.27.18:415][  0]LogWorld: Game class is 'VictoryGameGameMode'
[2014.04.26-15.27.18:427][  0]LogWorld: Bringing World /Game/Maps/Victory.Victory up for play (max tick rate 0) at 2014.04.26-11.27.18
[2014.04.26-15.27.18:429][  0]LogWorld: Bringing up level for play took: 0.012776
[2014.04.26-15.27.18:430][  0]LogOnline: Starting session Game on server
[2014.04.26-15.27.18:430][  0]LogOnline:Warning: NULL: Can't start an online game for session (Game) that hasn't been created
[2014.04.26-15.27.18:432][  0]LogGameMode: RestartPlayer Victory-5F01892D4849
[2014.04.26-15.27.18:432][  0]LogSkinnedMeshComp:Warning: GetSocketByName(): No SkeletalMesh for CharacterMesh0

[2014.04.26-15.27.18:444][  0]LogPlayerController: ClientRestart_Implementation VictoryWarriorSpiritBP_C_0
[2014.04.26-15.27.18:444][  0]LogPlayerController: ServerAcknowledgePossession_Implementation VictoryWarriorSpiritBP_C_0
[2014.04.26-15.27.18:449][  0]LogInit:Display: Game Engine Initialized.
[2014.04.26-15.27.18:494][  0]LogLoad: Full Startup: 7.88 seconds (BP compile: 0.87 seconds)
[2014.04.26-15.27.18:551][  1]LogRenderer:Warning: Reallocating scene render targets to support 1280x960.
[2014.04.26-15.27.18:862][  2]LogInit: Using libcurl 7.34.0
[2014.04.26-15.27.18:862][  2]LogInit:  - built for x86_64-pc-win32
[2014.04.26-15.27.18:862][  2]LogInit:  - supports SSL with WinSSL
[2014.04.26-15.27.18:863][  2]LogInit:  - other features:
[2014.04.26-15.27.18:864][  2]LogInit:      CURL_VERSION_SSL
[2014.04.26-15.27.18:864][  2]LogInit:      CURL_VERSION_ASYNCHDNS
[2014.04.26-15.27.18:902][  2]LogInit:      CURL_VERSION_LARGEFILE
[2014.04.26-15.27.18:903][  2]LogInit:      CURL_VERSION_IDN
[2014.04.26-15.27.18:903][  2]LogInit: Libcurl will NOT reuse connections
[2014.04.26-15.27.19:178][ 11]AnimBlueprint:Warning: Warning SLOTNODE: 'UpperBody' already exists. Each slot node has to have unique name.
[2014.04.26-15.27.19:180][ 11]AnimBlueprint:Warning: Warning SLOTNODE: 'UpperBody' already exists. Each slot node has to have unique name.
[2014.04.26-15.27.19:827][ 56]LogSkinnedMeshComp:Warning: GetSocketByName(): No SkeletalMesh for CharacterMesh0
[2014.04.26-15.27.19:828][ 56]LogSkinnedMeshComp:Warning: GetSocketByName(): No SkeletalMesh for CharacterMesh0
[2014.04.26-15.27.21:666][191]LogParticles:Warning: 	/Game/Effects/Ribbon/SwordRibbon.SwordRibbon
[2014.04.26-15.27.30:439][980]LogPlayerController: ClientRestart_Implementation VictoryWarriorSpiritBP_C_0
[2014.04.26-15.27.30:439][980]LogPlayerController: ServerAcknowledgePossession_Implementation VictoryWarriorSpiritBP_C_0
[2014.04.26-15.27.33:142][ 97]LogThreadingWindows:Error: Runnable thread TaskGraphThread 0 crashed.
[2014.04.26-15.27.33:142][ 97]LogWindows: === Critical error: ===


[2014.04.26-15.27.33:142][ 97]LogWindows: Fatal error!


Crash in runnable thread TaskGraphThread 0
[2014.04.26-15.27.33:142][ 97]LogExit: Executing StaticShutdownAfterError
[2014.04.26-15.27.33:142][ 97]LogWindows:Error: Error reentered: Runnable thread TaskGraphThread 0 crashed.
[2014.04.26-15.27.33:142][ 97]LogWindows:Error: HandleError re-entered.
[2014.04.26-15.27.33:142][ 97]LogWindows: FPlatformMisc::RequestExit(1)
[2014.04.26-15.27.33:142][ 97]Log file closed, 04/26/14 11:27:33

#Workaround

I am compelled to use a timer as a result

Hi Rama,

Would you be able to attach a callstack for this? I have an idea about the cause of this but I’d like to make sure. Thanks!

#Crash Vanishes

After reporting this issue I had disabled the Async scene (after enabling it upon receiving 4.1)

Now, I turned Async back on

and I am unable to reproduce the crash!

So regrettably yet happily I cannot provide you with further crash information.

It was quite the issue at the time, but some how just toggling Async scene a couple of times seems to have resolved it.

I have not modified the actual Static Mesh Actor class involved in all of this, in any non-crash related way!

I have tested with async on and off

#Thanks for taking the time Ori!

I will re-post if I can reproduce this again :slight_smile:

Rama

PS: I tried many times and even did the tests in a multiplayer context, and all seems well now :slight_smile:

Rama,

Do you know if any of the actors in your scene were previously marked as using the async scene? Destructible mesh for example used to go into the async scene by default.

After you switched the async scene setting did you save? I’m wondering if this is a backwards compatibility issue involving the async scene change.

Thanks for the info

“Do you know if any of the actors in your scene were previously marked as using the async scene? Destructible mesh for example used to go into the async scene by default.”

I was spawning destructible meshes, and also setting static mesh actors to use physics.

I was not encountering the crash when just loading my level, but not spawning anything and setting things to use physics.

Buuut

Yes I did save the level after changing async status.

#Thanks for checking this out!

I am happy this being addressed, though I dont know how to take it further any more!

Here’s another crash report I have that I feel is related to Async scene issues:

(unfortunately the above crash only happened once, but I’ve never seen it before 4.1)

#Resemblance

Here again the task graph is quite upset, as in this log.

#Thanks Ori!

:slight_smile:

Rama