Bug 56394 - App crash in 10.10.0.33 using ical.net library
Summary: App crash in 10.10.0.33 using ical.net library
Status: RESOLVED UPSTREAM
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: XI 10.10 (d15-2)
Hardware: PC Mac OS
: Normal normal
Target Milestone: Future Cycle (TBD)
Assignee: Sebastien Pouliot
URL:
Depends on:
Blocks:
 
Reported: 2017-05-13 17:53 UTC by danmiser
Modified: 2017-05-16 01:11 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Sample Xamarin iOS app to demonstrate app crash in 10.10.0.33 (10.50 KB, application/zip)
2017-05-13 17:53 UTC, danmiser
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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.

Related Links:
Status:
RESOLVED UPSTREAM

Description danmiser 2017-05-13 17:53:21 UTC
Created attachment 22158 [details]
Sample Xamarin iOS app to demonstrate app crash in 10.10.0.33

1. In Xamarin Studio 6.3, install iOS 10.8.0.175
2. Run the attached project in the iPhone 6s iOS 10.3 Simulator. 
//Expected: App runs, and displays a message
//Actual: Everything works fine

3. Upgrade Xamarin Studio 6.3 to install iOS 10.10.0.33
4. Run the attached project in the iPhone 6s iOS 10.3 Simulator. 
//Expected: App runs, and displays a message
//Actual:App crashes with no output information
Comment 1 Sebastien Pouliot 2017-05-15 21:10:17 UTC
Something is causing endless recursion and it's eventually crashing the process.

Process:               CalendarCrash [55588]
Path:                  /Users/USER/Library/Developer/CoreSimulator/Devices/B7EB3CEB-B80E-4D2C-A21C-7AF73B731F97/data/Containers/Bundle/Application/EDDCB7C1-CFB5-4E74-AC75-38DAB796D8F4/CalendarCrash.app/CalendarCrash
Identifier:            CalendarCrash
Version:               1.0 (1.0)
Code Type:             X86-64 (Native)
Parent Process:        launchd_sim [55481]
Responsible:           CalendarCrash [55588]
User ID:               501

Date/Time:             2017-05-15 17:03:35.328 -0400
OS Version:            Mac OS X 10.12.4 (16E195)
Report Version:        12
Anonymous UUID:        367BB065-24C6-B4A0-130A-B8FEFE750672

Sleep/Wake UUID:       5CD35C43-42B6-4765-A523-CA8736E9787E

Time Awake Since Boot: 2500000 seconds
Time Since Wake:       1300 seconds

System Integrity Protection: enabled

Crashed Thread:        0  tid_403  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_PROTECTION_FAILURE at 0x00007fff5c4c7ff0
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [0]

VM Regions Near 0x7fff5c4c7ff0:
    MALLOC_SMALL           00007fa832000000-00007fa832800000 [ 8192K] rw-/rwx SM=PRV  
--> STACK GUARD            00007fff58cc8000-00007fff5c4c8000 [ 56.0M] ---/rwx SM=NUL  stack guard for thread 0
    Stack                  00007fff5c4c8000-00007fff5ccc8000 [ 8192K] rw-/rwx SM=COW  thread 0

Application Specific Information:
CoreSimulator 375.21 - Device: iPhone 6s - Runtime: iOS 10.3 (14E269) - DeviceType: iPhone 6s

Thread 0 Crashed:: tid_403  Dispatch queue: com.apple.main-thread
0   ???                           	0x00000001237b4704 0 + 4890248964
1   ???                           	0x0000000126f2a906 0 + 4948404486
2   ???                           	0x0000000126f2a906 0 + 4948404486
3   ???                           	0x0000000126f2a906 0 + 4948404486
4   ???                           	0x0000000126f2a906 0 + 4948404486
5   ???                           	0x0000000126f2a906 0 + 4948404486
6   ???                           	0x0000000126f2a906 0 + 4948404486
7   ???                           	0x0000000126f2a906 0 + 4948404486
8   ???                           	0x0000000126f2a906 0 + 4948404486
9   ???                           	0x0000000126f2a906 0 + 4948404486
10  ???                           	0x0000000126f2a906 0 + 4948404486
11  ???                           	0x0000000126f2a906 0 + 4948404486
12  ???                           	0x0000000126f2a906 0 + 4948404486
...
511 ???                           	0x0000000126f2a906 0 + 4948404486

Thread 1:: Dispatch queue: com.apple.libdispatch-manager
0   libsystem_kernel.dylib        	0x000000010edafdc6 kevent_qos + 10
1   libdispatch.dylib             	0x000000010ea44624 _dispatch_mgr_wait_for_event + 66
2   libdispatch.dylib             	0x000000010ea3e4b6 _dispatch_mgr_invoke + 197
3   libdispatch.dylib             	0x000000010ea3e2eb _dispatch_mgr_thread + 54

Thread 2:
0   libsystem_kernel.dylib        	0x000000010edaf44e __workq_kernreturn + 10
1   libsystem_pthread.dylib       	0x000000010eeb9695 _pthread_wqthread + 1426
2   libsystem_pthread.dylib       	0x000000010eeb90f1 start_wqthread + 13

Thread 3:
0   libsystem_kernel.dylib        	0x000000010edaedf6 __recvfrom + 10
1   com.routexcel.calendarcrash   	0x0000000103268002 recv_uninterrupted(int, void*, int) + 66
2   com.routexcel.calendarcrash   	0x00000001032682b7 monotouch_process_connection(int) + 119
3   com.routexcel.calendarcrash   	0x0000000103267b32 monotouch_connect_wifi(NSMutableArray*) + 2706
4   com.routexcel.calendarcrash   	0x00000001032667af monotouch_configure_debugging + 3327
5   com.routexcel.calendarcrash   	0x000000010325c181 -[CocoaThreadInitializer entryPoint:] + 97
6   com.apple.Foundation          	0x00000001043e5fb1 __NSThread__start__ + 1197
7   libsystem_pthread.dylib       	0x000000010eeb99af _pthread_body + 180
8   libsystem_pthread.dylib       	0x000000010eeb98fb _pthread_start + 286
9   libsystem_pthread.dylib       	0x000000010eeb9101 thread_start + 13

Thread 4:: SGen worker
0   libsystem_kernel.dylib        	0x000000010edaebf2 __psynch_cvwait + 10
1   libsystem_pthread.dylib       	0x000000010eeba86e _pthread_cond_wait + 712
2   com.routexcel.calendarcrash   	0x0000000103229a2e thread_func + 638
3   libsystem_pthread.dylib       	0x000000010eeb99af _pthread_body + 180
4   libsystem_pthread.dylib       	0x000000010eeb98fb _pthread_start + 286
5   libsystem_pthread.dylib       	0x000000010eeb9101 thread_start + 13

Thread 5:: Finalizer
0   libsystem_kernel.dylib        	0x000000010eda7386 semaphore_wait_trap + 10
1   com.routexcel.calendarcrash   	0x00000001031143df finalizer_thread + 271
2   com.routexcel.calendarcrash   	0x00000001031bbef0 start_wrapper + 320
3   com.routexcel.calendarcrash   	0x0000000103240b7d inner_start_thread + 189
4   libsystem_pthread.dylib       	0x000000010eeb99af _pthread_body + 180
5   libsystem_pthread.dylib       	0x000000010eeb98fb _pthread_start + 286
6   libsystem_pthread.dylib       	0x000000010eeb9101 thread_start + 13

Thread 6:: Debugger agent
0   libsystem_kernel.dylib        	0x000000010edaedf6 __recvfrom + 10
1   com.routexcel.calendarcrash   	0x0000000103268002 recv_uninterrupted(int, void*, int) + 66
2   com.routexcel.calendarcrash   	0x000000010326810e sdb_recv(void*, int) + 46
3   com.routexcel.calendarcrash   	0x0000000103002036 debugger_thread + 470
4   com.routexcel.calendarcrash   	0x0000000103240b7d inner_start_thread + 189
5   libsystem_pthread.dylib       	0x000000010eeb99af _pthread_body + 180
6   libsystem_pthread.dylib       	0x000000010eeb98fb _pthread_start + 286
7   libsystem_pthread.dylib       	0x000000010eeb9101 thread_start + 13

Thread 7:: tid_320b
0   libsystem_kernel.dylib        	0x000000010edaef46 __semwait_signal + 10
1   libsystem_c.dylib             	0x000000010eb60144 nanosleep + 199
2   libsystem_c.dylib             	0x000000010eb60038 usleep + 53
3   com.routexcel.calendarcrash   	0x000000010325f170 pump_gc(void*) + 64
4   libsystem_pthread.dylib       	0x000000010eeb99af _pthread_body + 180
5   libsystem_pthread.dylib       	0x000000010eeb98fb _pthread_start + 286
6   libsystem_pthread.dylib       	0x000000010eeb9101 thread_start + 13

Thread 8:
0   libsystem_kernel.dylib        	0x000000010edaf44e __workq_kernreturn + 10
1   libsystem_pthread.dylib       	0x000000010eeb9695 _pthread_wqthread + 1426
2   libsystem_pthread.dylib       	0x000000010eeb90f1 start_wqthread + 13

Thread 9:: com.apple.uikit.eventfetch-thread
0   libsystem_kernel.dylib        	0x000000010eda734a mach_msg_trap + 10
1   libsystem_kernel.dylib        	0x000000010eda6797 mach_msg + 55
2   com.apple.CoreFoundation      	0x000000010385c2e4 __CFRunLoopServiceMachPort + 212
3   com.apple.CoreFoundation      	0x000000010385b7a9 __CFRunLoopRun + 1337
4   com.apple.CoreFoundation      	0x000000010385b016 CFRunLoopRunSpecific + 406
5   com.apple.Foundation          	0x00000001043d6480 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 274
6   com.apple.Foundation          	0x000000010445bae9 -[NSRunLoop(NSRunLoop) runUntilDate:] + 87
7   com.apple.UIKit               	0x0000000107c55931 -[UIEventFetcher threadMain] + 118
8   com.apple.Foundation          	0x00000001043e5fb1 __NSThread__start__ + 1197
9   libsystem_pthread.dylib       	0x000000010eeb99af _pthread_body + 180
10  libsystem_pthread.dylib       	0x000000010eeb98fb _pthread_start + 286
11  libsystem_pthread.dylib       	0x000000010eeb9101 thread_start + 13

Thread 10:
0   libsystem_kernel.dylib        	0x000000010edaf44e __workq_kernreturn + 10
1   libsystem_pthread.dylib       	0x000000010eeb9695 _pthread_wqthread + 1426
2   libsystem_pthread.dylib       	0x000000010eeb90f1 start_wqthread + 13

Thread 11:
0   libsystem_kernel.dylib        	0x000000010edaf44e __workq_kernreturn + 10
1   libsystem_pthread.dylib       	0x000000010eeb9695 _pthread_wqthread + 1426
2   libsystem_pthread.dylib       	0x000000010eeb90f1 start_wqthread + 13

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x00000001237837e0  rbx: 0x0000000000000000  rcx: 0x0000000123a53480  rdx: 0x00007fa82fb2acc8
  rdi: 0x00000001237837e0  rsi: 0x000000012376ce00  rbp: 0x00007fff5c4c8250  rsp: 0x00007fff5c4c7ff0
   r8: 0x000000010341d308   r9: 0x0000000000000000  r10: 0x00006000006aaf20  r11: 0x00000001237b4700
  r12: 0x0000000000000000  r13: 0x00000001238e3850  r14: 0x0000000000000000  r15: 0x000000012376ce00
  rip: 0x00000001237b4704  rfl: 0x0000000000010206  cr2: 0x00007fff5c4c7ff0
  
Logical CPU:     3
Error Code:      0x00000006
Trap Number:     14
Comment 2 Sebastien Pouliot 2017-05-15 21:26:38 UTC
> var list = calendar.GetOccurrences<IEvent>(startDate, endDate);

^ this is the last line executed before getting into the library code

This match an existing bug report for the library too:

> [.NET Core] GetOccurrences caused a StackOverflow error.
> https://github.com/rianjs/ical.net/issues/257

My guess is that mono BCL has picked up a behaviour change (from .net core) that trigger this issue.

You're in luck since it seems this was just fixed upstream (2 hours ago)
https://github.com/thoemy/ical.net/commit/917579252cb1d998f56ba7a95867a7afa3ab5bd6

so you should be able to upgrade to the fixed library soon.
Comment 3 danmiser 2017-05-16 00:48:27 UTC
What I don't get is why the change between 10.8 and 10.10. I have been using the 2.3.1 version of ical.net because it's the only version that supported mono touch. Upgrading to the latest 3.x version of the library means switching to core. So is there something more to this on the Xamarin side that changed and should be looked at?
Comment 4 Sebastien Pouliot 2017-05-16 01:11:37 UTC
Why ? netstandard (and sharing code). The goal is to have libraries that are not tied anymore to a specific platform (like core or monotouch). Many libraries already target netstandard 1.6 (or the new 2.0) because it's easier and has greater reach to customers.

To achieve this the Mono BCL is in the process of sharing a lot more code with reference sources (past) and now with .net core and corefx. That has increased Mono compatibility and performance but it also introduce some, mostly harmless, changes / difference from previous mono releases.

p.s. I hope your library author will soon make the switch. You might want to apply the same fix to the older version you're using until then.