RichTextBox insert text application will crash
See original GitHub issue- .NET Core Version: netcoreapp 3.1
- Windows version: Windows 10 CMGE
- Does the bug reproduce also in WPF for .NET Framework 4.8?: Yes
- Is this bug related specifically to tooling in Visual Studio (e.g. XAML Designer, Code editing, etc…)? No.
- Security issues and bugs should be reported privately, learn more via our responsible disclosure guidelines.
Problem description: the problem occur when we set the caret on the BlockUIContainer and typing any character,that will raise FatalExecutionEngineError in framework 4.7.2 or raise ExecutionEngineException in netcore 3.1.
How to reproduce?
- create an wpf project,and add this xaml code to mainwindow.xaml
<RichTextBox>
<FlowDocument>
<BlockUIContainer>
<Image Source="D:\sample.jpg"/>
</BlockUIContainer>
</FlowDocument>
</RichTextBox>
- use an image file to instead D:\sample.jpg
- run app
4.click image and press Arrow-Right
5.type any character
Issue Analytics
- State:
- Created 3 years ago
- Reactions:21
- Comments:17 (8 by maintainers)
Top Results From Across the Web
C# program crashes when adding a Paragraph from ...
I am trying to add a Paragraph to a RichTextBox control from another thread and my app crashes as soon as I try...
Read more >RichTextBox crashes on character input with IME ...
Hello, Typing characters with switching IME input mode will crash your RichTextBox sample application. In 2017.2.614 the process is killed and ...
Read more >WPF RichTextBox misses key strokes when spell check ...
After the windows update KB4562900. When the spell check finds a misspelled word the rich text box misses key strokes. Only happens with...
Read more >simulation causes bug : System Access Violation
I've made a 'Crash Test' app that demonstrates the problem which can be downloaded from my GoogleDrive and was written in MS C#2019...
Read more >EXTENDED Version of Extended Rich Text Box ...
NET 4.7 or later, cause the app to crash when one selects multiple words in the rich-text box, then uses the toolstrip combo...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Basically I think it is illegal to add a paragraph during
SetText
since TSF has a lock on the store. Citing the documentation:For the first option, if the
_netCharCount
is updated with the correct value inSetText
, the crash is fixed (by definition) and the IME works uninterrupted, but I believe we should technically inform the sink that a paragraph has been added once the lock is lifted. This is a bit tricky because we need to track where the paragraph insertion ends up being after the composition.we test in another device,this problem reproduce again