View Issue Details

IDProjectCategoryView StatusLast Update
0001595NoesisGUIUnity3Dpublic2020-09-22 19:56
ReporterstonstadAssigned Tosfernandez 
PrioritynormalSeveritycrashReproducibilityrandom
Status resolvedResolutionno change required 
Product Version2.2.5 
Target Version3.0.6Fixed in Version3.0.6 
Summary0001595: DispatcherObject_GetStaticType Access Violation
DescriptionRead from location 0000000000000010 caused an access violation.

Stack Trace of Crashed Thread 9840:
0x00007FFCF2217EB6 (Noesis) DispatcherObject_GetStaticType
0x00007FFCF22159BD (Noesis) DependencyObject_GetStaticType
0x00007FFCF224BA12 (Noesis) DataObjectPastingEventArgs_GetDataObjectHelper
0x00007FFCF24035A8 (Noesis) ContentControl_ToStringHelper
0x000002A09760910C (Assembly-CSharp) Noesis.NoesisGUI_PINVOKE.ContentControl_ToStringHelper()
0x000002A097608EF3 (Assembly-CSharp) Noesis.ContentControl.ToStringHelper()
0x000002A097608DAB (Assembly-CSharp) Noesis.ContentControl.ToString()

I believe Visual Studio's debugger called ToString() on a content control, which resulted in this crash.
TagsNo tags attached.
PlatformAny

Activities

stonstad

stonstad

2019-12-05 20:02

reporter  

Crash_2019-12-05_185745060.zip (1,361,624 bytes)
sfernandez

sfernandez

2019-12-18 14:49

manager   ~0006041

Could you please provide a bit of scope to understand what could be happening?
I see the crash originates from [SkillsScreen.cs:249] StellarConquest.Presentation.Unity.UI.SkillsScreen:Build().
What Noesis code is being called there? because the crash dump says a ContentControl instance representing a null object is being used, and that makes no sense to me.
stonstad

stonstad

2019-12-18 15:52

reporter   ~0006042

Last edited: 2019-12-18 15:52

View 2 revisions

This crash happened while execution was paused. I had breakpoints set and I was reviewing code in Visual Studio. I was in this code block:

   public override void OnUpdate()
        {
            _SkillPointsTextBlock.Text = SessionState.Instance.Player.AvailableSkillPoints + " Points";

            _WrapPanel.Children.Clear();
            List<BaseSkill> skills = Starpedia.Skills.OrderBy(a => a.TypeName).ToList();
            for (int i = 0; i < skills.Count; i++)
            {
                BaseSkill skill = skills[i];
                bool isSkillLearned = false;
                if (SessionState.Instance.Player.Skills.TryGetValue(skill.TypeId, out BaseSkill playerSkill))
                {
                    isSkillLearned = true;
                    skill = playerSkill;
                }

                Grid rootGrid = new Grid();

                rootGrid.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Auto) });
                rootGrid.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) });
                rootGrid.Margin = new Thickness(5, 5, 5, 5);
                rootGrid.Width = 400;

                Image containerImage = new Image() { Width = 96, Height = 96 };
                containerImage.Margin = new Thickness(10, 0, 20, 0);
                containerImage.VerticalAlignment = VerticalAlignment.Top;
                containerImage.Source = UIUtility.GetImageSource(_Root, "skill_image_container");
                rootGrid.Children.Add(containerImage);
                Grid.SetColumn(containerImage, 0);

                if (isSkillLearned)
                {
                    Image trainedImage = new Image() { Width = 96, Height = 96 };
                    trainedImage.Margin = new Thickness(10, 0, 20, 0);
                    trainedImage.VerticalAlignment = VerticalAlignment.Top;
                    trainedImage.Source = UIUtility.GetImageSource(_Root, "skill_image_trained");
                    rootGrid.Children.Add(trainedImage);
                    Grid.SetColumn(trainedImage, 0);
                }

                Image bwImage = new Image() { Width = 96, Height = 96 };
                bwImage.Margin = new Thickness(10, 0, 20, 0);
                bwImage.VerticalAlignment = VerticalAlignment.Top;
                bwImage.Source = UIUtility.GetImageSource(_Root, skill.ThumbImageUrl + "_bw");
                rootGrid.Children.Add(bwImage);
                Grid.SetColumn(bwImage, 0);
                if (isSkillLearned)
                    bwImage.Visibility = Visibility.Collapsed;

                Image colorImage = new Image() { Width = 96, Height = 96 };
                colorImage.Margin = new Thickness(10, 0, 20, 0);
                colorImage.VerticalAlignment = VerticalAlignment.Top;
                colorImage.Source = UIUtility.GetImageSource(_Root, skill.ThumbImageUrl);
                rootGrid.Children.Add(colorImage);
                Grid.SetColumn(colorImage, 0);
                if (!isSkillLearned)
                    colorImage.Visibility = Visibility.Collapsed;


                Grid rightColumnGrid = new Grid();
                rightColumnGrid.Margin = new Thickness(0, 0, 0, 10);
                rightColumnGrid.HorizontalAlignment = HorizontalAlignment.Stretch;
                rightColumnGrid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) });
                rightColumnGrid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Auto) });
                rightColumnGrid.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(1, GridUnitType.Auto) }); // title
                rightColumnGrid.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(1, GridUnitType.Auto) }); // description
                rightColumnGrid.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(1, GridUnitType.Auto) }); // modifier
                rootGrid.Children.Add(rightColumnGrid);
                Grid.SetColumn(rightColumnGrid, 1);

                TextBlock title = new TextBlock();
                title.Margin = new Thickness(0, 5, 0, 0);
                title.Style = (Style)_Root.FindResource("Heading5Primary");
                title.Text = skill.TypeName;
                rightColumnGrid.Children.Add(title);
                Grid.SetRow(title, 0);
                Grid.SetColumn(title, 0);

                if (isSkillLearned && skill.Levels > 0)
                {
                    StackPanel skillLevelStackPanel = new StackPanel();
                    skillLevelStackPanel.VerticalAlignment = VerticalAlignment.Top;
                    skillLevelStackPanel.LayoutTransform = new ScaleTransform(0.5f, 0.5f);
                    skillLevelStackPanel.Margin = new Thickness(0, 0, 9, -8);
                    skillLevelStackPanel.Orientation = Orientation.Horizontal;
                    rightColumnGrid.Children.Add(skillLevelStackPanel);
                    Grid.SetRow(skillLevelStackPanel, 0);
                    Grid.SetColumn(skillLevelStackPanel, 1);

                    for (int j = 1; j <= skill.Levels; j++)
                    {
                        Image image = new Image();
                        image.ToolTip = "Level [" + skill.Level.ToString() + " / " + skill.Levels.ToString() + "]";
                        if (skill.Level >= j)
                        {
                            image.Source = UIUtility.GetImageSource(_Root, "skill_level_on");
                            image.Width = 22;
                            image.Height = 47;
                        }
                        else
                        {
                            image.Source = UIUtility.GetImageSource(_Root, "skill_level_off");
                            image.Margin = new Thickness(4, 4, 4, 4);
                            image.Width = 14;
                            image.Height = 39;
                        }

                        skillLevelStackPanel.Children.Add(image);
                    }

                }

                TextBlock description = new TextBlock();
                description.VerticalAlignment = VerticalAlignment.Top;
                description.Margin = new Thickness(0, 5, 0, 0);
                description.Style = (Style)_Root.FindResource("Heading5Secondary");
                if (!string.IsNullOrEmpty(skill.TypeDescription))
                    description.Text = skill.TypeDescription;
                description.TextWrapping = TextWrapping.Wrap;
                rightColumnGrid.Children.Add(description);
                Grid.SetRow(description, 1);
                Grid.SetColumnSpan(description, 2);

                if (isSkillLearned && !string.IsNullOrEmpty(skill.ModifierDescription))
                {
                    TextBlock modifier = new TextBlock();
                    modifier.VerticalAlignment = VerticalAlignment.Top;
                    modifier.Margin = new Thickness(0, 5, 0, 0);
                    modifier.Style = (Style)_Root.FindResource("Heading5Secondary");
                    modifier.Text = skill.ModifierDescription + " " + skill.ModifierValueString;
                    modifier.TextWrapping = TextWrapping.Wrap;
                    rightColumnGrid.Children.Add(modifier);
                    Grid.SetRow(modifier, 2);
                    Grid.SetColumnSpan(modifier, 2);
                }


                rootGrid.Margin = new Thickness(0, 8, 0, 8);
                ItemControl button = new ItemControl();
                button.Tag = skill.Category;
                button.Name = skill.TypeName;
                button.Add(rootGrid);

                button.Button.Click += (sender, e) =>
                {
                    IActionProvider actionProvider = skill as IActionProvider;
                    UIUtility.ShowActions(_Root, actionProvider);
                };

                _WrapPanel.Children.Add(button);
            }

            ApplyFilter();
        }

Not 100% certain, but I believe I was inspecting the children property of WrapPanel. I see that this code was executed -- Noesis.ContentControl.ToString().

stonstad

stonstad

2020-09-22 19:40

reporter   ~0006643

Sergio -- I am not seeing this error. Granted, I don't open the VS inspector on Noesis object hierarchies very often. Please feel free to close on account of it no longer happening.

Issue History

Date Modified Username Field Change
2019-12-05 20:02 stonstad New Issue
2019-12-05 20:02 stonstad File Added: Crash_2019-12-05_185745060.zip
2019-12-16 18:50 sfernandez Assigned To => sfernandez
2019-12-16 18:50 sfernandez Status new => assigned
2019-12-16 18:50 sfernandez Target Version => 2.2.6
2019-12-16 18:50 sfernandez Description Updated View Revisions
2019-12-18 14:49 sfernandez Status assigned => feedback
2019-12-18 14:49 sfernandez Note Added: 0006041
2019-12-18 15:52 stonstad Note Added: 0006042
2019-12-18 15:52 stonstad Status feedback => assigned
2019-12-18 15:52 stonstad Note Edited: 0006042 View Revisions
2020-02-28 11:22 sfernandez Target Version 2.2.6 => 3.0.0
2020-05-25 10:58 jsantos Target Version 3.0.0 => 3.0
2020-09-22 19:40 stonstad Note Added: 0006643
2020-09-22 19:56 sfernandez Status assigned => resolved
2020-09-22 19:56 sfernandez Resolution open => no change required
2020-09-22 19:56 sfernandez Fixed in Version => 3.0.6
2020-09-22 19:56 sfernandez Target Version 3.0 => 3.0.6