[Mono-bugs] [Bug 82145][Maj] Changed - Sharing Connection Causes Random Crashing Using SSL

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Aug 7 15:18:21 EDT 2007


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by sebastien at ximian.com.

http://bugzilla.ximian.com/show_bug.cgi?id=82145

--- shadow/82145	2007-08-06 14:15:44.000000000 -0400
+++ shadow/82145.tmp.16942	2007-08-07 15:18:21.000000000 -0400
@@ -1,12 +1,12 @@
 Bug#: 82145
 Product: Mono: Class Libraries
 Version: 1.2
 OS: unknown
 OS Details: 
-Status: REOPENED   
+Status: ASSIGNED   
 Resolution: 
 Severity: Unknown
 Priority: Major
 Component: Mono.Security
 AssignedTo: sebastien at ximian.com                            
 ReportedBy: rarpit at novell.com               
@@ -411,6 +411,36 @@
 
 p.s. I only see your own email address added on c.c.
 
 ------- Additional Comments From sebastien at ximian.com  2007-08-06 14:15 -------
 of course, like a true multithreaded bug, this works nicely when I
 enable the debugging logging inside Mono.Security... sigh
+
+------- Additional Comments From sebastien at ximian.com  2007-08-07 15:18 -------
+short story:
+
+Right now I'm up to 15100 cycles (still going) without the crash. 
+However I do, sometimes, get a deadlock when starting the sample
+(which didn't happen before). Once this is fixed I'll attach an
+updated Mono.Security.dll assembly to this bug so you can confirm this
+solve your problem (while I re-test existing code with the fix).
+
+long story:
+
+In the SSL/TLS code all operations are done async, which means it's
+all done in a (single!) background thread. So even if the sample uses
+multiple threads, that all ends up in the single background thread
+(btw I'm curious about the performance gains of using so many threads). 
+
+The problem is that the locks don't block the same thread from
+entering inside the critical sections. This isn't normally a problem,
+unless the sample code uses multi-threads over a single connection.
+
+Why ? because SSL/TLS is record based. So when a, or some, record(s)
+is/are received they are sent to caller. It is possible that a partial
+record was received too (and not sent to the caller because it can't
+be decrypted and verified). This data can be corrupted with multiple
+threads (data from another thread will be appended).
+
+The fix is to make sure we don't return if we have a partial record
+(which could have bad effects, at least memory wise).
+


More information about the mono-bugs mailing list