x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Trash components cause UE4.10.1 crash

Recently I converted my project from 4.9 to 4.10.1, and always get crash every time when I closing a PIE session or closing blueprint window. This never happened in 4.9.

If I run PIE and stop, or open my blueprint and close it, the engine will crash in SceneComponent.cpp line 680:

checkf(ChildCount > AttachChildren.Num(), TEXT("AttachChildren count increased while detaching '%s', likely caused by OnAttachmentChanged introducing new children, which could lead to an infinite loop."), *Child->GetName());

I also found similar bug report, but I found more easily way and more information about this crash. https://answers.unrealengine.com/questions/336053/crash-on-closing-pie-or-bp.html

This bug can reproduce in blank UE4.10 and UE4.9 C++ project. However in UE4.9 only have incorrect behavior, but this incorrect behavior caused crash in UE4.10.

Reproduce steps: 1 Create a C++ class called MyBaseActor as the attached files shows link text.

2 Create a BP class MyFirstBPActor derived from MyBaseActor Add a variable "manager" which type is Actor.

3 Create a BP class DerivedBPActor derived from MyFirstBPActor

4 Create a BP Interface ActorManagerInterface which has 2 functions

 Briefly writting in C++ is:

 The one is DerivedBPActor FindActor( FName name );

 The other is bool ExecuteActor( DerivedBPActor );

 As ExecuteActor.png and FindActor.png shows.

alt text alt text

5 Edit Construction script in "both" DerivedBPActor and MyFirstBpActor:

 Add codes such like: (written in C++ like)

 out = manager->FindActor( "actorName" );

 bool success = manager->ExecuteActor( out );

 As NodesInDerivedBPActorAndMyFirstBPActor.png shows.

alt text

6 Compile all the class, save, and reopen UE4.

7 Open MyFirstBPActor and close it. It works fine.

8 Open DerivedBPActor and close it. It gets crash.

If we print children components of DerivedBPActor in ConstructionScript.

It shows 4 children components:

LogBlueprintUserMessages: [DerivedBPActor_C_0] Component nums: 4

LogBlueprintUserMessages: [DerivedBPActor_C_0] TRASH_Default__MyFirstBPActor_C_0.CapsuleComponent

LogBlueprintUserMessages: [DerivedBPActor_C_0] TRASH_Default__MyFirstBPActor_C_0.StaticMeshComponent

LogBlueprintUserMessages: [DerivedBPActor_C_0] DerivedBPActor_C_0.CapsuleComponent

LogBlueprintUserMessages: [DerivedBPActor_C_0] DerivedBPActor_C_0.StaticMeshComponent

The crash condition in this case (SceneComponent.cpp line 680) is

ChildCount=2 > AttachChildren.Num()=2, so the checkf fails.

It is because the parent of TRASH_Default__MyFirstBPActor_C_0.StaticMeshComponent is not DerivedBPActor->RootComponent.

Please let me know if you require more information. Thank you.

Product Version: UE 4.10
Tags:
more ▼

asked Dec 16 '15 at 06:18 PM in Bug Reports

avatar image

windkey
25 5 5 8

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hello,

Thank you for posting additional information regarding this issue. This bug exists in our system as UE-23366. I will update the report with the additional information you have provided.

Have a great day,

Sean Flint

more ▼

answered Dec 17 '15 at 03:47 PM

avatar image

Sean L ♦♦ STAFF
43.5k 485 152 443

avatar image windkey Dec 17 '15 at 04:30 PM

Because this problem cause me stop working. (Crash on everytime when stoping PIE is very hard for coding)

I almost take my full time to study the actor/component initialize flow.

Therefore, there are more detailed information and can not directly post here.

After today, I found the problem of this crash are related to:

  1. function AttachTo(RootComponent); on construction(const FObjectInitializer& ObjectInitializer) in C++ code.

  2. circular Dependency between blueprints (even if using blueprint Interface).

If staff of unreal engine wants more information, please post here or PM me, I will reply as soon as possible.

avatar image windkey Dec 22 '15 at 02:22 PM

Do you have any new information? Thank you.

avatar image Sean L ♦♦ STAFF Dec 22 '15 at 02:24 PM

Currently, this bug is still being investigated. I will post updates here as they become available. Thank you.

avatar image Chosker Jan 13 '16 at 04:43 PM

just checking in to inform, this still happens in 4.11 preview 2

avatar image Sean L ♦♦ STAFF Jan 13 '16 at 04:47 PM

I have created a new JIRA for this issue, as it is slightly different from the original issue which was reported as UE-23366 and fixed. The new JIRA is UE-25360.

avatar image Chosker Jan 13 '16 at 04:56 PM

do you know if this is being worked on for 4.11? i basically cannot work on my project

avatar image Ben Halliday STAFF Jan 13 '16 at 05:06 PM

Hi Chosker,

The Bug Report has been entered, and crash bugs usually get priority for developer investigation. It seems it's related to the first bug which was already fixed, so hopefully the cause of this crash can be found quickly. We cannot guarantee that anything will be fixed for any particular release, however, though the effort is being made.

For now, I would recommend continuing development in 4.9 if at all possible. If not, try other PIE methods (such as Standalone Game) to see if the same thing happens. Otherwise, you might need to utilize Launch functionality, though this can be time consuming. We apologize for the inconvenience.

avatar image Chosker Jan 13 '16 at 05:11 PM

the crash also occurs just by opening my main landscape map in the editor - so I can only work on my test map, so it's not just about launching the game.

btw I can't roll back to 4.9 without a lot of pain because I've already worked on plenty of stuff and re-saved it. my best option is really to wait for a fix and work on my UDK project in the meantime

avatar image Ben Halliday STAFF Jan 13 '16 at 05:14 PM

It might be worth entering a second Bug Report for the map crash. Can you paste the information from the Crash Reporter window when that occurs, including the Machine ID, and hit Send so we can look it up here and verify? If it's the same, I'd want to add that information to the existing report, and if not, I'd like to enter a second report. Thanks!

Again, I can't guarantee any fix will be implemented in 4.11's release. You're certainly welcome to wait, but it might be worth investing time in alternative solutions.

avatar image Marc Audy STAFF Jan 13 '16 at 09:12 PM

I debugged the provided project and determined that the problem is in how you are setting up the CameraBoom attachment, not with the engine code (well other than you can do this to yourself, but different thing).

In BaseCharacter.cpp you use AttachTo to set the attachment of the boom to the RootComponent, however, in EliumCharacter.cpp you simply set AttachParent directly. This is leaving an inconsistency between the AttachChildren array of the RootComponent (since it is added as a result of the AttachTo). When the RootComponent gets destroyed it tries to detach what it believes to be attached to it, however, since the SpringArm has already been detached when the character mesh was destroyed it ends up throwing the error.

I will look at whether we can be gentler in warning about this scenario rather than the assert, but in the mean time you are able to fix your own code by setting AttachParent (and AttachSocketName) in ABaseCharacter directly rather than using AttachTo.

In general AttachTo in constructors isn't safe, I will also be looking at finding a way to warn about that misuse as well.

avatar image Chosker Jan 14 '16 at 07:51 AM

thanks for the followup, this looks promising. I'll try to fix it on my end and report back

btw you might have noticed BaseCharacter.cpp is just the default ThirdPerson character cpp class, so...

In general AttachTo in constructors isn't safe, I will also be looking at finding a way to warn about that misuse as well.

you guys should really change the provided code then, because it is the thirdperson template code that comes with the AttachTo code in the constructor!

[edit]

apparently your solution works!

I just had to remove this line from my BaseCharacter.cpp:

 CameraBoom->AttachTo(RootComponent);

and the functionality is still working since like you mentioned, my child class already handles it like this:

 GetCameraBoom()->AttachParent = GetMesh();

it's all really shady because of what I mention above, but at least it works.

thanks!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question