Closed jschwizer99 closed 2 years ago
@MikeHillberg do we have a bug link for this one?
I'm currently not able to repro the crash, perhaps because I'm trying the repro on Win11 rather than Win10. From what I can see of the callstack, I don't see any changes made in WinUI/WinAppSDK after 1.0 in getting DataView.
@codendone Can you confirm on your platform the shift of the drop zone? For me, the crash was not triggered immediately for this reduced setup. I had to start the application several times in Debug mode and move around on the shifted drop zone (indicated by Move / Copy labels). Let me know if you need additional information.
Yes, I needed to offset to the drop zone (which I see is logged as #7008) and I see the Move label along with the "OnDragOver" text in the debug output. But no crash. I still need to try on Win10.
The crash signature looks like the one reported in https://github.com/microsoft/microsoft-ui-xaml/issues/7007. However, on my WinRT C++ based application, I never saw it on WinUI 1.0.2 and 1.0.3. It was triggered quite fast on WinUI 1.1.0-Preview1 and WinUI 1.1.0-Preview2.
Both reported issues (crash and offset) are still visible in WinUI 1.1.0-preview3 (https://github.com/microsoft/microsoft-ui-xaml/issues/7061).
Just tested it with WinUI 1.1.0. As @ShashankNay already mentioned the issue is still there. Without a working drag & drop, we can not update our application to the WinUI 1.1.0 Release. This is a serious blocker.
@jschwizer99 We published a service update (1.1.1) with a bug fix. Let us know if finally fixed this tricky bug.
@marb2000 @gabbybilka @MikeHillberg Unfortunately Drag & Drop still crashes with 1.1.1 when dragging a file (outside the app) onto the app. This is even worse than in 1.0.3 ! See also issue #7231
@bpulliam As mentioned in https://github.com/microsoft/microsoft-ui-xaml/issues/7231, this is not a duplicate of this issue. So there's still stuff to fix regarding D&D
My app also still crashes after upgrading to version 1.1.1.
Still crashing with v1.1.1, dragging a file from outside my app used to crash 1/10 times in 1.0.3 but from 1.1 onwards its 9/10 times.
Had to turn off the feature for the time being https://github.com/rocksdanister/lively/issues/1262
@marb2000 I've tested both my full app and the drag & drop demo application as attached to this ticket for version 1.1.1. Both still show the WinRT error message 'Reentrancy was detected in this XAML application' followed by an unhandled exception. I did see the issue both for Release and Debug builds. I always see the exception for the get_DataView()
method. I never did catch any on get_Modifiers()
. After these exceptions, my app Release build will crash. The Debug build seems to still keep running after a few F5 (exceptions are not marked as breaks).
I've also retested under the same conditions 1.1.0. There seems not to be a noticeable difference. For 1.0.3 the issue cannot be observed on my full app and the demo drag & drop app both for Release and Debug.
@marb2000 Let me know what further information you need. For this typical crash on 1.1.1 Debug, I can supply the 200MB+ dump or the stowed exceptions for the initial d&d crash example project.
As further info when trying out all the different versions, apps, and builds. It seems that sometimes the crash is tough to trigger (or not at all > 200 d&d), sometimes a build will crash right away (in sequence). The only stable observation is that my apps and crash example does not show the issue for <= 1.0.4 versions. This is a different signature as of #7231.
In order to trigger the issue more frequently a tree/list could be filled with a lot of small objects with drop individual zones. Moving up / down will trigger the issue very fast. That is the layout of my large app that shows it quite frequently.
@marb2000 Tested 1.1.1. In our app it doesn't solve any drag&drop crashes and even adds some more. I have crash dumps available. How can I send them? I attached stack traces for internal d&d and file d&d.
More drag and drop weirdness: https://github.com/microsoft/microsoft-ui-xaml/issues/7266
Thanks for all this info. Very useful.
Updating this thread. We are actively investigating these drag&drop issues (@Scottj1s is actually investing time on it). Some of them looks similar but could have a different root cause. These bugs are very tricky to diagnose and solve, given it can cause collateral issues, but we are making progress! No ETA yet, but we are planning to service it.
@marb2000 Thank you Miguel and others for looking into these type of issues. That is greatly appreciated.
@marb2000 As there are no release notes of App SDK 1.1.2 available I've tried it shortly on my application. It still crashes during drag&drop with the usual thread race exception. This time I saw it during the get_Modifiers() call.
Accessing DragEventArgs.DataView with 1.1.3 crashes my C# app. Downgrading to 1.0.3 'resolves' the issue.
I tried to reproduce the issue in a blank, minimal repo (Visual Studio 2022 latest: "Blank app, Packaged (WinUI 3 in Desktop") but failed. I suspect there are a few side conditions involved which are not easy to catch by a fresh, new repo.
fix is now available in Windows App SDK 1.2 Preview 1
@Scottj1s Can I use SDK 1.2 Preview 1 in production?
Yes, you can - the corresponding framework package is available in the store
@wbokkers, my apologies - Windows App SDK Previews are not supported in production: https://docs.microsoft.com/en-us/windows/apps/windows-app-sdk/preview-channel
@Scottj1s So when will there be a fix in a production ready version? We need the d&d issues to be resolved very badly in our app. What is fix worth if it can't be used in production?
The only alternative I can think of is to go SelfContained: https://docs.microsoft.com/en-us/windows/apps/package-and-deploy/self-contained-deploy/deploy-self-contained-apps
@Scottj1s That's not an option. I looked into that, but I need to change lots of code for this to work. It is a big app that touches every aspect of the life cycle. We also use appinstaller technology for getting updates.
(Add more details to this bug) - In my case: Windows App SDK 1.1.4:
Grid
and everything works well.ListView
need drag & drop feature to re-order items, I must allow Drag & Drop on ListView
item, then I try to drag an item from ListView
to Grid
, exception occurs at line e.DataView
. I cannot know how to handle this and am waiting for the Windows App SDK 1.2.@Scottj1s I've tested my large application with App SDK 1.2.0-preview1. I could no more observe the crashes as reported in this ticket. Many thanks again for the fixes.
Unfortunately, during testing, I hit another regression of App SDK v1.1.x that triggers a crash when using colorpickers. The issue is reported in https://github.com/microsoft/microsoft-ui-xaml/issues/7239. It would be great if this regression also gets attention so that finally we again have a WinUI that is as stable as App SDK v1.0.x.
I've discovered a very reliable sample that can reproduce this bug (I think it's this bug but can't verify, explained below) Tested on WindowsAppSDK v1.1.5 (latest) DragDropBugSample.zip
Create a blank app with WinUI3, and drop the 2 files into the solution. There are three ListViews; the left and right ones are inside of Expander controls but the center one is not. Drag an item from the left list, hold your mouse for 2 or more seconds, then drop onto the center list. You get an unhandled win32 exception every time. Visual Studio 2022 can't even debug it; detaching and then reattaching as suggested by the dialog box doesn't work. You can also trigger the bug by dragging quickly, but will require more attempts. Notice the same doesn't happen if you drop onto the right ListView. The intended behavior of moving items from one container to the other works every time between these two. Note that this bug exists not just for ListView; changing the center ListView to a GridView will also trigger the same bug.
Describe the bug
Fatal exception during drag & drop with WinUI 1.1.0 Preview2 during either
get_DataView()
orget_Modifiers()
. The same code works fine for WinUI 1.0.3.Besides the hard crash, the drop area seems to be in the incorrect position.
Steps to reproduce the bug
See attached minimal project. WinUIDragOverCrash.zip
Note: As extracted from a large failing project, the individual blocks may miss functionality (especially the drop handler). The drop handler of the original project contains o lot of async processing of the dropped data.
Compile and start project. Perform several a drag & drop operation. The drop area for WinUI 1.1.0 Preview 2 is not where it should be. On my screen it was on the lower right corner of the application. Move it around on the drop area to provoke calls to OnDragOver().
Debug Output
Stack Trace
Expected behavior
I would expect that
winrt::Microsoft::UI::Xaml::DragEventArgs::DataView()
andwinrt::Microsoft::UI::Xaml::DragEventArgs::Modifiers()
can be accessed in the DragOver event handler without need of switching between threads.Screenshots
Wrong Drop Area of WinUI 1.1.0 Preview 2
NuGet package version
No response
Windows app type
Device form factor
Desktop
Windows version
Windows 10 (21H2): Build 19044, Windows 10 (20H2): Build 19042
Additional context
No response