Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WPF in .net core 6.0 or 8.0, process terminated error occured and exit program unexpectly when type korean(IME) character fast in DataGrid. #9829

Open
vsfeedback opened this issue Sep 23, 2024 · 8 comments
Labels
Investigate Requires further investigation by the WPF team.

Comments

@vsfeedback
Copy link

This issue has been moved from a ticket on Developer Community.


[severity:I'm unable to use this version]
WpfApp1.zip

instruction

there is very simple code, a sample of datagrid and databinding.

quickly enter Korean while switching cells in datagrid, a 'process terminated' error occurs.

I already post this issue in microsoft learn, but I think o this is lowlevel problem between WPF framework and IME.

Currently, datagrid must be used for development, and the program is easily terminated, which is a problem.

how to reproduce

  1. With the Korean IME running, enter any number of Korean characters (any character does not matter) into a cell of the datagrid.

  2. Click another cell and enter Korean again.

  3. If an error does not occur, repeat the above actions.

environments

tested on 3 PC.

occured OS : window 11 home, professional

occured .net version : 6.0.16, 8.0

error message

Application: WpfApp1.exe

CoreCLR Version: 6.0.1623.17311

.NET Version: 6.0.16

Description: The application requested process termination through System.Environment.FailFast(string message).

Message: 복구할 수 없는 시스템 오류입니다.

Stack:

at System.Environment.FailFast(System.String)

at System.Windows.Documents.TextStore.VerifyTextStoreConsistency()

at System.Windows.Documents.TextStore.GrantLock()

at System.Windows.Documents.TextStore.GrantLockWorker(LockFlags)

at System.Windows.Documents.TextStore.RequestLock(LockFlags, Int32 ByRef)

at MS. Win32.UnsafeNativeMethods+ITextStoreACPSink.OnSelectionChange()

at MS. Win32.UnsafeNativeMethods+ITextStoreACPSink.OnSelectionChange()

at System.Windows.Documents.TextStore.OnSelectionChanged()

at System.Windows.Documents.TextSelection.System.Windows.Documents.ITextRange.NotifyChanged(Boolean, Boolean)

at System.Windows.Documents.TextRangeBase.EndChange(System.Windows.Documents.ITextRange, Boolean, Boolean)

at System.Windows.Documents.TextRange.System.Windows.Documents.ITextRange.EndChange(Boolean, Boolean)

at System.Windows.Documents.TextRange+ChangeBlock.System.IDisposable.Dispose()

at System.Windows.Documents.TextEditorTyping.DoTextInput(System.Windows.Documents.TextEditor, System.String, Boolean, Boolean)

at System.Windows.Documents.TextEditorTyping+TextInputItem.Do()

at System.Windows.Documents.TextEditorTyping.ScheduleInput(System.Windows.Documents.TextEditor, InputItem)

at System.Windows.Documents.TextEditorTyping.OnTextInput(System.Object, System.Windows.Input.TextCompositionEventArgs)

at System.Windows.Controls.Primitives.TextBoxBase.OnTextInput(System.Windows.Input.TextCompositionEventArgs)

at System.Windows.UIElement.OnTextInputThunk(System.Object, System.Windows.Input.TextCompositionEventArgs)

at System.Windows.Input.TextCompositionEventArgs.InvokeEventHandler(System.Delegate, System.Object)

at System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate, System.Object)

at System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)

at System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject, System.Windows.RoutedEventArgs)

at System.Windows.UIElement.RaiseTrustedEvent(System.Windows.RoutedEventArgs)

at System.Windows.Input.InputManager.ProcessStagingArea()

at System.Windows.Input.TextCompositionManager.UnsafeCompleteComposition(System.Windows.Input.TextComposition)

at System.Windows.Input.DefaultTextStore.OnTransitoryExtensionUpdated(ITfContext, Int32, ITfRange, ITfRange, Boolean ByRef)

at MS. Win32.UnsafeNativeMethods+ITfThreadMgr.SetFocus(ITfDocumentMgr)

at MS. Win32.UnsafeNativeMethods+ITfThreadMgr.SetFocus(ITfDocumentMgr)

at System.Windows.Documents.TextStore.OnGotFocus()

at System.Windows.Documents.TextServicesHost._RegisterTextStore(System.Windows.Documents.TextStore)

at System.Windows.Documents.TextStore.OnAttach()

at System.Windows.Documents.TextEditor.InitTextStore(System.Object)

at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)

at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)

at System.Windows.Threading.DispatcherOperation.InvokeImpl()

at MS. Internal.CulturePreservingExecutionContext.CallbackWrapper(System.Object)

at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)

at MS. Internal.CulturePreservingExecutionContext.Run(MS. Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object)

at System.Windows.Threading.DispatcherOperation.Invoke()

at System.Windows.Threading.Dispatcher.ProcessQueue()

at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)

at MS. Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)

at MS. Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)

at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)

at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)

at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)

at MS. Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)

at MS. Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)

at MS. Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)

at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)

at System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame)

at System.Windows.Threading.DispatcherOperation.Wait(System.TimeSpan)

at System.Windows.Threading.Dispatcher.InvokeImpl(System.Windows.Threading.DispatcherOperation, System.Threading.CancellationToken, System.TimeSpan)

at System.Windows.Threading.Dispatcher.Invoke(System.Action, System.Windows.Threading.DispatcherPriority, System.Threading.CancellationToken, System.TimeSpan)

at System.Windows.Threading.Dispatcher.Invoke(System.Action, System.Windows.Threading.DispatcherPriority)

at System.Windows.Controls.DataGridTextColumn.OnInput(System.Windows.Input.InputEventArgs)

at System.Windows.Controls.DataGridCell.OnPreviewKeyDown(System.Windows.Input.KeyEventArgs)

at System.Windows.UIElement.OnPreviewKeyDownThunk(System.Object, System.Windows.Input.KeyEventArgs)

at System.Windows.Input.KeyEventArgs.InvokeEventHandler(System.Delegate, System.Object)

at System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate, System.Object)

at System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)

at System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject, System.Windows.RoutedEventArgs)

at System.Windows.UIElement.RaiseTrustedEvent(System.Windows.RoutedEventArgs)

at System.Windows.Input.InputManager.ProcessStagingArea()

at System.Windows.Input.InputProviderSite.ReportInput(System.Windows.Input.InputReport)

at System.Windows.Interop.HwndKeyboardInputProvider.ReportInput(IntPtr, System.Windows.Input.InputMode, Int32, System.Windows.Input.RawKeyboardActions, Int32, Boolean, Boolean, Int32)

at System.Windows.Interop.HwndKeyboardInputProvider.ProcessKeyAction(System.Windows.Interop.MSG ByRef, Boolean ByRef)

at System.Windows.Interop.HwndSource.CriticalTranslateAccelerator(System.Windows.Interop.MSG ByRef, System.Windows.Input.ModifierKeys)

at System.Windows.Interop.HwndSource.OnPreprocessMessage(System.Object)

at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)

at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)

at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)

at System.Windows.Interop.HwndSource.OnPreprocessMessageThunk(System.Windows.Interop.MSG ByRef, Boolean ByRef)

at System.Windows.Interop.ComponentDispatcherThread.RaiseThreadMessage(System.Windows.Interop.MSG ByRef)

at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)

at System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame)

at System.Windows.Threading.Dispatcher.Run()

at System.Windows.Application.RunDispatcher(System.Object)

at System.Windows.Application.RunInternal(System.Windows.Window)

at System.Windows.Application.Run()

at WpfApp1.App.Main()

Original Comments

Feedback Bot on 23/9/2024, 07:51 AM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

@harshit7962 harshit7962 added the Investigate Requires further investigation by the WPF team. label Sep 23, 2024
@miloush
Copy link
Contributor

miloush commented Sep 23, 2024

I cannot reproduce this with either of the Korean IMEs. What is your Windows build? Can you share a screen recording?

@miloush
Copy link
Contributor

miloush commented Sep 23, 2024

Does it repro on net48?

@relay955
Copy link

thanks for your interest, there is my windows build information. I currently installed recently updates all.
asdf

but I found occuring error on another windows 11 home PC also, that PC is update recently too.

to reproduce this error, when activate cell into edit mode, type more than two Korean characters quickly with almost no delay.

Below is a video showing an example of the error occurring with visual studio community 2022

Desktop.2024.09.23.-.19.24.53.04.mp4

This can easily reproduce if the delay between the cell switching to edit mode and entering Korean is short.

However, in this example, an error occurs only if type very quickly, but in a heavy datagrid with complex code, an error occurs even if type a little quickly.

to quickly enter data in a cell, most users often press Enter and then quickly fill in the data to the next row.

I tried test with .net 6.0 and 8.0 both, but error not disappear.

in .net framework 4.8, error message is slightly different, but stacktrace is similar with other version tests.

image

@miloush
Copy link
Contributor

miloush commented Sep 23, 2024

Thank you! Right, so by starting to type fast into a cell that is not in edit mode I can sometimes reproduce.

Possibly same issue as in #3315.

@miloush
Copy link
Contributor

miloush commented Sep 24, 2024

This is duplicate of #9805 but there is more useful information here.

@indigoray
Copy link

The last reason the exception occurs...

private void VerifyTextStoreConsistency()
{
	if (_netCharCount != TextContainer.IMECharCount)
	{
		Invariant.Assert(condition: false, "TextContainer/TextStore have inconsistent char counts!");
	}
}

@indigoray
Copy link

Similar Issue

#4985

@miloush
Copy link
Contributor

miloush commented Sep 25, 2024

It's not a problem to find the assert that crashes it, it's finding out why the assert fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Investigate Requires further investigation by the WPF team.
Projects
None yet
Development

No branches or pull requests

5 participants