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"

Frequent crashes in SetHitResultFromShapeAndFaceIndex

After migration to 4.18 we are experiencing frequent crashes in SetHitResultFromShapeAndFaceIndex as a result of calls to LineTraceSingleByChannel from our code. The same game codebase runs fine on 4.17.2.

The crash happens in release 4.18.0 as well as latest code from 4.18 branch (as built on 02.11.2017) - the stack trace provided is from the latter.

The parameters passed in the LineTraceSingleByChannel are valid.

In the exception point OwningComponent is nullptr.

BlahGame.exe!SetHitResultFromShapeAndFaceIndex(const physx::PxShape PShape, const physx::PxRigidActor PActor, const unsigned int FaceIndex, FHitResult & OutResult, bool bReturnPhysMat) Line 379

BlahGame.exe!ConvertQueryImpactHit(const UWorld World, const physx::PxLocationHit & PHit, FHitResult & OutResult, float CheckLength, const physx::PxFilterData & QueryFilter, const FVector & StartLoc, const FVector & EndLoc, const physx::PxGeometry const Geom, const physx::PxTransform & QueryTM, bool bReturnFaceIndex, bool bReturnPhysMat) Line 51

BlahGame.exe!RaycastSingle(const UWorld * World, FHitResult & OutHit, const FVector Start, const FVector End, ECollisionChannel TraceChannel, const FCollisionQueryParams & Params, const FCollisionResponseParams & ResponseParams, const FCollisionObjectQueryParams & ObjectParams) Line 589

BlahGame.exe!UWorld::LineTraceSingleByChannel(FHitResult & OutHit, const FVector & Start, const FVector & End, ECollisionChannel TraceChannel, const FCollisionQueryParams & Params, const FCollisionResponseParams & ResponseParam) Line 87

link text

Product Version: UE 4.18
crashcontext.zip (5.5 kB)
more ▼

asked Nov 03 '17 at 01:52 PM in Bug Reports

avatar image

21 3 7

avatar image Matthew J Nov 03 '17 at 05:41 PM


Does this happen with particular assets? As in, does it only happen when the line trace hits certain actors? Are you able to reproduce this in a fresh project? If so, could you provide reproduction steps? If not, can you try running through the crash using a debugger, preferably setting a break point on the line trace itself and stepping into the start of SetHitResultFromShapeAndFaceIndex and seeing where the NULL appears? On the line before the crash, OwningComponent is supposed to be set to CustomPayload->GetOwningComponent().Get(); but it seems like that may be what is returning NULL.

avatar image wjakobczyk Nov 06 '17 at 12:09 PM

Hi, This seems to be related to destructible mesh - so far happens only when CustomPayload->OwningComponent is UDestructibleComponent.

The situation is as follows:

  • CustomPayload->OwningComponent seems to be ok, pointing to a valid component in the scene.

  • though the call CustomPayload->GetOwningComponent().Get() returns nullptr

  • it seems that FWeakObjectPtr::Internal_IsValid returns false, though I couldn't find which of the conditions failes - this is inline code, tried to follow in assembly and for sure it's not the first 3 conditions, then I lose track a bit :)

Hopefully that helps.

One more detail - so far the crash happened only on a client in networked play.

avatar image Matthew J Nov 06 '17 at 05:47 PM

This seems to require a particular setup, after your mention of destructibles and it only happening on a client. Would it be possible for you to provide a reproduction project?

avatar image wjakobczyk Nov 07 '17 at 03:49 PM

I'm afraid I won't find time to prepare a fresh project for that anytime soon, though I can help in testing any candidate fixes.

avatar image eric.ellis Nov 08 '17 at 03:02 AM

We are seeing this too, not on a client, but with destructibles.

The reason CustomPayload->GetOwningComponent().Get() fails in the case I'm seeing is because the owning component is pending kill.

We also are experiencing another PhysX-related 4.18 crash which occurs because there is now a large delay between fetchResults and further processing of those results for async scene actors, during which time the destructible actors may be destroyed. This seems suspiciously similar enough to likely be related, but I haven't yet had time to track down exactly how.

avatar image wjakobczyk Nov 08 '17 at 06:35 AM

Great! Looking forward a fix...

avatar image Matthew J Nov 16 '17 at 07:58 PM

Unfortunately, without a reproduction of some sort, I cannot place a bug in for the issue and there will not be a fix entered for it. You may be able to use the workaround provided by poke1103 but if you are unable to assist with reproducing this issue, we will not be able to proceed.

avatar image Phyronnaz Dec 09 '17 at 05:51 PM

I'm able to reproduce it: https://drive.google.com/open?id=1LKrC-3xFgBAw_smrLBdwWsmzhOdbdrKT

  • Create a new ThirdPersonBP project

  • Enable APEX plugin

  • Create a destructible mesh from the default sphere mesh

  • Create a blueprint from it

  • Set Collision/UseCCD, Collision/SimulationGeneratesHitEvent and Physics/SimulatePhysics to true

  • Implement Events/OnComponentHit: https://blueprintue.com/blueprint/swpx6vg_/

  • Create a new PlayerController and spawn sphere blueprint above player: https://blueprintue.com/blueprint/puwsbkqs/

  • Create a new default map, set floor scale to (1000, 1000, 1) and the player controller to the new controller

  • Play

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

2 answers: sort voted first

Hello Phyronnaz,

Thank you for that reproduction case. I reproduced the issue in 4.18.2 but it seems that this has already been fixed in our latest internal version, so I will not be entering a bug report for this, as that fix will likely be present in 4.19.

Have a nice day!

more ▼

answered Dec 12 '17 at 06:21 PM

avatar image Xilverback Jan 25 '18 at 05:59 PM

I'm having the problem too. Was it fixed in 4.18.3?

avatar image Phyronnaz Jan 25 '18 at 06:00 PM
avatar image Mingah Feb 02 '18 at 12:52 PM

You worked around it Phyronnaz?

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


I changed my code to have if (OwningComponent) {} around the code and now it works. I'm not sure if it will harm anything though.

more ▼

answered Nov 09 '17 at 10:53 PM

avatar image

20 1 6 17

(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