Naming a NamedSlot inside another causes infinite loop and crash

  1. Create a UserWidget, let’s call it ParentWidget
  2. Inside Parent, create a NamedSlot, let’s call it ContentSlot
  3. Create another UserWidget, let’s call it ChildWidget
  4. Inside ChildWidget, add an instance of ParentWidget
  5. Inside the ContentSlot of ParentWidget, drag in a new NamedSlot
  6. Rename the new slot to “ContentSlot” (the same as its containing slot)
  7. Crash

The crash happens because of a stack overflow on UNamedSlot::OnSlotRemoved(UPanelSlot* InSlot).

UE4Editor-UMG.dll!UNamedSlot::OnSlotRemoved(UPanelSlot * InSlot) Line 92	C++
UE4Editor-UMG.dll!UPanelWidget::ClearChildren() Line 225	C++
UE4Editor-UMG.dll!UUserWidget::Initialize::__l5::<lambda>(UWidget * Widget) Line 112	C++
UE4Editor-UMG.dll!UWidgetTree::ForWidgetAndChildren<void <lambda>(UWidget *) >(UWidget * Widget, UUserWidget::Initialize::__l5::void <lambda>(UWidget *) Pred) Line 107	C++
UE4Editor-UMG.dll!UWidgetTree::ForWidgetAndChildren<void <lambda>(UWidget *) >(UWidget * Widget, UUserWidget::Initialize::__l5::void <lambda>(UWidget *) Pred) Line 101	C++
UE4Editor-UMG.dll!UWidgetTree::ForWidgetAndChildren<void <lambda>(UWidget *) >(UWidget * Widget, UUserWidget::Initialize::__l5::void <lambda>(UWidget *) Pred) Line 101	C++

Hello benhumphreys,

I was able to reproduce this issue on our end. I have written up a report and I have submitted it to developers for further consideration. I have provided a link to the public tracker. Please feel free to use the link provided for future updates.

Link: Unreal Engine Issues and Bug Tracker (UE-45109)

Make it a great day

Thanks so much Rudy!