View Issue Details

IDProjectCategoryView StatusLast Update
0001763NoesisGUIC++ SDKpublic2020-07-31 19:41
ReporterPNettleshipAssigned Tosfernandez 
PrioritynormalSeveritycrashReproducibilitysometimes
Status resolvedResolutionno change required 
Product Version3.0 
Target Version3.0.4Fixed in Version3.0.4 
Summary0001763: FormattedText::UnregisterBrush() Crash
DescriptionApplying a stroke to a TextBlock on a popup, using a binding on the colour can lead to a crash.

This occurs when displaying the TextBlock multiple times, with a different colour.
The value of StrokeColour would alternate between "Red" and "Yellow".

noesis:Text.Stroke="{Binding StrokeColour}"
noesis:Text.StrokeThickness="12"

My application has an error popup that applies a different Foreground and Stroke to a TextBlock. The value of the Binding is based on the popup's context.
Changing the colour of the stroke eventually causes a crash in FormattedText::UnregisterBrush(), as the brush being referenced is null. No null check is performed before checking if the brush is not frozen.

Steps To ReproduceSetup a TextBlock to colour a stroke using a Binding.
Display the TextBlock in something generic, like a popup.
Change the value of the binding to change the colour of the stroke.
Display the TextBlock again.
After changing the colour of a stroke multiple times, the application will eventually crash in FormattedText::UnregisterBrush()
TagsC++, xaml
PlatformWindows

Activities

PNettleship

PNettleship

2020-07-29 17:45

reporter  

StackTrace.txt (1,179 bytes)
Fatal Error: [formattedtext.cpp] [Line: 592]

Unhandled exception 0xc0000005
EXCEPTION_ACCESS_VIOLATION:  The thread tried to read from or write to a virtual address for which it does not have the appropriate access. 

Registers:
RAX=0x00000000EB702DA0 RCX=0x00000000EB702DA0 RDX=0x000000000014D388 RBX=0x00000001143C0510
RSP=0x000000000014D350 RBP=0x00000001143C0520 RSI=0x00000001142C03C0 RDI=0x00000000EB702D00
R8 =0x0000000000000014 R9 =0x00000000EB5811A0 R10=0x000000000000000C R11=0x000000000014D5B8
R12=0x0000000000000005 R13=0x0000000000000190 R14=0x00000000BB240C00 R15=0x00000001142C03C0

Stack trace:
Noesis::FormattedText::UnregisterBrush
Noesis::FormattedText::UnregisterBrushes
Noesis::FormattedText::BuildTextRuns
Noesis::TextBlock::UpdateTextRuns
Noesis::TextBlock::MeasureOverride
Noesis::FrameworkElement::MeasureCore
Noesis::UIElement::Measure+0x188
Noesis::Grid::MeasureOverride
Noesis::FrameworkElement::MeasureCore
Noesis::UIElement::Measure
Noesis::FrameworkElement::MeasureOverride
Noesis::FrameworkElement::MeasureCore
Noesis::UIElement::Measure
Noesis::ViewLayout::ProcessLayout
Noesis::ViewLayout::Layout
Noesis::View::Update
StackTrace.txt (1,179 bytes)
PNettleship

PNettleship

2020-07-29 17:46

reporter  

StackTrace-2.txt (1,179 bytes)
Fatal Error: [formattedtext.cpp] [Line: 592]

Unhandled exception 0xc0000005
EXCEPTION_ACCESS_VIOLATION:  The thread tried to read from or write to a virtual address for which it does not have the appropriate access. 

Registers:
RAX=0x00000000EB702DA0 RCX=0x00000000EB702DA0 RDX=0x000000000014D388 RBX=0x00000001143C0510
RSP=0x000000000014D350 RBP=0x00000001143C0520 RSI=0x00000001142C03C0 RDI=0x00000000EB702D00
R8 =0x0000000000000014 R9 =0x00000000EB5811A0 R10=0x000000000000000C R11=0x000000000014D5B8
R12=0x0000000000000005 R13=0x0000000000000190 R14=0x00000000BB240C00 R15=0x00000001142C03C0

Stack trace:
Noesis::FormattedText::UnregisterBrush
Noesis::FormattedText::UnregisterBrushes
Noesis::FormattedText::BuildTextRuns
Noesis::TextBlock::UpdateTextRuns
Noesis::TextBlock::MeasureOverride
Noesis::FrameworkElement::MeasureCore
Noesis::UIElement::Measure+0x188
Noesis::Grid::MeasureOverride
Noesis::FrameworkElement::MeasureCore
Noesis::UIElement::Measure
Noesis::FrameworkElement::MeasureOverride
Noesis::FrameworkElement::MeasureCore
Noesis::UIElement::Measure
Noesis::ViewLayout::ProcessLayout
Noesis::ViewLayout::Layout
Noesis::View::Update
StackTrace-2.txt (1,179 bytes)
sfernandez

sfernandez

2020-07-30 10:43

manager   ~0006547

Is it possible you are still using 3.0.2 or an older version?
We fixed in 3.0.3 a problem in FormattedText::UnregisterBrushes() that could be the same you are experiencing.
PNettleship

PNettleship

2020-07-30 16:48

reporter   ~0006548

Thanks for the response.

I've just confirmed we're using version 3.0.0
We're going to look into integrating the changes made to FormattedText on 9th July 2020.
And possibly upgrade to 3.0.3 in a suitable milestone.
PNettleship

PNettleship

2020-07-31 14:46

reporter   ~0006550

We have integrated the changes made to FormattedText on 9th July 2020 in version 3.0.3

The crash no longer occurs.
We'll look into fully integrating version 3.0.3, when it safe to do so.

Thank you.

Issue History

Date Modified Username Field Change
2020-07-29 17:45 PNettleship New Issue
2020-07-29 17:45 PNettleship Tag Attached: C++
2020-07-29 17:45 PNettleship Tag Attached: xaml
2020-07-29 17:45 PNettleship File Added: StackTrace.txt
2020-07-29 17:46 PNettleship Description Updated View Revisions
2020-07-29 17:46 PNettleship Steps to Reproduce Updated View Revisions
2020-07-29 17:46 PNettleship File Added: StackTrace-2.txt
2020-07-29 20:33 sfernandez Assigned To => sfernandez
2020-07-29 20:33 sfernandez Status new => assigned
2020-07-29 20:33 sfernandez Target Version => 3.0.4
2020-07-30 10:43 sfernandez Status assigned => feedback
2020-07-30 10:43 sfernandez Note Added: 0006547
2020-07-30 16:48 PNettleship Note Added: 0006548
2020-07-30 16:48 PNettleship Status feedback => assigned
2020-07-31 14:46 PNettleship Note Added: 0006550
2020-07-31 19:41 sfernandez Status assigned => resolved
2020-07-31 19:41 sfernandez Resolution open => fixed
2020-07-31 19:41 sfernandez Fixed in Version => 3.0.3
2020-07-31 19:41 sfernandez Resolution fixed => no change required
2020-07-31 19:41 sfernandez Fixed in Version 3.0.3 => 3.0.4