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

Exception on trying to read string value #278

Closed
ojhad opened this issue May 14, 2020 · 4 comments
Closed

Exception on trying to read string value #278

ojhad opened this issue May 14, 2020 · 4 comments
Assignees
Labels
bug Something isn't working pri-0 Blocking/issue has no workaround
Milestone

Comments

@ojhad
Copy link

ojhad commented May 14, 2020

Here is a repro project. Keep changing the combobox selection using the keyboard arrow keys. After a little bit WindowsCompareStringOrdinal will throw an exception when passing in a string value that is being retrieved from managed code. Screenshot of the stack is below:

image

@ojhad ojhad changed the title Crash on trying to read string value Exception on trying to read string value May 14, 2020
@Scottj1s
Copy link
Member

Debugging, looks like a refcount issue with the HSTRING held by m_sourceType.m_typeName.Name. The m_sourceType held by the first PropertyProviderPropertyAccess instance created is ultimately the one involved with the crash. Couldn't find any problems with TypeNamePtr, but the problem may be upstream from that.

@AdamBraden AdamBraden added the bug Something isn't working label Jun 22, 2020
@AdamBraden AdamBraden added this to the 1.0 RTM Consumption milestone Sep 14, 2020
@Scottj1s Scottj1s added the pri-0 Blocking/issue has no workaround label Sep 14, 2020
@Scottj1s Scottj1s self-assigned this Oct 6, 2020
@Scottj1s
Copy link
Member

Scottj1s commented Oct 8, 2020

@ojhad This looks to have been a WinUI issue, as I can no longer repro with a newer version (3.0.0-preview2.200713.0). I'll leave open for a few days if you want to confirm.

@Scottj1s Scottj1s closed this as completed Oct 9, 2020
@evelynwu-msft
Copy link
Contributor

@Scottj1s This still repros; I've been able to repro it consistently using the Desktop Xaml Controls Gallery on Preview 3.

  1. Navigate to the CalenderView sample in Xaml Controls Gallery
  2. Give keyboard focus to the "Language" combo box
  3. Quickly change the SelectedItem by holding down the up/down arrow keys, changing direction as the end of the list is reached
  4. Eventually (will probably take several loops through the list) the aforementioned AV will be triggered

@Scottj1s
Copy link
Member

Scottj1s commented Jan 4, 2021

@alwu-msft, yes this issue was ultimately fixed, but didn't make it into WinUI 3 Preview 3. It was published with cswinrt 1.1.0, PR 551.
The latest Windows SDK Interop in .NET SDK 5.0.1 or later, should address it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pri-0 Blocking/issue has no workaround
Projects
None yet
Development

No branches or pull requests

4 participants