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

Mouse right-click in TextBox crashes the application #4804

Closed
Herdubreid opened this issue Apr 13, 2021 · 30 comments
Closed

Mouse right-click in TextBox crashes the application #4804

Herdubreid opened this issue Apr 13, 2021 · 30 comments
Labels
area-TextBox TextBox, RichEditBox product-winui3 WinUI 3 issues team-Controls Issue for the Controls team
Milestone

Comments

@Herdubreid
Copy link

Describe the bug
Mouse right-click in TextBox crashes the application.

Steps to reproduce the bug

  • Create new WinUI 3 in Desktop project.
  • Add a TextBox to MainWindow.xaml
    <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
        <Button x:Name="myButton" Click="myButton_Click">Click Me</Button>
        <TextBox/>
    </StackPanel>
  • Run the application
  • Right-click with the mouse pointer inside the TextBox

Expected behavior

Application doesn't crash.

Screenshots

Version Info

NuGet package version:

WinUI 3 - Project Reunion 0.5: 0.5.0

Windows app type:

UWP Win32
Yes
Windows 10 version Saw the problem?
Insider Build (xxxxx)
October 2020 Update (19042) Yes
May 2020 Update (19041)
November 2019 Update (18363)
May 2019 Update (18362)
October 2018 Update (17763)
April 2018 Update (17134)
Fall Creators Update (16299)
Creators Update (15063)
Device form factor Saw the problem?
Desktop Yes
Xbox
Surface Hub
IoT

Additional context

@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Apr 13, 2021
@Noemata
Copy link

Noemata commented Apr 13, 2021

Screenshot of where it crashes:

image

Just including the control is enough to cause the crash on a right click.

@Noemata
Copy link

Noemata commented Apr 13, 2021

Having devs do all the unit testing results in problems like the one above. Developers are too well behaved and scoped when evaluating their own work.

@StephenLPeters
Copy link
Contributor

StephenLPeters commented Apr 13, 2021

Is this another first chance exception that can be continued through? Doesn't seem to reproduce in XCG without a debugger attached, which makes me think that it is handled somewhere else in the stack.

@StephenLPeters StephenLPeters added area-TextBox TextBox, RichEditBox team-Framework product-winui3 WinUI 3 issues v0.5 Issues introduced in the Project Reunion 0.5 prerelease labels Apr 13, 2021
@Noemata
Copy link

Noemata commented Apr 14, 2021

@StephenLPeters , despite some of these exceptions being benign (you can continue), they are a performance drain and need to be stomped out. They also contribute to a negative developer experience.

@StephenLPeters
Copy link
Contributor

I agree. I'm just trying to get information that might be useful for the team. I suspect that a lot of these types of issues have similar root causes.

@Noemata
Copy link

Noemata commented Apr 14, 2021

@StephenLPeters , hopefully the next WinUI release will calm things down a little. I've got a dozen other bugs I'll report when the next release is out. It's best not to distract too much at this point. Most of the bugs have existed in UWP for years. I'm hoping both UWP and WinUI can get sorted out simultaneously. These are all UI related.

@codendone codendone added team-Rendering Issue for the Rendering team and removed needs-triage Issue needs to be triaged by the area owners team-Framework labels Apr 15, 2021
@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Apr 15, 2021
@codendone
Copy link
Contributor

I debugged this, and the caught exception comes from AcrylicBrush.

@Noemata
Copy link

Noemata commented Apr 15, 2021

@codendone , thank you for the clarification. Before you put out the next release, I suggest you run through these samples (release build, without VS attached): https://github.com/Noemata/RosettaNavigation

UWP runs most of these indefinitely. So should WinUI. Presently, all except the WebView test end in a crash within a couple hours of runtime on a system with 16GB of ram.

@codendone codendone added fixed-in-Reunion0.8 fixed-internally This bug has been fixed, and the fix will be shipped in the next version of WinUI 3. labels Apr 24, 2021
@anawishnoff
Copy link
Contributor

Hi @Herdubreid, you should see a fix for this bug in the upcoming WinUI 3/Project Reunion 0.8 Preview, which you can expect soon. Thanks for filing this!

@codendone codendone removed the needs-triage Issue needs to be triaged by the area owners label May 14, 2021
@nCastle1
Copy link

This is still an issue with the released version. I'm using the latest released windows app sdk and build tools that I could get working.

image

The only difference is the textbox needs to have text in it; it no longer repros when it starts empty.

@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Dec 16, 2021
@knightmeister
Copy link

This is still happening for me in the current release of the Windows App SDK (Nuget Package Microsoft.WindowsAppSDK 1.0.0)

Right clicking a text box (regardless of whether there is text in it causes a crash).

Exception thrown at 0x00007FFC30F54F69 in App1.exe: Microsoft C++ exception: winrt::hresult_error at memory location 0x000000E41B57C2B0.

This gets written to the output window:

mincore\com\oleaut32\dispatch\ups.cpp(2122)\OLEAUT32.dll!00007FFC31F29DD6: (caller: 00007FFC31F291E9) ReturnHr(1) tid(19b4) 8002801D Library not registered.
Exception thrown at 0x00007FFC30F54F69 (KernelBase.dll) in App1.exe: WinRT originate error - 0x80070490 : 'Element not found.'.
onecore\com\combase\winrt\error\restrictederror.cpp(1016)\combase.dll!00007FFC3163C363: (caller: 00007FFC31646049) ReturnHr(1) tid(19b4) 8007007E The specified module could not be found.
Exception thrown at 0x00007FFC30F54F69 in App1.exe: Microsoft C++ exception: winrt::hresult_error at memory location 0x000000E41B57C2B0.

@EmrecanKaracayir
Copy link

Same issue with RichTextBlock. Any news?

@eku1s
Copy link

eku1s commented Jan 26, 2022

Hi @Herdubreid, you should see a fix for this bug in the upcoming WinUI 3/Project Reunion 0.8 Preview, which you can expect soon. Thanks for filing this!

I am also experiencing this issue with the latest SDKs. As a beginner WinUI developer, experiences like this make us believe we've done something wrong when we haven't, which is quite frustrating.

@anawishnoff Is there any way to re-open this issue?

@rspotnitz
Copy link

Also seeing this issue with latest SDKs.

@abdelfattahradwan
Copy link

This must be re-opened. The issue is still present in Microsoft.WindowsAppSdk version 1.0.0 that was released on Tuesday, November 16, 2021 (11/16/2021).

@codendone codendone added team-Controls Issue for the Controls team version-WindowsAppSDK1.0 and removed fixed-internally This bug has been fixed, and the fix will be shipped in the next version of WinUI 3. v0.5 Issues introduced in the Project Reunion 0.5 prerelease fixed-in-Reunion0.8 labels Mar 3, 2022
@codendone
Copy link
Contributor

This is a noisy exception. F5 in the debugger will continue, or the debugger could be changed to not always break in on C++/WInRT exceptions.

The noisy exception is coming from CommandBarFlyoutCommandBar::UpdateVisualState(), which is calling ApplicationView::GetForCurrentView(). Some other places guard against causing an exception by only making this call "if (winrt::CoreWindow::GetForCurrentThread())" passes.

@StephenLPeters
Copy link
Contributor

@ranjeshj FYI

@StephenLPeters
Copy link
Contributor

@llongley FYI

@StephenLPeters StephenLPeters removed the needs-triage Issue needs to be triaged by the area owners label Mar 3, 2022
@Umer-Mahmood
Copy link

Still happening in win app sdk 1.0

@TheNewJavaman
Copy link

Can confirm, still happening in SDK 1.0.0

@CAKCy
Copy link

CAKCy commented May 16, 2022

I had the TextBox/right click problem. "Magically" the problem disappeared when I did a repair of VS2022 due to another reason (an Extension update breaking it.)

@m1nicrusher
Copy link

I had the TextBox/right click problem. "Magically" the problem disappeared when I did a repair of VS2022 due to another reason (an Extension update breaking it.)

Maybe when it repairs, it also installed a newer version of SDK. Could you confirm your SDK version?
Cheers

@CAKCy
Copy link

CAKCy commented May 16, 2022

Name : Microsoft.WindowsAppRuntime.1.0
Publisher : CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US
Architecture : X86
ResourceId :
Version : 3.469.1654.0
PackageFullName : Microsoft.WindowsAppRuntime.1.0_3.469.1654.0_x86__8wekyb3d8bbwe
InstallLocation : C:\Program Files\WindowsApps\Microsoft.WindowsAppRuntime.1.0_3.469.1654.0_x86__8wekyb3d8bbwe
IsFramework : True
PackageFamilyName : Microsoft.WindowsAppRuntime.1.0_8wekyb3d8bbwe
PublisherId : 8wekyb3d8bbwe
IsResourcePackage : False
IsBundle : False
IsDevelopmentMode : False
NonRemovable : False
IsPartiallyStaged : False
SignatureKind : Store
Status : Ok

Name : Microsoft.WindowsAppRuntime.1.0
Publisher : CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US
Architecture : X64
ResourceId :
Version : 3.469.1654.0
PackageFullName : Microsoft.WindowsAppRuntime.1.0_3.469.1654.0_x64__8wekyb3d8bbwe
InstallLocation : C:\Program Files\WindowsApps\Microsoft.WindowsAppRuntime.1.0_3.469.1654.0_x64__8wekyb3d8bbwe
IsFramework : True
PackageFamilyName : Microsoft.WindowsAppRuntime.1.0_8wekyb3d8bbwe
PublisherId : 8wekyb3d8bbwe
IsResourcePackage : False
IsBundle : False
IsDevelopmentMode : False
NonRemovable : False
IsPartiallyStaged : False
SignatureKind : Store
Status : Ok

@marwalsch
Copy link

The exception is not thrown when a context menu is provided. As a workaround it can be defined and immediately closed when opening.

<TextBox>
    <TextBox.ContextFlyout>
        <Flyout Opening="OnFlyoutOpening"/>
    </TextBox.ContextFlyout>
</TextBox>

private void OnFlyoutOpening(object sender, object _)
{
    if(sender is Flyout f)
    {
        f.Hide();
    }
}

@ghost1372
Copy link
Contributor

this issue is fixed in wasdk 1.1.0 stable

@knightmeister
Copy link

knightmeister commented Jun 11, 2022

this issue is fixed in wasdk 1.1.0 stable

Confirmed, I am no longer seeing this.

@ritesh3103
Copy link

I am having this issue in wasdk 1.1.1 stable

@abdelfattahradwan
Copy link

abdelfattahradwan commented Jul 17, 2022

I'm still having this issue as of Sunday, July 17, 2022 (7/17/2022) in Microsoft.WindowsAppSDK version 1.1.2 that was released on Saturday, July 2, 2022 (7/2/2022)

@codendone codendone added the fixed-internally This bug has been fixed, and the fix will be shipped in the next version of WinUI 3. label Oct 13, 2022
@codendone
Copy link
Contributor

Fixed internally... again.

@gabbybilka
Copy link
Member

🎉Microsoft.WindowsAppSDK v1.3.0 has been released which fixes this issue.

@bpulliam bpulliam removed the fixed-internally This bug has been fixed, and the fix will be shipped in the next version of WinUI 3. label Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-TextBox TextBox, RichEditBox product-winui3 WinUI 3 issues team-Controls Issue for the Controls team
Projects
None yet
Development

No branches or pull requests