Async/await and concurrent network code

BenDodsonBenDodson USMember ✭✭

I have some highly concurrently network code that makes heavy use of async/await. It runs fine on xamarin.ios and monomac. But when I run the code on (Version: 4.7.4 (Indie Edition)), I get a SIGSEGV about 7 times out of 10.

Interestingly, there's a line of code I've toggled on and off, which should do nothing more than add another network connection into the mix. When the line is enabled, I see the crash frequently, and when it's disabled, I rarely crash at all.

Another curious data point is that right around when the SIGSEGV hits, one of the network connections excepts with a "connection reset by peer". What's interesting is we would be much more likely to encounter this exception on the other network connection, so I was wondering if it was at all possible for the tasks generated by async/await to be getting mixed up.

The SIGSEGV is often paired with this exception, but not always:

E/mono-rt (19336): Stacktrace:
E/mono-rt (19336):
F/ (19336): * Assertion at /Users/builder/data/lanes/monodroid-mlion-mast
er/f6831347/source/mono/mono/mini/mini-exceptions.c:814, condition `domain' not
I/ActivityManager( 143): Process App.Android (pid 19336) has died.


Sign In or Register to comment.