Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
At random times, when ScrollToAsync or PresentViewControllerAsync are called I get this runtime crash:
pp[24977:8472787] critical: Stacktrace:
App[24977:8472787] critical: at <0xffffffff>
App[24977:8472787] critical: at (wrapper managed-to-native) ObjCRuntime.Messaging.void_objc_msgSend_CATransform3D (intptr,intptr,CoreAnimation.CATransform3D)
App[24977:8472787] critical: at CoreAnimation.CALayer.set_Transform (CoreAnimation.CATransform3D) [0x0000b] in /Users/builder/data/lanes/2689/962a0506/source/maccore/src/build/ios/native/CoreAnimation/CALayer.g.cs:2305
App[24977:8472787] critical: at Xamarin.Forms.Platform.iOS.VisualElementTracker/<>c__DisplayClass25_0.b__0 ()
App[24977:8472787] critical: at Xamarin.Forms.Platform.iOS.CADisplayLinkTicker.StartThread ()
App[24977:8472787] critical: at System.Threading.ThreadHelper.ThreadStart_Context (object) [0x00017] in /Users/builder/data/lanes/2689/962a0506/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/mscorlib/system/threading/thread.cs:68
App[24977:8472787] critical: at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00081] in /Users/builder/data/lanes/2689/962a0506/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/mscorlib/system/threading/executioncontext.cs:581
App[24977:8472787] critical: at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00000] in /Users/builder/data/lanes/2689/962a0506/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/mscorlib/system/threading/executioncontext.cs:530
App[24977:8472787] critical: at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object) [0x00031] in /Users/builder/data/lanes/2689/962a0506/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/mscorlib/system/threading/executioncontext.cs:519
App[24977:8472787] critical: at System.Threading.ThreadHelper.ThreadStart () [0x0000b] in /Users/builder/data/lanes/2689/962a0506/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/mscorlib/system/threading/thread.cs:105
App[24977:8472787] critical: at (wrapper runtime-invoke) object.runtime_invoke_void__this__ (object,intptr,intptr,intptr)
A symbolicated crash can be found here: https://gist.github.com/eusebiu/e8f65ad12d8126dbc308617c524b0bcf
Xamarin Studio 6.0 (5174) - stable
Xamarin Forms 2.2.45
Also noticed that the same error appears when opening a simple Picker.
Thank you for taking the time to submit the bug. We tried to reproduce the issue you reported but were unable given the description.
If you could please attach a reproduction to the bug by starting with a clean Xamarin.Forms project and adding just the code necessary to demonstrate the issue, we would very much appreciate it.
For your convenience, we have created some reproduction best practices viewable here: https://gist.github.com/jassmith/92405c300e54a01dcc6d
Xamarin Forms team
Thanks for looking at this!
Unfortunately, I cannot reproduce it in a normal/simple XF project.
My local fix (though does not always work) was to add a Thread.Sleep(100) before await PresentViewControllerAsync(...). This clearly indicates that there is a threading (or memory) issue in that part of the platform.
The strange thing is that the Picker is also impacted (again, randomly)... so it's somehow a general problem with the code that does the (3D) effects/animations.
We can't reproduce this in our testing . It will be really hard to understand without having some code to look at , the stack trace doesn't provide us with enough information.
Thanks for looking at this!
Can you help me setting up a debug version of Xamarin Forms and Xamarin.iOS?
I'd like to be able to debug Xamarin to better provide information for you.
You can pull down a complete copy of the source from https://github.com/xamarin/Xamarin.Forms. The README.md contains a set of instructions to help you get it running. Please let us know if you have any questions.
I do not think the XF is enough since the trace goes way into Xamarin.iOS to the runtime (ObjCRuntime.Messaging.void_objc_msgSend_CATransform3D).
The XF readme is mentioning that VS is required and I'd like to debug it on macOS (the same for Xamarin.iOS including the native part - like native/CoreAnimation/CALayer.g.cs).
VS is required for Windows development, but you may debug the iOS portions using Xamarin Studio on Mac.
I've just come across this crash, it seems to occur when:
* A UIScrollView is already animating (from a user swipe)
* You call ScrollToAsync on it (before the existing animation has finished)
I'll see if I can come up with a repro for you.
Exactly same issue.
UIScrollView and Picker.
Thank God. I'm not the only one.
The reason we were getting this crash was because of an animation that was running on the main thread while the scroll was happening. In the case of the original post of this bug report, there was a custom ActivityIndicator (spinning loading icon) that continued to run even after falling out of scope when navigating away from the page were it was being used. It was being hidden but the animation task did not stop.
The way we went about troublehsoting this was by running the Xamarin Profiler and checking the "Performance" tool. You can navigate throughout the app and see if there is anything running in the background, specifically on the main UI thread. In our case, the app was not being interacted with and was idle on one of the pages, yet we observed a process running on the main thread. This task running on the Main UI thread eventually caused this crash if another animation was about to occur on the UI. (Such as scrolling, changing values of picker, clicking a button that had an icon set to it, or anything else that required some sort of animation to display on the UI)
My suspicion is that this was a multithreading issues and that the UI thread was originally being used when yet another animation task was trying to run on that same thread, using the same animation tasks such as CADisplayLinkTicker (Core Animation).
Check to see if there is anything running on the Main thread when your about to scroll or use the picker, this was the cause of this error on our end.
-Setting to Resolved as this was the solution for the original poster and was not a bug within the framework.