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

Expander control makes my app crash #1671

Closed
wyepez opened this issue Nov 29, 2017 · 7 comments
Closed

Expander control makes my app crash #1671

wyepez opened this issue Nov 29, 2017 · 7 comments
Assignees
Labels
animations 🏮 bug 🐛 An unexpected issue that highlights incorrect behavior controls 🎛️
Milestone

Comments

@wyepez
Copy link

wyepez commented Nov 29, 2017

I'm submitting a...

[x] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  <!-- Please search GitHub for a similar issue or PR before submitting -->
[ ] Feature request <!-- Please file a UserVoice request and include the link below https://wpdev.uservoice.com/forums/110705-universal-windows-platform/category/193402-uwp-community-toolkit -->
[ ] Sample app request
[ ] Documentation issue or request
[ ] Question of Support request => Please do not submit support request here, instead see https://github.com/Microsoft/UWPCommunityToolkit/blob/master/contributing.md#question

Current behavior

When I open a dialog with a Expander control inside, the app crashes suddenly. This has started to happen when I upgraded to v2.1.0. If I downgrade to v.2.0.0, the problem disappear.

Expected behavior

The app doesn't crash.

Minimal reproduction of the problem with instructions

Here is a link with a solution that reproduces the problem.

Environment

Nuget Package(s): 
Microsoft.Toolkit.Uwp.UI.Controls

Package Version(s): 
2.1.0

Windows 10 Build Number:
- [ ] Anniversary Update (14393) 
- [x] Creators Update (15063)
- [ ] Fall Creators Update (16299)
- [ ] Insider Build (xxxxx)

App min and target version:
- [x] Anniversary Update (14393) 
- [x] Creators Update (15063)
- [ ] Fall Creators Update (16299)
- [ ] Insider Build (xxxxx)

Device form factor:
- [x] Desktop
- [ ] Mobile
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [ ] 2017 15.3
- [x] 2017 15.4

@nmetulev
Copy link
Contributor

ping @Odonno

@nmetulev nmetulev added bug 🐛 An unexpected issue that highlights incorrect behavior controls 🎛️ labels Nov 29, 2017
@nmetulev nmetulev added this to the v2.2 milestone Nov 29, 2017
@Odonno
Copy link
Contributor

Odonno commented Nov 29, 2017

@wyepez I tried your repro on Fall Creators Update and it works fine. What was the OS version you tested?

@nmetulev Is it possible it is related to the implicit animations helper?

@wyepez
Copy link
Author

wyepez commented Nov 29, 2017

@Odonno My system information is:
Edition: Windows 10 Enterprise
Version: 1703
OS Build: 15063.726

@michael-hawker
Copy link
Member

Assuming my work machine doesn't update overnight, I still have one on 15063, so I can see if I can repro it.

@Odonno
Copy link
Contributor

Odonno commented Nov 30, 2017

@michael-hawker Please do. I do not have a machine to reproduce the bug currently.

@michael-hawker
Copy link
Member

michael-hawker commented Nov 30, 2017

image

I'm seeing a win32 exception when I close the ContentDialog:

Exception thrown at 0x04FCD73F (Windows.UI.Xaml.dll) in ExpanderControl.exe: 0xC0000005: Access violation reading location 0x00000028. occurred
read access violation. this was nullptr.
>	Windows.UI.Xaml.dll!CUIElement::Measure(XSIZEF availableSize) Line 3774	C++	Non-user code. Symbols loaded.
 	Windows.UI.Xaml.dll!CPopupRoot::MeasureOverride(XSIZEF availableSize, XSIZEF & desiredSize) Line 2706	C++	Non-user code. Symbols loaded.
 	Windows.UI.Xaml.dll!CFrameworkElement::MeasureCore(XSIZEF availableSize, XSIZEF & desiredSize) Line 1507	C++	Non-user code. Symbols loaded.
 	Windows.UI.Xaml.dll!CUIElement::MeasureInternal(XSIZEF availableSize) Line 3984	C++	Non-user code. Symbols loaded.
 	Windows.UI.Xaml.dll!CUIElement::Measure(XSIZEF availableSize) Line 3810	C++	Non-user code. Symbols loaded.
 	Windows.UI.Xaml.dll!CUIElement::Measure(XSIZEF availableSize) Line 3891	C++	Non-user code. Symbols loaded.
 	Windows.UI.Xaml.dll!CLayoutManager::UpdateLayout(unsigned int controlWidth, unsigned int controlHeight) Line 251	C++	Non-user code. Symbols loaded.
 	Windows.UI.Xaml.dll!CCoreServices::NWDrawTree(HWWalk * pHWWalk, CWindowRenderTarget * pRenderTarget, VisualTree * pVisualTree, unsigned int forceRedraw, XRECT_WH * prcDirtyRect) Line 7107	C++	Non-user code. Symbols loaded.
 	Windows.UI.Xaml.dll!CCoreServices::NWDrawMainTree(CWindowRenderTarget * pIRenderTarget, bool fForceRedraw, XRECT_WH * prcDirtyRect) Line 6900	C++	Non-user code. Symbols loaded.
 	Windows.UI.Xaml.dll!CWindowRenderTarget::Draw(CCoreServices * fForceRedraw, unsigned int prcDirtyRect, XRECT_WH *) Line 138	C++	Non-user code. Symbols loaded.
 	Windows.UI.Xaml.dll!CXcpBrowserHost::OnTick() Line 530	C++	Non-user code. Symbols loaded.
 	Windows.UI.Xaml.dll!CXcpDispatcher::Tick() Line 1350	C++	Non-user code. Symbols loaded.
 	Windows.UI.Xaml.dll!CXcpDispatcher::OnReentrancyProtectedWindowMessage(HWND__ * msg, unsigned int lParam, unsigned int) Line 953	C++	Non-user code. Symbols loaded.
 	[Inline Frame] Windows.UI.Xaml.dll!CXcpDispatcher::ProcessMessage(HWND__ *) Line 797	C++	Non-user code. Symbols loaded.
 	Windows.UI.Xaml.dll!CXcpDispatcher::WindowProc(HWND__ * hwnd, unsigned int msg, unsigned int wParam, long lParam) Line 746	C++	Non-user code. Symbols loaded.
 	user32.dll!__InternalCallWinProc@20�()	Unknown	Non-user code. Symbols loaded.
 	user32.dll!UserCallWinProcCheckWow()	Unknown	Non-user code. Symbols loaded.
 	user32.dll!DispatchMessageWorker()	Unknown	Non-user code. Symbols loaded.
 	user32.dll!_DispatchMessageW@4�()	Unknown	Non-user code. Symbols loaded.
 	Windows.UI.dll!Windows::UI::Core::CDispatcher::ProcessMessage(int bDrainQueue, int * pbWindowMessagesProcessed, int * pbInvokeItemProcessed) Line 315	C++	Non-user code. Symbols loaded.
 	Windows.UI.dll!Windows::UI::Core::CDispatcher::WaitAndProcessMessagesInternal(int bRunAlwaysOnce, void * hEventWait) Line 1766	C++	Non-user code. Symbols loaded.
 	Windows.UI.dll!Windows::UI::Core::CDispatcher::ProcessEvents(Windows::UI::Core::CoreProcessEventsOption options) Line 569	C++	Non-user code. Symbols loaded.
 	[Inline Frame] Windows.UI.Xaml.dll!CJupiterWindow::RunCoreWindowMessageLoop() Line 1234	C++	Non-user code. Symbols loaded.
 	[Inline Frame] Windows.UI.Xaml.dll!CJupiterControl::RunMessageLoop() Line 907	C++	Non-user code. Symbols loaded.
 	[Inline Frame] Windows.UI.Xaml.dll!DirectUI::DXamlCore::RunMessageLoop() Line 2062	C++	Non-user code. Symbols loaded.
 	Windows.UI.Xaml.dll!DirectUI::FrameworkView::Run() Line 100	C++	Non-user code. Symbols loaded.
 	twinapi.appcore.dll!Windows::ApplicationModel::Core::CoreApplicationView::Run()	Unknown	Non-user code. Symbols loaded.
 	twinapi.appcore.dll!<lambda>(void)()	Unknown	Non-user code. Symbols loaded.
 	SHCore.dll!_WrapperThreadProc()	Unknown	Non-user code. Symbols loaded.
 	kernel32.dll!@BaseThreadInitThunk@12�()	Unknown	Non-user code. Symbols loaded.
 	ntdll.dll!__RtlUserThreadStart()	Unknown	Non-user code. Symbols loaded.
 	ntdll.dll!__RtlUserThreadStart@8�()	Unknown	Non-user code. Symbols loaded.

However, if I set the Target of the app to just be Anniversary Edition, then I get this message when opening the dialog:

Exception = {System.MissingMethodException: Method not found: 'Void Windows.UI.Xaml.Hosting.ElementCompositionPreview.SetImplicitShowAnimation(Windows.UI.Xaml.UIElement, Windows.UI.Composition.ICompositionAnimationBase)'.

>	ExpanderControl.exe!ExpanderControl.App.InitializeComponent.AnonymousMethod__5_1(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e) Line 53	C#	Symbols loaded.

   at Microsoft.Toolkit.Uwp.UI.Animations.Implicit.ShowAnimationsChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at Windows.UI.Xaml.DependencyObject.SetValue(DependencyProperty dp, Object value)
   at Microsoft.Toolkit.Uwp.UI.Animations.Implicit.GetShowAnimations(DependencyObject obj)
   at Microsoft.Toolkit.Uwp.UI.Controls.Microsoft_Toolkit_Uwp_UI_Controls_XamlTypeInfo.XamlTypeInfoProvider.get_53_Implicit_ShowAnimations(Object instance)
   at Microsoft.Toolkit.Uwp.UI.Controls.Microsoft_Toolkit_Uwp_UI_Controls_XamlTypeInfo.XamlMember.GetValue(Object instance)

So it does seem like a regression with adding implicit animations to the control on platform which don't support it. @nmetulev I thought the implicit animation XAML was just ignored if running on a lower platform?

@nmetulev
Copy link
Contributor

nmetulev commented Dec 6, 2017

Finally had a chance to try this. It turns out this is a known bug with implicit hide animations in the platform that apparently is fixed in latest insider builds.

The workaround is to not use Implicit Hide animations. Since these animations are in the toolkit controls, you can simply override the templates by copying the two styles from here and paste them in your App.xaml. Then just removed the Implicit Hide Animations from the pasted templates (line 492-494 and 500-502).

@nmetulev nmetulev closed this as completed Dec 6, 2017
wyepez pushed a commit to wyepez/ExpanderControl that referenced this issue Dec 9, 2017
@ghost ghost locked as resolved and limited conversation to collaborators Nov 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
animations 🏮 bug 🐛 An unexpected issue that highlights incorrect behavior controls 🎛️
Projects
None yet
Development

No branches or pull requests

4 participants