UMG: Sometimes, stretching a text label causes a crash.

On at least two occassions now, I’ve repeated this crash. It happens when I am stretching the drawing size of a text label within the user interface designer.

File causing the crash: CanvasSlotCustomization.cpp

Method: GetOffsetLabel(TSharedPtr PropertyHandle, EOrientation Orientation, FText NonStretchingLabel, FText StretchingLabel)

Line #: 282

Cause: Trying to dereference a NULL Pointer

TArray<void*> RawData;
	PropertyHandle->AccessRawData(RawData); //<--- RawData contains 0x00000000

	FAnchorData* AnchorData = reinterpret_cast<FAnchorData*>( RawData[0] );

	const bool bStretching =
		( Orientation == Orient_Horizontal && AnchorData->Anchors.IsStretchedHorizontal() ) ||
		( Orientation == Orient_Vertical && AnchorData->Anchors.IsStretchedVertical() ); //<--Dereference crash

	return bStretching ? StretchingLabel : NonStretchingLabel;

The PropertyHandle has the following data passed in:

PropertyHandle Ptr=0x00000000524dc7d8, SharedRefs=5, WeakRefs=1, Object={Implementation=Ptr=0x000000005721b580, SharedRefs=1, WeakRefs=1, Object={PropertyNode=Ptr=0x0000000054197f00, SharedRefs=1, WeakRefs=6, Object={…} PropertyUtilities=Ptr=0x0000000031ec0e50, SharedRefs=80, WeakRefs=227, Object={…} …} } TSharedPtr<IPropertyHandle,0>
[SharedReferenceCount] 5 int
[WeakReferenceCount] 1 int
[Ptr] 0x00000000524dc7d8 void *

  •   [FPropertyHandleBase]	{Implementation=Ptr=0x000000005721b580, SharedRefs=1, WeakRefs=1, Object={PropertyNode=Ptr=0x0000000054197f00, SharedRefs=1, WeakRefs=6, Object={DisplayNameOverride=Empty ToolTipOverride=Empty } ...} }	UE4Editor-PropertyEditor.dll!FPropertyHandleBase
    
  •   __vfptr	0x000007fedbf1f6a8 {UE4Editor-PropertyEditor.dll!const FPropertyHandleBase::`vftable'} {0x000007fedbce7f00 {UE4Editor-PropertyEditor.dll!FPropertyHandleBase::`scalar deleting destructor'(unsigned int)}, ...}	void * *
    
  •   [Raw View]	0x00000000005ee0f8 {Object=0x00000000524dc7d8 {Implementation=Ptr=0x000000005721b580, SharedRefs=1, WeakRefs=1, Object={PropertyNode=Ptr=0x0000000054197f00, SharedRefs=1, WeakRefs=6, Object={...} PropertyUtilities=Ptr=0x0000000031ec0e50, SharedRefs=80, WeakRefs=227, Object={...} ...} } ...}	TSharedPtr<IPropertyHandle,0> *

Hello Slayemin,

I have a few questions that will help us narrow down what issue it is that you are experiencing.

Quick questions:

  1. What version of the engine are you using?
  2. Can you reproduce this issue in a clean project?
  3. If so, could you provide a detailed list of steps to reproduce this issue on our end?

Hey Rudy,

  1. I was using version 4.6.1 but yesterday I upgraded to 4.7.0
  2. I tried to create a new project but could not replicate the error anymore.
  3. If I get the crash again, I’ll resubmit with more details.

Out of curiosity, I looked at the method which was previously causing the error:
c:\users\eric\documents\visual studio 2013\projects\unrealengine\engine\source\editor\umgeditor\private\customizations\canvasslotcustomization.cpp

@ Line 275

It looks like it has been updated since 4.6.1, though there’s still no test to see if the AnchorData pointer is valid before dereferencing it. Probably a non-issue since I can’t reproduce the crash.

Hello Slayemin,

Thank you for the update. I am going to mark this as answered. However, if this issue occurs again please feel free to reopen this post with any additional information acquired and I will be more than happy to assist you further.

Make it a great day