View Issue Details

IDProjectCategoryView StatusLast Update
0002426NoesisGUIC++ SDKpublic2022-09-26 14:14
Reportersteveh Assigned Tosfernandez  
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
Product Version3.1 
Target Version3.1.6Fixed in Version3.1.6 
Summary0002426: Inifnite recursion causing be self binding in VisualTreeInspector.cpp
DescriptionHi guys,

One of our coders has identified an issue in the Visual Inspector tool caused by a "relative self" binding.

"Prevent self-referential infinite recursion causing stack overflow and game crash when a <custom control> is clicked on in the visual tree in the NoesisInspector.
This is caused by "<custom event>" event on "<custom control>" style, which has "Self" as CommandParameter."

This is the fix (between the comments). I've also uploaded a patch.

void NodeProperties_FromDependencyObject(Ptr<DependencyObject> depObject)
{
    Vector<const DependencyProperty*, 64> localProperties;
    VisualTreeInspectorHelper::RecursiveEnumerateProperties(depObject, [depObject, &localProperties](const DependencyProperty* property)
    {
        // SUMO:MT prevent self-referential infinite recursion
        if (property->GetValueObject(depObject) == depObject)
            return;
        // end

The crash was caused by adding a custom event into a style which has a binding to the self for the command parameter

        <Setter Property="Noesis:StyleInteraction.Triggers">
            <Setter.Value>
                <Noesis:StyleTriggerCollection>
                    <i:EventTrigger EventName="...">
                        <i:InvokeCommandAction
                            Command="{Binding ...}"
                            CommandParameter="{Binding RelativeSource={RelativeSource Mode=Self}}" />
                    </i:EventTrigger>
                </Noesis:StyleTriggerCollection>
            </Setter.Value>
        </Setter>
TagsNo tags attached.
PlatformAny

Activities

steveh

steveh

2022-09-20 18:51

reporter  

fix_recursive_overflow.diff (375 bytes)   
--- C:/Users/steveh/AppData/Local/Temp/VisualTreeInspector.cpp-revBASE.svn000.tmp.cpp	Wed Jul 13 19:32:24 2022
+++ Z:/NoesisArabic/Native/Src/Packages/Gui/Core/Src/VisualTreeInspector.cpp	Tue Sep 20 17:47:59 2022
@@ -1815,0 +1816,2 @@ void NodeProperties_FromDependencyObject(Ptr<Depen
+        if (property->GetValueObject(depObject) == depObject)
+            return;
fix_recursive_overflow.diff (375 bytes)   
jsantos

jsantos

2022-09-21 13:56

manager   ~0008076

Thanks for the report Steve!

Issue History

Date Modified Username Field Change
2022-09-20 18:51 steveh New Issue
2022-09-20 18:51 steveh File Added: fix_recursive_overflow.diff
2022-09-21 13:55 jsantos Assigned To => sfernandez
2022-09-21 13:55 jsantos Status new => assigned
2022-09-21 13:55 jsantos Product Version 3.2 => 3.1
2022-09-21 13:55 jsantos Target Version => 3.1.6
2022-09-21 13:56 jsantos Note Added: 0008076
2022-09-26 14:14 sfernandez Status assigned => resolved
2022-09-26 14:14 sfernandez Resolution open => fixed
2022-09-26 14:14 sfernandez Fixed in Version => 3.1.6