Actor spawns with components already IsPendingKill?

I have a strange issue. Basically:
I spawn actor of class A. (Actor pre-placed in level)

I spawn ~20 instances of actor of class B (class B is largely unrelated to class A. Spawned via UWorld:SpawnActorAbsolute)

I delete instance of class A

I spawn instance of class A (Spawned via UWorld:SpawnActorAbsolute)
I spawn instance of class B (Spawned via UWorld:SpawnActorAbsolute)
On this last spawn, the actor of class B’s root component is spawning already IsPendingKill. (Output says “Trying to register component with IsPendingKill() == true. Aborting.” Callstack is:

UE4Editor-Engine.dll!UActorComponent::RegisterComponentWithWorld(UWorld * InWorld) Line 958 C++
UE4Editor-Engine.dll!AActor::IncrementalRegisterComponents(int NumComponentsToRegister) Line 4004 C++
UE4Editor-Engine.dll!AActor::RegisterAllComponents() Line 3940 C++
UE4Editor-Engine.dll!AActor::PostSpawnInitialize(const FTransform & UserSpawnTransform, AActor * InOwner, APawn * InInstigator, bool bRemoteOwned, bool bNoFail, bool bDeferConstruction) Line 2728 C++
UE4Editor-Engine.dll!UWorld::SpawnActor(UClass * Class, const FTransform * UserTransformPtr, const FActorSpawnParameters & SpawnParameters) Line 438 C++
UE4Editor-Engine.dll!UWorld::SpawnActorAbsolute(UClass * Class, const FTransform & AbsoluteTransform, const FActorSpawnParameters & SpawnParameters) Line 256 C++

All other components are OK, but the actor spawns with a messed up component hierarchy due to being missing its root.

Does anyone know of any circumstances which would cause a component to spawn IsPendingKill? This problem is being a real headache to debug due to IsPendingKill living in the global GUObjectArray a few thousand entries in, and IsPendingKill being just one flag in a bitwise array which the debugger doesn’t really know how to parse.

I know actors will spawn IsPendingKill if they spawn into collision, but this is just the one component. The component in question is a USceneComponent, so it doesn’t even have collision, and there shouldn’t be anything special going on with it. And dozens of instances of it spawned just prior without problem. It seems like my spawning of the other, unrelated actor is somehow messing it up, but I don’t even know in principle how that might be happening. This is part of some save/load work, so there are some UObjects being serialized, but all I’m saving are UProperties, and only some specific ones at that, so that shouldn’t be affecting the component’s IsPendingKillFlag.

I really just need some ideas for avenues of investigation, here. Anyone have any ideas for what could possibly be causing this?

If I had hair, I’d be pulling it out.
Went through and disabled pretty much everything I added, it still happens.
Tried updating to 4.15, still happens.
I verified that the component in question isn’t IsPendingKill on the CDO.

Whatever’s causing it, it’s happening instantly. I spawn the actor like so:

FActorSpawnParameters SpawnParameters = FActorSpawnParameters();
SpawnParameters.Name = SaveData.ObjectName;
SpawnParameters.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
AActor* NewActor = World->SpawnActor<AActor>(SaveData.ObjectClass, SpawnParameters);

The actor in question is a blueprint class which is a child of an abstract blueprint class, which inherits from a native actor class with this in its constructor:

MeshComponent = CreateDefaultSubobject<UStaticMeshComponent>("MeshComponent");
if (MeshComponent->IsPendingKill())
{
    UE_LOG(SaveLoad, Error, TEXT("%s: Spawned but IsPendingKill!"), *MeshComponent->GetPathName()); // <- this fires
}

So whatever is destroying the component is happening inside CreateDefaultSubobject. The problem is that I can’t seem to add breakpoints or watches in engine code, any more. I have 4.15’s debugging symbols, but as soon as I run in development or debug the breakpoints in engine code disable themselves with a “no symbols available for this document.”

After… many days of banging my head against this problem, I believe I’ve managed to figure it out.

What was happening was that the new actor was being spawned with the same name as an actor which had been destroyed but hadn’t been cleaned up, yet.

It looks like this was causing some confusion somewhere, resulting in the root component of the actor (and only the root component) being immediately marked pendingkill. Somewhere the GC or something must be referencing the root component of actors by name.

Thank you very much! I was struggling this for a couple of hours, not even seing a warning poping out. My prev actors weren’t on the scene for quite some time, and still it didn’t let me to spawn a new one. Today’s lesson" never put a static name when spawning actors.

I’m having a similar problem in UE4 4.18.3

I created a blueprint with base class SkeletalMeshActor and attached them to my VR Pawn capsule to be used as holsters for items. Problem is if you have more than one of these attached only one can create SkeletalMeshComponent and all others get this weird error:

CHILDACTOR_11.SkeletalMeshComponent0) Trying to register component with IsPendingKill() == true. Aborting.

Result is only how of these is truely create properly, all others fail to be constructed correctly. Does any one know how to fix this issue?

I had this problem too, and not trying to set a specific name for my Actor seems to fix it. I expect this might be down to the engine trying to cache and re-use components for actors with the same name?