[mono-android] Random exceptions while reading SSL stream
Andrew Sinclair
andrew at magic5software.com
Thu Nov 17 04:41:18 EST 2011
Piotr,
This sounds like exactly the same problem as:
http://bugzilla.xamarin.com/show_bug.cgi?id=1394
http://bugzilla.xamarin.com/show_bug.cgi?id=1741
http://bugzilla.xamarin.com/show_bug.cgi?id=1534
http://bugzilla.xamarin.com/show_bug.cgi?id=1031
plus the “Mono Stacktrace and ANR” e-mail sent to the list yesterday.
I’ve only seen this type of thing since 1.2.0 and it also happens with 1.9.*. Prior to 1.2 there seemed to be many more GC-related bugs but maybe they just hid this one (or maybe it’s the knock-on effect of a fix.)
Xamarin people -> any idea when this will be fixed? The bugzilla bugs are quiet. I can’t imagine there’s a more important problem for you to be fixing because it causes random hangs in all sorts of applications and there isn’t a workaround for the developer. I’d be happy to trade all of the new functionality in 2.x for a fix to this one and a stable runtime!!
Cheers,
Andy
From: monodroid-bounces at lists.ximian.com [mailto:monodroid-bounces at lists.ximian.com] On Behalf Of Piotr Kryger
Sent: 17 November 2011 09:24
To: Discussions related to Mono for Android
Subject: [mono-android] Random exceptions while reading SSL stream
Hi,
Im trying to read binary data from ssl stream.
Basically, I do this:
Stream inner = ConnectToMyHttpsServerAndGetStream();
SslStream sslStream = new SslStream(inner, false, null, null);
sslStream.AuthenticateAsClient(certificateServerName);
BinaryReader reader = new BinaryReader(sslStream);
//calls to reader methods go here
reader.Close();
Most of the time, code runs fine, but sometimes during reading operations my app freezes. Log shows following (or similar) stacktrace:
11-17 09:28:20.084 I/mono (24066): Stacktrace:
11-17 09:28:20.084 I/mono (24066):
11-17 09:28:20.084 I/mono (24066): at Mono.Security.Protocol.Tls.CipherSuite.DecryptRecord (byte[],byte[]&,byte[]&) <0x000e3>
11-17 09:28:20.125 I/mono (24066): at Mono.Security.Protocol.Tls.RecordProtocol.decryptRecordFragment (Mono.Security.Protocol.Tls.ContentType,byte[]) <0x0006b>
11-17 09:28:20.125 I/mono (24066): at Mono.Security.Protocol.Tls.RecordProtocol.InternalReceiveRecordCallback (System.IAsyncResult) <0x001b7>
11-17 09:28:20.125 I/mono (24066): at System.IO.Stream.BeginRead (byte[],int,int,System.AsyncCallback,object) <0x00117>
11-17 09:28:20.125 I/mono (24066): at Mono.Security.Protocol.Tls.RecordProtocol.BeginReceiveRecord (System.IO.Stream,System.AsyncCallback,object) <0x0016f>
11-17 09:28:20.125 I/mono (24066): at Mono.Security.Protocol.Tls.RecordProtocol.ReceiveRecord (System.IO.Stream) <0x00023>
11-17 09:28:20.125 I/mono (24066): at Mono.Security.Protocol.Tls.SslStreamBase.InternalReadCallback (System.IAsyncResult) <0x002a3>
11-17 09:28:20.125 I/mono (24066): at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object (object,intptr,intptr,intptr) <0xffffffff>
The more data is read, the more frequent the exception tends to be.
Is there anything I can do to workaround this issue? Or maybe Im doing something wrong?
Im using M4A 1.2 and VS2010.
Thanks,
Piotr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/monodroid/attachments/20111117/306bc0b9/attachment-0001.html
More information about the Monodroid
mailing list