-
Notifications
You must be signed in to change notification settings - Fork 705
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
Short, incomplete swipe gestures on the SwipeControl sometimes causes crashes (fail fast exception) #890
Comments
SwipeControl
sometimes causes crashes (fail fast exception)
@Sergio0694, thank you for reporting this problem. @RBrid, can you investigate? |
Thank you @Sergio0694. Sergio and @YuliKl, I have not been able to repro this crash. Do you have a repro application I could be using to try again? Thank you. |
Hi @RBrid - thank you for looking into this. How would like to go ahead regarding this? |
Hey @RBrid - just though I'd give you an update on this. The stack trace I'm getting is always the same exact one I posted in my first message here, hopefully having that might help a bit to investigate this. I understand that this is probably not a super high priority bug, but I just thought I'd give you the extra info. Also, my offer is always available if someone from your team wants access to the repo to clone it and look into this. Or, if you just need to make the app crash and an external debugger is enough, you can find it here in the Store. Thanks again for your time! 😊 |
Thank you and sorry for the delay @Sergio0694, I will be gone for a month. @jevansaks, you may want to re-assign this during my absence. |
@Sergio0694, I am not able to reproduce this crash either in the repro app or in Legere from the Store. I tried on both a desktop machine and a Surface Pro 4. It is difficult to determine the root cause from the call stack. But I do have a question: are you using a SwipeControl directly, or have you made a custom type that derives from SwipeControl? The callstack looks like it is calling out to managed code when it is resolving the SwipeControl, which makes me suspect that there is a derived type involved. |
Hi @kmahone - that is correct, I am in fact using the /// <summary>
/// A simple extension for the <see cref="SwipeControl"/> that allows to relay external actions to different instances of the control
/// </summary>
public sealed class RelaySwipeControl : SwipeControl
{
/// <summary>
/// Raised whenever a swipe action is externally triggered
/// </summary>
public event EventHandler<object> ActionInvoked;
/// <summary>
/// Raises the <see cref="ActionInvoked"/> event to relay a given action
/// </summary>
/// <param name="data">The associated data for the invoked action</param>
public void RelayExternalAction([NotNull] object data) => ActionInvoked?.Invoke(this, data);
} The reason why I'm doing this is that I'm using this control as the root control in some of my user templates, and since users in Legere can customize the swipe actions in the app, what I'm doing is using a single, shared instance of the This makes the code much more efficient (and cleaner), as I don't have to spawn and initialize all the various swipe actions in each and every single template. Also, as I've previously mentioned, in case it might help, I'd be willing to share the repo of the app with you or your team, if you think that looking at my code could help you investigate this 😊 |
Hi @Sergio0694, sorry for the lack up updates on this. The issue is due to some problem with the interaction between WinRT weak references with .net types derived from WinRT types. Unfortunately, I have never been able to reproduce this crash - I tried on multiple devices including a Surface Pro 4. I have been able to get crash dumps though which shed some light on the problem. One thing that would be helpful would be if there was a method to reproduce the issue so that I could debug the crash in real time instead of through a crash dump. But it sounds like you were never able to reproduce the issue yourself? If you are looking for a work-around to avoid hitting this problem, one possibility would be to not derive RelaySwipeControl directly from SwipeControl. If instead RelaySwipeControl was a UserControl that contained a SwipeControl, this bug would not be hit. It would mean that RelaySwipeControl would need to replicate the necessary properties of SwipeControl on its api, which is not ideal. Depending on the specifics of your app, this may or may not be a reasonable work-around. |
@Sergio0694 I have made a fix to SwipeControl that I think should resolve this issue. However, since I cannot reproduce the issue myself, there is no way for me to confirm that the issue has been fixed. Probably the best thing to do is to wait for a new WinUI prerelease to get published on nuget.org and then update your app and see if the crash goes away. Alternatively, if you don't want to wait for an official version to get pushed to nuget.org, you can pick up one of our CI builds and use that. Let me know if you are interested in taking that approach. If you continue to observe this crash in your app after upgrading to a build with this change, let me know and I will reactivate the issue. |
Hi @kmahone - I was just about to reply to your previous comment, thanks! It's great to hear that you think you've actually managed to fix the issue though! Unfortunately I won't be able to try that out myself for a while though, my app is stuck on WinUI 2.1 due to a known issue with the Windows 10 18362 SDK which just causes my app to fail to build completely as soon as I target that SDK, so I've been forced to stay on 17763 as target until 20H1 comes out next year. Thanks again for your time and your help! |
Can you elaborate? Do you have a link to the tracking issue and the response you've gotten? |
@jevansaks Sure! Paging @LanceMcCarthy as he was so kind to take the time to help me out and investigate the issue. He also has more insights into what is happening exactly. From my understanding, there were a number of issues that only made it possible to build the app starting from the preview SDK 18970. It started out from the "child node 2 exited prematurely" error (see issue #1286), which I think has been fixed now, but then other issues piled up on top of it. Here's a screenshot from one of the reports that Lance wrote in my repo: |
Sounds like something @danzil and @alwu-msft should help with. Is the app open source or could you share the XAML file that's failing to compile? Have you narrowed it down to specific syntax or structure in the XAML file that's tripping this? |
@jevansaks You can ping Kevin Larkin for the MSFT internal BR. The issue was fixed in insider preview builds 18970 or newer. Here's my post on the topic https://dvlup.com/2019/08/07/postmortem-child-node-2-compilation-error-after-updating-to-18362-sdk/ Here's a related public item https://developercommunity.visualstudio.com/content/problem/544057/uwp-visual-studio-2019-targetting-1903-18362.html |
Describe the bug
As the title says, doing short, incomplete swipe gestures on the
SwipeControl
sometimes causes crashes. This has been reported by a couple users, but I can't seem to be able to replicate that using the simulator (I don't have a touch screen device to test this on).Steps to reproduce the bug
Steps to reproduce the behavior:
SwipeControl
with some left/swipe items, use it as the root control in an item template used in aListView
Expected behavior
The exception should not be raised
Version Info
Windows 10:
10.0.18362.175 x64
NuGet package version: WinUI:
2.1.190606001
Additional context
I should note that the app is currently using the SDK 17763 as both minimum and target.
Also, here is the complete stack trace from AppCenter:
The text was updated successfully, but these errors were encountered: