[Mono-bugs] [Bug 76254][Nor] New - Infinite loop entered on server during SSL handhake.

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Wed Sep 28 02:16:34 EDT 2005

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 imoir at templetech.com.


--- shadow/76254	2005-09-28 02:16:34.000000000 -0400
+++ shadow/76254.tmp.21885	2005-09-28 02:16:34.000000000 -0400
@@ -0,0 +1,74 @@
+Bug#: 76254
+Product: Mono: Class Libraries
+Version: 1.1
+OS: unknown
+OS Details: Mandrake 9.2 and a realtime linux based on kernel 2.4
+Status: NEW   
+Priority: Normal
+Component: Mono.Security
+AssignedTo: sebastien at ximian.com                            
+ReportedBy: imoir at templetech.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: Infinite loop entered on server during SSL handhake.
+This problem has been seen in two different situations, only one of which
+is well understood. I have been doing my investigating on mono 1.1.5, but I
+have also tried on and the problem still exists there. The files
+required to reproduce this bug are attached to this bug report. To
+reproduce this bug, follow these steps:
+1. Copy the attached files to a directory on a linux box with mono installed.
+2. Build the test app using the bld script ( i.e. run './bld' )
+3. Run the test app with 'mono IPTest.exe'
+4. Copy the 'IPTest.html' file to a Windows box on the same network
+5. Edit the 'IPTest.html' file to replace the '' ip address
+with the ip address of the linux box on which the test app is run
+6. Open the 'IPTest.html' file in Windows Explorer ( does not worked well
+in firefox )
+7. Press the 'Submit' button and go throught the process of accepting the
+certificate, until and XML doc with <ReflectQuery> is loaded
+8. Press the back button
+9. Press the space bar 3 times VERY quickly ( as quickly as possible ), to
+do three quick submits
+10. Use the 'top' command on the linux box to see if any threads are
+hogging the CPU. There could be one or two threads caught in an infinite loop.
+Two quick hits of the space bar will sometimes produce a single thread in
+an infinite loop, but three hits will nearly always produce on or two
+threads in infinite loops.
+This occurs on both versions 1.1.5 and of mono. In 1.1.5, doing a
+control-C will usually exit the app, and the scenario can be started again
+by running 'mono IPTest.exe', and using the same instance of Windows
+Explorer. The behaviour in is a bit worse because more threads seem
+to go into infinite loops, and a control-C will not always exit the app. A
+'kill -9' has to be used, and in some cases, individual threads that did
+not exit with the 'kill -9' had to be killed individually before the app
+could be run again.
+From the point of view of the app, incomming requests are handled in the
+HTTPServer class, and are spun off into one of up to 5 threads implemented
+in the HTTPProcessor class. In the threads that go into infinite loops, the
+calls to reader.Read() in HTTPProcessor.SafeReadLine() never returns.
+I have tracked down the loop that the thread never escapes from. It is in
+the SslServerStream class in
+mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs. In
+the doHandshake() method, the thread never escapes the following loop:
+while (this.context.LastHandshakeMsg != HandshakeType.Finished)
+  this.protocol.ReceiveRecord();
+My impression is that if the client does not complete the handshake, the
+server code will sit in an active loop waiting indefinitely for the
+handshake to complete. Netstat seems to indicate that there is no active
+connection, even as the thread continues to loop. The Ethereal network
+sniffer ( run on Windows ) seems to indicate that this happens when the
+client stops the handshake process after it has started.

More information about the mono-bugs mailing list