PropertyWatcher
PropertyWatcher copied to clipboard
access violation when reading name
FAView TempMemoryPool::NToA(FName Name) {
const FNameEntry* NameEntry = Name.GetDisplayNameEntry();
if (NameEntry->IsWide())
return "<WideFNameError>";
Error occurs at NameEntry->IsWide()
where the Name value shows Illegal name (block index out of range)_3
I guess the errs might be Ptr
or StructPtr
is invalid in the bellowing code.
FName PropertyItem::GetName() {
if (Type == PointerType::Property && Prop)
return Prop->GetFName();
if (Type == PointerType::Object && Ptr)
return ((UObject*)Ptr)->GetFName();
if (StructPtr && (Type == PointerType::Struct || Type == PointerType::Function))
return StructPtr->GetFName();
//return StructPtr->GetAuthoredName();
return NAME_None;
}
Thank you for the bug report! (And sorry for the crash.) I will look at it on the weekend at the latest. Is there an easy way for me to reproduce the crash? What kind of object did you look at in the watch window?
Thank you for the bug report! (And sorry for the crash.) I will look at it on the weekend at the latest. Is there an easy way for me to reproduce the crash? What kind of object did you look at in the watch window?
Thanks for your reply! I encountered this issue when clicking the properties of an actor deeply like a player state (I forget which type of actor it is), but I remember the issue property type is an Object
type, I fixed it myself with a TWeakObjectPtr
check when using PropertyItem::GetName()
function.
Interesting, we do check if a TWeakObjectPtr is stale before drawing it.
} else if (FWeakObjectProperty* WeakObjProp = CastField<FWeakObjectProperty>(Item.Prop)) {
TWeakObjectPtr<UObject>* WeakPtr = (TWeakObjectPtr<UObject>*)Item.Ptr;
if (WeakPtr->IsStale())
ImGui::Text("<Stale>");
if (!WeakPtr->IsValid())
ImGui::Text("<Null>");
else {
auto NewItem = MakeObjectItem(WeakPtr->Get());
DrawPropertyValue(NewItem);
}
Maybe it got destroyed while DrawPropertyValue happened? If that's possible I would have to restructure the code a bit, because currently only the raw object pointer gets passed down without the "weak" part. How did you fix it exactly?
Interesting, we do check if a TWeakObjectPtr is stale before drawing it.
} else if (FWeakObjectProperty* WeakObjProp = CastField<FWeakObjectProperty>(Item.Prop)) { TWeakObjectPtr<UObject>* WeakPtr = (TWeakObjectPtr<UObject>*)Item.Ptr; if (WeakPtr->IsStale()) ImGui::Text("<Stale>"); if (!WeakPtr->IsValid()) ImGui::Text("<Null>"); else { auto NewItem = MakeObjectItem(WeakPtr->Get()); DrawPropertyValue(NewItem); }
Maybe it got destroyed while DrawPropertyValue happened? If that's possible I would have to restructure the code a bit, because currently only the raw object pointer gets passed down without the "weak" part. How did you fix it exactly?
I fix it simply by when construting the PropertyItem
struct, add a TWeakObjectPtr
to watch if it is a uobject. When it comes to use the raw _Ptr
value, check it if valid.