# \[4.20\] Hierarchical Instanced Static Mesh crash in many ways if used in C++

**URL:** <https://forums.unrealengine.com/t/4-20-hierarchical-instanced-static-mesh-crash-in-many-ways-if-used-in-c/430203>\
**Category:** Asset Creation\
**Tags:** Hierarchical-Instanced-Static-Mesh, unreal-engine, crash, editor, question, CPP\
**Created:** [July 25, 2018, 9:15am UTC](https://forums.unrealengine.com/t/4-20-hierarchical-instanced-static-mesh-crash-in-many-ways-if-used-in-c/430203 "2018-07-25T09:15:47Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZioYuri78](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zioyuri78/32/1194615_2.png) [@ZioYuri78](https://forums.unrealengine.com/u/ZioYuri78)\
**Post date:** [July 25, 2018, 9:15am UTC](https://forums.unrealengine.com/t/4-20-hierarchical-instanced-static-mesh-crash-in-many-ways-if-used-in-c/430203/1 "2018-07-25T09:15:47Z")

</div>

* * *

[Issue UE-62282.](https://issues.unrealengine.com/issue/UE-62282)

* * *

Hey all,

my HISM component crash all the time and for many reason, this happen if i add an instance or when i set the static mesh, also happen if i clean instances, it’s hard to understand which of this trigger the crash but they all have the same crash report:

* * *

_Assertion failed: (void_)((&ElementData[InstanceIndex])

- 
  1. \<= (void\*)(InstanceOriginDataPtr + CurrentSize) [File:D:\Build++UE4\Sync\Engine\Source\Runtime\Engine\Public\StaticMeshResources.h] [Line: 1231]

UE4Editor\_Core!FDebug::AssertFailed() [d:\build++ue4\sync\engine\source\runtime\core\private\misc\assertionmacros.cpp:425]

UE4Editor\_Engine!FStaticMeshInstanceBuffer::UpdateFromCommandBuffer\_RenderThread() [d:\build++ue4\sync\engine\source\runtime\engine\private\instancedstaticmesh.cpp:189]

UE4Editor\_Engine!TGraphTask::ExecuteTask() [d:\build++ue4\sync\engine\source\runtime\core\public\async\taskgraphinterfaces.h:829]

UE4Editor\_Core!FNamedTaskThread::ProcessTasksNamedThread() [d:\build++ue4\sync\engine\source\runtime\core\private\async\taskgraph.cpp:665]

UE4Editor\_Core!FNamedTaskThread::ProcessTasksUntilQuit() [d:\build++ue4\sync\engine\source\runtime\core\private\async\taskgraph.cpp:574]

UE4Editor\_RenderCore!RenderingThreadMain() [d:\build++ue4\sync\engine\source\runtime\rendercore\private\renderingthread.cpp:333]

UE4Editor\_RenderCore!FRenderingThread::Run() [d:\build++ue4\sync\engine\source\runtime\rendercore\private\renderingthread.cpp:467]

UE4Editor\_Core!FRunnableThreadWin::Run() [d:\build++ue4\sync\engine\source\runtime\core\private\windows\windowsrunnablethread.cpp:76]

* * *

looks like something when wrong with rendering.

This it’s a blocker for me and i have to come back on 4.19 (thanks god i have a backup of the project).

EDIT:

Step to reproduce:

1. Open a new C++ project

2. Create an Actor class

3. Add an Hierarchical Instanced Static Mesh Component

4. Do some operations on it (like add a bunch of instances OnConstruction or BeginPlay)

5. Launch the editor and drop your actor in the level

6. If you are lucky and it’s not crashed yet try to set the component static mesh.

as i said sometime happen when you clean or add instances (80% of time if used in OnConstruction) or when you set the static mesh (100% both OnConstruction and BeginPlay in my test behaviour).

---

<div class="post-metadata">

**Author:** ![Jeff\_A](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jeff\_A](https://forums.unrealengine.com/u/Jeff_A)\
**Post date:** [July 25, 2018, 9:04pm UTC](https://forums.unrealengine.com/t/4-20-hierarchical-instanced-static-mesh-crash-in-many-ways-if-used-in-c/430203/2 "2018-07-25T21:04:59Z")

</div>

Hello,

We’ve recently made a switch to a new bug reporting method using a more structured form. Please visit the link below for more details and report the issue using the new Bug Submission Form. Feel free to continue to use this thread for community discussion around the issue.

[https://epicsupport.force.com/unrealengine/s/](https://epicsupport.force.com/unrealengine/s/)

Thanks

---

<div class="post-metadata">

**Author:** ![ZioYuri78](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zioyuri78/32/1194615_2.png) [@ZioYuri78](https://forums.unrealengine.com/u/ZioYuri78)\
**Post date:** [July 26, 2018, 12:56pm UTC](https://forums.unrealengine.com/t/4-20-hierarchical-instanced-static-mesh-crash-in-many-ways-if-used-in-c/430203/3 "2018-07-26T12:56:00Z")

</div>

I’m sorry, i forgot that there is the new form for bug reports, thanks for the heads up.

---

<div class="post-metadata">

**Author:** ![redbox](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@redbox](https://forums.unrealengine.com/u/redbox)\
**Post date:** [July 29, 2018, 6:40pm UTC](https://forums.unrealengine.com/t/4-20-hierarchical-instanced-static-mesh-crash-in-many-ways-if-used-in-c/430203/4 "2018-07-29T18:40:13Z")

</div>

Have the same problem. Constantly crashes when I try to set mesh property or duplicate actor with mesh already set into HISMComponent.

In Log

```
[2018.07.29-18.31.07:110][0]LogWindows: Error: Assertion failed: (void*)((&ElementData[InstanceIndex]) + 1) <= (void*)(InstanceOriginDataPtr + CurrentSize) [File:D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Public\StaticMeshResources.h] [Line: 1231] 

```

Also for Blueprints version of actor with HISMComponent I have another log

```
[2018.07.29-18.31.06:219][0]LogLinker: Warning: Unable to load PhysicsSerializer with outer HierarchicalInstancedStaticMeshComponent /Game/Environment/Procedural/BP_Proc_Base.BP_Proc_Base_C:HierarchicalInstancedStaticMesh_GEN_VARIABLE because its class does not exist
```

---

<div class="post-metadata">

**Author:** ![ZioYuri78](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zioyuri78/32/1194615_2.png) [@ZioYuri78](https://forums.unrealengine.com/u/ZioYuri78)\
**Post date:** [July 30, 2018, 12:01am UTC](https://forums.unrealengine.com/t/4-20-hierarchical-instanced-static-mesh-crash-in-many-ways-if-used-in-c/430203/5 "2018-07-30T00:01:35Z")

</div>

I submitted the issue with the new bug report form, they have replicated the problem [Unreal Engine Issues and Bug Tracker (UE-62282)](https://issues.unrealengine.com/issue/UE-62282)

---

<div class="post-metadata">

**Author:** ![Matthieu\_Gouby](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Matthieu\_Gouby](https://forums.unrealengine.com/u/Matthieu_Gouby)\
**Post date:** [August 22, 2018, 5:27pm UTC](https://forums.unrealengine.com/t/4-20-hierarchical-instanced-static-mesh-crash-in-many-ways-if-used-in-c/430203/6 "2018-08-22T17:27:12Z")

</div>

I had this warning too and fix it by renaming my InstancedStaticMeshComponent.

---

<div class="post-metadata">

**Author:** ![Vaei](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/vaei/32/710746_2.png) [@Vaei](https://forums.unrealengine.com/u/Vaei)\
**Post date:** [October 3, 2018, 7:19am UTC](https://forums.unrealengine.com/t/4-20-hierarchical-instanced-static-mesh-crash-in-many-ways-if-used-in-c/430203/7 "2018-10-03T07:19:55Z")

</div>

I was able to fix this by normalizing the transform rotation in the two places that it uses ToMatrixWithScale, we will test internally then PR if nothing is wrong.

---

<div class="post-metadata">

**Author:** ![Vaei](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/vaei/32/710746_2.png) [@Vaei](https://forums.unrealengine.com/u/Vaei)\
**Post date:** [October 5, 2018, 10:59am UTC](https://forums.unrealengine.com/t/4-20-hierarchical-instanced-static-mesh-crash-in-many-ways-if-used-in-c/430203/8 "2018-10-05T10:59:08Z")

</div>

Please remove the bug report from this post. It has nothing to do with it. Look at the crash log; `Assertion failed: IsRotationNormalized()` ; The crash is clearly shown to be different in the thread `Assertion failed: (void)((∈Data[InstanceIndex]) + 1) <= (void*)(InstanceOriginDataPtr + CurrentSize) ` . I’ve fixed the one in the bug report but the one in the thread is much more severe and undecipherable but anyone who didn’t write it.  
I made a forum thread here: [Engine bug related to HISM / Foliage Spawners causing map/tile corruption - Engine Source & GitHub - Unreal Engine Forums](https://forums.unrealengine.com/development-discussion/engine-source-github/1535980-engine-bug-related-to-hism-hierarchical-instanced-static-mesh-causing-map-tile-corruption)

---

<div class="post-metadata">

**Author:** ![ZioYuri78](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zioyuri78/32/1194615_2.png) [@ZioYuri78](https://forums.unrealengine.com/u/ZioYuri78)\
**Post date:** [October 5, 2018, 11:59am UTC](https://forums.unrealengine.com/t/4-20-hierarchical-instanced-static-mesh-crash-in-many-ways-if-used-in-c/430203/9 "2018-10-05T11:59:04Z")

</div>

No, this bug report was sent to me from Epic after my bug submission,

> Hello Yuri,
> 
> I have reproduced this issue and  
> logged a report for it here  
> [Unreal Engine Issues and Bug Tracker (UE-62282)](https://issues.unrealengine.com/issue/UE-62282).  
> You can track the report’s status as  
> the issue is reviewed by our  
> development staff. Please let us know  
> if you have any other questions about  
> this issue, or would like to discuss  
> how you may be able to fix this  
> yourself if this is urgent for your  
> project.

also the crash log change from test to test here, there is more than one problem with HISM.

---

<div class="post-metadata">

**Author:** ![Vaei](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/vaei/32/710746_2.png) [@Vaei](https://forums.unrealengine.com/u/Vaei)\
**Post date:** [October 5, 2018, 12:00pm UTC](https://forums.unrealengine.com/t/4-20-hierarchical-instanced-static-mesh-crash-in-many-ways-if-used-in-c/430203/10 "2018-10-05T12:00:55Z")

</div>

Regardless, the bug report is irrelevant to this thread. That ones an easy fix. Normalize the transform rotation.  
The actual bug still is unreported and significantly more obscure.  
Maybe reply and notify epic?

---

<div class="post-metadata">

**Author:** ![Vaei](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/vaei/32/710746_2.png) [@Vaei](https://forums.unrealengine.com/u/Vaei)\
**Post date:** [October 5, 2018, 8:45pm UTC](https://forums.unrealengine.com/t/4-20-hierarchical-instanced-static-mesh-crash-in-many-ways-if-used-in-c/430203/11 "2018-10-05T20:45:47Z")

</div>

For the record, your reproduction steps never result in the crash in this thread once I fix the one in the PR. So there’s still no bug report for this one and no reproduction steps for it either.

---

<div class="post-metadata">

**Author:** ![Vaei](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/vaei/32/710746_2.png) [@Vaei](https://forums.unrealengine.com/u/Vaei)\
**Post date:** [October 6, 2018, 12:01am UTC](https://forums.unrealengine.com/t/4-20-hierarchical-instanced-static-mesh-crash-in-many-ways-if-used-in-c/430203/12 "2018-10-06T00:01:54Z")

</div>

@ZioYuri78 do you use Speed Tree in the project this crash occurs in? The answerhub crash not the bug report crash.

---

<div class="post-metadata">

**Author:** ![Vaei](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/vaei/32/710746_2.png) [@Vaei](https://forums.unrealengine.com/u/Vaei)\
**Post date:** [October 6, 2018, 2:33am UTC](https://forums.unrealengine.com/t/4-20-hierarchical-instanced-static-mesh-crash-in-many-ways-if-used-in-c/430203/13 "2018-10-06T02:33:01Z")

</div>

Questioning if it’s even a bug. It only occurs when passing a non-normalized rotation, which rather makes sense when expecting a direction. Otherwise what would you expect to happen. Feel like it’s a huge distraction from the actual bug.

---

<div class="post-metadata">

**Author:** ![redbox](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@redbox](https://forums.unrealengine.com/u/redbox)\
**Post date:** [October 6, 2018, 3:54am UTC](https://forums.unrealengine.com/t/4-20-hierarchical-instanced-static-mesh-crash-in-many-ways-if-used-in-c/430203/14 "2018-10-06T03:54:19Z")

</div>

Simp)e implementation was fine in 4.19, and started crashing in 4.20, so yes, it is definitely a bug.

I didn’t checked it after last hotfix, but I will.

---

<div class="post-metadata">

**Author:** ![ZioYuri78](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zioyuri78/32/1194615_2.png) [@ZioYuri78](https://forums.unrealengine.com/u/ZioYuri78)\
**Post date:** [October 6, 2018, 9:33am UTC](https://forums.unrealengine.com/t/4-20-hierarchical-instanced-static-mesh-crash-in-many-ways-if-used-in-c/430203/15 "2018-10-06T09:33:51Z")

</div>

Nope, i literally did the steps i write in op, create the component, add a bunch of instances, drop in the level, crash.

---

<div class="post-metadata">

**Author:** ![ZioYuri78](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zioyuri78/32/1194615_2.png) [@ZioYuri78](https://forums.unrealengine.com/u/ZioYuri78)\
**Post date:** [October 6, 2018, 9:34am UTC](https://forums.unrealengine.com/t/4-20-hierarchical-instanced-static-mesh-crash-in-many-ways-if-used-in-c/430203/16 "2018-10-06T09:34:47Z")

</div>

Ok, i becoming confused now, what i have to do? Remove the link to the bug report and send another one?

---

<div class="post-metadata">

**Author:** ![Vaei](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/vaei/32/710746_2.png) [@Vaei](https://forums.unrealengine.com/u/Vaei)\
**Post date:** [October 6, 2018, 9:35am UTC](https://forums.unrealengine.com/t/4-20-hierarchical-instanced-static-mesh-crash-in-many-ways-if-used-in-c/430203/17 "2018-10-06T09:35:31Z")

</div>

No one on my team can reproduce the bug using the steps shown. Only the one in the bug report.

---

<div class="post-metadata">

**Author:** ![Vaei](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/vaei/32/710746_2.png) [@Vaei](https://forums.unrealengine.com/u/Vaei)\
**Post date:** [October 6, 2018, 10:31pm UTC](https://forums.unrealengine.com/t/4-20-hierarchical-instanced-static-mesh-crash-in-many-ways-if-used-in-c/430203/18 "2018-10-06T22:31:16Z")

</div>

I was able to load the tile by updating the HISM code to master (4.22) and removing the checks, however the result is as the check suggests; the instanced meshes are corrupted. Know when your GPU overheats and you get strange vertex stretching? ([See images in this thread](https://forum.facepunch.com/f/hwsw/bgwok/Random-polygons-on-models-stretch-across-a-range-of-games/1/)) - it looks like the foliage is doing a similar thing. So basically the bug is vertex corruption in instanced static meshes, only with foliage (based on the few reports we have). The actual check failing is not a bug.

Unfortunately this means we basically hope Epic inadvertently fix the issue at some point. They might already have done so.

[More info in my thread here](https://forums.unrealengine.com/development-discussion/engine-source-github/1535980-engine-bug-related-to-hism-foliage-spawners-causing-map-tile-corruption), especially later posts

---

<div class="post-metadata">

**Author:** ![redbox](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@redbox](https://forums.unrealengine.com/u/redbox)\
**Post date:** [October 7, 2018, 9:04am UTC](https://forums.unrealengine.com/t/4-20-hierarchical-instanced-static-mesh-crash-in-many-ways-if-used-in-c/430203/19 "2018-10-07T09:04:47Z")

</div>

In 4.20.3 my case is still reproduced.

```
[2018.10.07-09.03.56:311][311]LogWindows: Error: Fatal error: [File:D:\Build\++UE4\Sync\Engine\Source\Runtime\RenderCore\Private\RenderingThread.cpp] [Line: 826] 
[2018.10.07-09.03.56:311][311]LogWindows: Error: Rendering thread exception:
[2018.10.07-09.03.56:311][311]LogWindows: Error: Assertion failed: (void*)((&ElementData[InstanceIndex]) + 1) <= (void*)(InstanceOriginDataPtr + CurrentSize) [File:D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Public\StaticMeshResources.h] [Line: 1231]
```

---

<div class="post-metadata">

**Author:** ![redbox](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@redbox](https://forums.unrealengine.com/u/redbox)\
**Post date:** [October 11, 2018, 5:04pm UTC](https://forums.unrealengine.com/t/4-20-hierarchical-instanced-static-mesh-crash-in-many-ways-if-used-in-c/430203/20 "2018-10-11T17:04:04Z")

</div>

I have another crash in implementation with blueprints. It also related to mesh component, so every time I try to set mesh, I get this:

```
[2018.10.11-16.57.26:920][777]LogWindows: Error: Assertion failed: InstancingRandomSeed != 0 [File:D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\HierarchicalInstancedStaticMesh.cpp] [Line: 2785] 

```

Guys, this is really critical stuff! 4.20 already had 3 hotfixes, and all of them didn’t has fixes for HISM Components troubles!

HISM functionality is very important part of engine to ignore this bugs!

[Next page](https://forums.unrealengine.com/t/4-20-hierarchical-instanced-static-mesh-crash-in-many-ways-if-used-in-c/430203.md?page=2)
