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

calendar.SelectDate not working inside async method #15

Open
drunkendaddy opened this issue Feb 6, 2018 · 2 comments
Open

calendar.SelectDate not working inside async method #15

drunkendaddy opened this issue Feb 6, 2018 · 2 comments

Comments

@drunkendaddy
Copy link

I've an async method, inside it I'm calling calendar.SelectDate(NSDate date);

It causes the below error and application crashes. If I call the same thing outside an async method, it is working as expected.

2018-02-06 11:47:28.910 MyAZHealth[26280:1596858] critical: Stacktrace:

2018-02-06 11:47:28.910 MyAZHealth[26280:1596858] critical:   at <unknown> <0xffffffff>
2018-02-06 11:47:28.910 MyAZHealth[26280:1596858] critical:   at (wrapper managed-to-native) ApiDefinition.Messaging.void_objc_msgSend_IntPtr (intptr,intptr,intptr) [0x0000b] in <1b3b5cb4992c4f7887b20ff074c8d684>:0
2018-02-06 11:47:28.910 MyAZHealth[26280:1596858] critical:   at WenchaoD.FSCalendar.FSCalendar.SelectDate (Foundation.NSDate) [0x00029] in <1b3b5cb4992c4f7887b20ff074c8d684>:0
2018-02-06 11:47:28.910 MyAZHealth[26280:1596858] critical:   at MyAZHealth.ActivityCalendarController.SelectDates () [0x00068] in /Users/sarath/Projects/svn/GCH_WebAPP1/Xamarin_Projects/Gogch/MyAZHealth/Controllers/FY18/ActivityCalendarController.cs:184
2018-02-06 11:47:28.911 MyAZHealth[26280:1596858] critical:   at MyAZHealth.ActivityCalendarController.LoadCalendar () [0x00086] in /Users/sarath/Projects/svn/GCH_WebAPP1/Xamarin_Projects/Gogch/MyAZHealth/Controllers/FY18/ActivityCalendarController.cs:59
2018-02-06 11:47:28.911 MyAZHealth[26280:1596858] critical:   at MyAZHealth.ActivityCalendarController/<ReLoadData>d__18.MoveNext () [0x000dd] in /Users/sarath/Projects/svn/GCH_WebAPP1/Xamarin_Projects/Gogch/MyAZHealth/Controllers/FY18/ActivityCalendarController.cs:265
2018-02-06 11:47:28.911 MyAZHealth[26280:1596858] critical:   at System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner.InvokeMoveNext (object) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1089
2018-02-06 11:47:28.911 MyAZHealth[26280:1596858] critical:   at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00071] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:957
2018-02-06 11:47:28.911 MyAZHealth[26280:1596858] critical:   at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:904
2018-02-06 11:47:28.911 MyAZHealth[26280:1596858] critical:   at System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner.Run () [0x00024] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1070
2018-02-06 11:47:28.911 MyAZHealth[26280:1596858] critical:   at System.Threading.Tasks.AwaitTaskContinuation.InvokeAction (object) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskContinuation.cs:743
2018-02-06 11:47:28.912 MyAZHealth[26280:1596858] critical:   at System.Threading.Tasks.AwaitTaskContinuation.RunCallback (System.Threading.ContextCallback,object,System.Threading.Tasks.Task&) [0x00011] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskContinuation.cs:772
2018-02-06 11:47:28.912 MyAZHealth[26280:1596858] critical:   at System.Threading.Tasks.SynchronizationContextAwaitTaskContinuation.Run (System.Threading.Tasks.Task,bool) [0x00010] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskContinuation.cs:419
2018-02-06 11:47:28.912 MyAZHealth[26280:1596858] critical:   at System.Threading.Tasks.Task.FinishContinuations () [0x000b1] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/threading/Tasks/Task.cs:3649
2018-02-06 11:47:28.912 MyAZHealth[26280:1596858] critical:   at System.Threading.Tasks.Task.FinishStageThree () [0x0003c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/threading/Tasks/Task.cs:2366
2018-02-06 11:47:28.912 MyAZHealth[26280:1596858] critical:   at System.Threading.Tasks.Task`1<TResult_REF>.TrySetResult (TResult_REF) [0x0004f] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/threading/Tasks/Future.cs:488
2018-02-06 11:47:28.912 MyAZHealth[26280:1596858] critical:   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<TResult_REF>.SetResult (TResult_REF) [0x0003e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:608
2018-02-06 11:47:28.912 MyAZHealth[26280:1596858] critical:   at Gogch.FamilyDashboardApiCall/<ActivityHistoryDetail>d__4.MoveNext () [0x00121] in /Users/sarath/Projects/svn/GCH_WebAPP1/Xamarin_Projects/Gogch/Gogch/APICalls/Implementation/FamilyDashboardApiCall.cs:53
2018-02-06 11:47:28.913 MyAZHealth[26280:1596858] critical:   at System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner.InvokeMoveNext (object) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1089
2018-02-06 11:47:28.913 MyAZHealth[26280:1596858] critical:   at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00071] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:957
2018-02-06 11:47:28.913 MyAZHealth[26280:1596858] critical:   at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:904
2018-02-06 11:47:28.913 MyAZHealth[26280:1596858] critical:   at System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner.Run () [0x00024] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1070
2018-02-06 11:47:28.913 MyAZHealth[26280:1596858] critical:   at System.Threading.Tasks.AwaitTaskContinuation.InvokeAction (object) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskContinuation.cs:743
2018-02-06 11:47:28.913 MyAZHealth[26280:1596858] critical:   at System.Threading.Tasks.AwaitTaskContinuation.RunCallback (System.Threading.ContextCallback,object,System.Threading.Tasks.Task&) [0x00011] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskContinuation.cs:772
2018-02-06 11:47:28.913 MyAZHealth[26280:1596858] critical:   at System.Threading.Tasks.SynchronizationContextAwaitTaskContinuation.Run (System.Threading.Tasks.Task,bool) [0x00010] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskContinuation.cs:419
2018-02-06 11:47:28.914 MyAZHealth[26280:1596858] critical:   at System.Threading.Tasks.Task.FinishContinuations () [0x000b1] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/threading/Tasks/Task.cs:3649
2018-02-06 11:47:28.914 MyAZHealth[26280:1596858] critical:   at System.Threading.Tasks.Task.FinishStageThree () [0x0003c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/threading/Tasks/Task.cs:2366
2018-02-06 11:47:28.914 MyAZHealth[26280:1596858] critical:   at System.Threading.Tasks.Task`1<TResult_REF>.TrySetResult (TResult_REF) [0x0004f] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/threading/Tasks/Future.cs:488
2018-02-06 11:47:28.914 MyAZHealth[26280:1596858] critical:   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<TResult_REF>.SetResult (TResult_REF) [0x0003e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:608
2018-02-06 11:47:28.914 MyAZHealth[26280:1596858] critical:   at Gogch.HttpCall/<GetAsync>d__4.MoveNext () [0x00363] in /Users/sarath/Projects/svn/GCH_WebAPP1/Xamarin_Projects/Gogch/Gogch/APICalls/Implementation/HttpCall.cs:46
2018-02-06 11:47:28.914 MyAZHealth[26280:1596858] critical:   at System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner.InvokeMoveNext (object) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1089
2018-02-06 11:47:28.915 MyAZHealth[26280:1596858] critical:   at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00071] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:957
2018-02-06 11:47:28.915 MyAZHealth[26280:1596858] critical:   at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:904
2018-02-06 11:47:28.915 MyAZHealth[26280:1596858] critical:   at System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner.Run () [0x00024] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1070
2018-02-06 11:47:28.916 MyAZHealth[26280:1596858] critical:   at System.Threading.Tasks.SynchronizationContextAwaitTaskContinuation/<>c.<.cctor>b__7_0 (object) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/threading/Tasks/TaskContinuation.cs:388
2018-02-06 11:47:28.916 MyAZHealth[26280:1596858] critical:   at UIKit.UIKitSynchronizationContext/<Post>c__AnonStorey0.<>m__0 () [0x00000] in /Users/builder/data/lanes/5665/db807ec9/source/xamarin-macios/src/UIKit/UIKitSynchronizationContext.cs:24
2018-02-06 11:47:28.917 MyAZHealth[26280:1596858] critical:   at Foundation.NSAsyncActionDispatcher.Apply () [0x00000] in /Users/builder/data/lanes/5665/db807ec9/source/xamarin-macios/src/Foundation/NSAction.cs:163
2018-02-06 11:47:28.917 MyAZHealth[26280:1596858] critical:   at (wrapper runtime-invoke) object.runtime_invoke_void__this__ (object,intptr,intptr,intptr) [0x0004f] in <d680a8bf3a2a4c8dbbfde665ba81f6f2>:0
2018-02-06 11:47:28.917 MyAZHealth[26280:1596858] critical:   at <unknown> <0xffffffff>
2018-02-06 11:47:28.918 MyAZHealth[26280:1596858] critical:   at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) [0x0005c] in <e0596b82250c450abdf075bc558add28>:0
2018-02-06 11:47:28.918 MyAZHealth[26280:1596858] critical:   at UIKit.UIApplication.Main (string[],intptr,intptr) [0x00005] in /Users/builder/data/lanes/5665/db807ec9/source/xamarin-macios/src/UIKit/UIApplication.cs:79
2018-02-06 11:47:28.918 MyAZHealth[26280:1596858] critical:   at UIKit.UIApplication.Main (string[],string,string) [0x00038] in /Users/builder/data/lanes/5665/db807ec9/source/xamarin-macios/src/UIKit/UIApplication.cs:63
2018-02-06 11:47:28.919 MyAZHealth[26280:1596858] critical:   at MyAZHealth.Application.Main (string[]) [0x00001] in /Users/sarath/Projects/svn/GCH_WebAPP1/Xamarin_Projects/Gogch/MyAZHealth/Main.cs:12
2018-02-06 11:47:28.919 MyAZHealth[26280:1596858] critical:   at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) [0x00051] in <a7269f9dd33f4004acab96154506183a>:0
2018-02-06 11:47:28.919 MyAZHealth[26280:1596858] critical: 
Native stacktrace:

2018-02-06 11:47:28.927 MyAZHealth[26280:1596858] critical: 	0   MyAZHealth                          0x000000010237d0e4 mono_handle_native_crash + 244
2018-02-06 11:47:28.927 MyAZHealth[26280:1596858] critical: 	1   MyAZHealth                          0x000000010238b1f0 mono_sigsegv_signal_handler + 288
2018-02-06 11:47:28.927 MyAZHealth[26280:1596858] critical: 	2   libsystem_platform.dylib            0x00000001098a9b3a _sigtramp + 26
2018-02-06 11:47:28.927 MyAZHealth[26280:1596858] critical: 	3   libsystem_trace.dylib               0x0000000109793b05 os_log_type_enabled + 295
2018-02-06 11:47:28.927 MyAZHealth[26280:1596858] critical: 	4   MyAZHealth                          0x00000001021ea0dc -[FSCalendarCollectionViewLayout layoutAttributesForElementsInRect:] + 430
2018-02-06 11:47:28.927 MyAZHealth[26280:1596858] critical: 	5   MyAZHealth                          0x00000001021e4bf3 -[FSCalendar scrollToDate:animated:] + 703
2018-02-06 11:47:28.927 MyAZHealth[26280:1596858] critical: 	6   MyAZHealth                          0x00000001021e4ecf -[FSCalendar scrollToPageForDate:animated:] + 261
2018-02-06 11:47:28.927 MyAZHealth[26280:1596858] critical: 	7   MyAZHealth                          0x00000001021e487d -[FSCalendar selectDate:scrollToDate:atMonthPosition:] + 1903
2018-02-06 11:47:28.928 MyAZHealth[26280:1596858] critical: 	8   MyAZHealth                          0x0000000102567fd9 xamarin_dyn_objc_msgSend + 217
2018-02-06 11:47:28.928 MyAZHealth[26280:1596858] critical: 	9   ???                                 0x000000011f013ac9 0x0 + 4815141577
2018-02-06 11:47:28.928 MyAZHealth[26280:1596858] critical: 	10  ???                                 0x000000011f012d8b 0x0 + 4815138187
2018-02-06 11:47:28.928 MyAZHealth[26280:1596858] critical: 	11  ???                                 0x000000011d948eec 0x0 + 4791242476
2018-02-06 11:47:28.928 MyAZHealth[26280:1596858] critical: 	12  ???                                 0x000000011d4d0923 0x0 + 4786555171
2018-02-06 11:47:28.928 MyAZHealth[26280:1596858] critical: 	13  ???                                 0x000000011db0f504 0x0 + 4793103620
2018-02-06 11:47:28.928 MyAZHealth[26280:1596858] critical: 	14  ???                                 0x000000011d96670b 0x0 + 4791363339
2018-02-06 11:47:28.928 MyAZHealth[26280:1596858] critical: 	15  ???                                 0x000000011d4ff913 0x0 + 4786747667
2018-02-06 11:47:28.929 MyAZHealth[26280:1596858] critical: 	16  ???                                 0x000000011d948eec 0x0 + 4791242476
2018-02-06 11:47:28.929 MyAZHealth[26280:1596858] critical: 	17  ???                                 0x000000011d4d0923 0x0 + 4786555171
2018-02-06 11:47:28.929 MyAZHealth[26280:1596858] critical: 	18  ???                                 0x000000011db0f504 0x0 + 4793103620
2018-02-06 11:47:28.929 MyAZHealth[26280:1596858] critical: 	19  ???                                 0x000000011d96670b 0x0 + 4791363339
2018-02-06 11:47:28.929 MyAZHealth[26280:1596858] critical: 	20  ???                                 0x000000011d4ff913 0x0 + 4786747667
2018-02-06 11:47:28.929 MyAZHealth[26280:1596858] critical: 	21  ???                                 0x000000011d948eec 0x0 + 4791242476
2018-02-06 11:47:28.929 MyAZHealth[26280:1596858] critical: 	22  ???                                 0x000000011d4d0923 0x0 + 4786555171
2018-02-06 11:47:28.929 MyAZHealth[26280:1596858] critical: 	23  ???                                 0x000000011d967e89 0x0 + 4791369353
2018-02-06 11:47:28.930 MyAZHealth[26280:1596858] critical: 	24  ???                                 0x000000011b61bc26 0x0 + 4754357286
2018-02-06 11:47:28.930 MyAZHealth[26280:1596858] critical: 	25  MyAZHealth                          0x000000010238e199 mono_jit_runtime_invoke + 1273
2018-02-06 11:47:28.930 MyAZHealth[26280:1596858] critical: 	26  MyAZHealth                          0x000000010244da48 do_runtime_invoke + 88
2018-02-06 11:47:28.930 MyAZHealth[26280:1596858] critical: 	27  MyAZHealth                          0x000000010244d9c0 mono_runtime_invoke + 208
2018-02-06 11:47:28.930 MyAZHealth[26280:1596858] critical: 	28  MyAZHealth                          0x000000010255eb2c xamarin_invoke_trampoline + 5996
2018-02-06 11:47:28.930 MyAZHealth[26280:1596858] critical: 	29  MyAZHealth                          0x00000001025669bd xamarin_arch_trampoline + 189
2018-02-06 11:47:28.931 MyAZHealth[26280:1596858] critical: 	30  MyAZHealth                          0x0000000102567e51 xamarin_x86_64_common_trampoline + 110
2018-02-06 11:47:28.931 MyAZHealth[26280:1596858] critical: 	31  Foundation                          0x0000000102b321e8 __NSThreadPerformPerform + 334
2018-02-06 11:47:28.931 MyAZHealth[26280:1596858] critical: 	32  CoreFoundation                      0x00000001074f4101 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
2018-02-06 11:47:28.931 MyAZHealth[26280:1596858] critical: 	33  CoreFoundation                      0x0000000107593f71 __CFRunLoopDoSource0 + 81
2018-02-06 11:47:28.931 MyAZHealth[26280:1596858] critical: 	34  CoreFoundation                      0x00000001074d8a19 __CFRunLoopDoSources0 + 185
2018-02-06 11:47:28.932 MyAZHealth[26280:1596858] critical: 	35  CoreFoundation                      0x00000001074d7fff __CFRunLoopRun + 1279
2018-02-06 11:47:28.932 MyAZHealth[26280:1596858] critical: 	36  CoreFoundation                      0x00000001074d7889 CFRunLoopRunSpecific + 409
2018-02-06 11:47:28.932 MyAZHealth[26280:1596858] critical: 	37  GraphicsServices                    0x000000010a3f59c6 GSEventRunModal + 62
2018-02-06 11:47:28.932 MyAZHealth[26280:1596858] critical: 	38  UIKit                               0x00000001031195d6 UIApplicationMain + 159
2018-02-06 11:47:28.933 MyAZHealth[26280:1596858] critical: 	39  ???                                 0x000000011c666768 0x0 + 4771440488
2018-02-06 11:47:28.933 MyAZHealth[26280:1596858] critical: 	40  ???                                 0x000000011c666393 0x0 + 4771439507
2018-02-06 11:47:28.933 MyAZHealth[26280:1596858] critical: 
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

@drunkendaddy
Copy link
Author

As a workaround I did this inside the async method and it is working. It'dbe good if you could fix the issue though.

private async Task ReLoadData()
{
var res = await GetActivityHistoryDetail(Constants.IOS);

  CalendarData = res.data;
  LoadCalendar();

  await Task.Run(() => {
       SelectDates();
  });

}

@MarcBruins
Copy link
Owner

It would be good if you could fix the issue, it's open source for a reason. I'm also not experiencing it and i don't have unlimited time to spend on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants