[Mono-bugs] [Bug 67355][Wis] Changed - [PATCH] XSP exposes a socket bug

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Thu, 14 Oct 2004 02:05:24 -0400 (EDT)


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 grompf@sublimeintervention.com.

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

--- shadow/67355	2004-10-14 00:28:13.000000000 -0400
+++ shadow/67355.tmp.19723	2004-10-14 02:05:24.000000000 -0400
@@ -11,13 +11,13 @@
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: grompf@sublimeintervention.com               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
 URL: 
 Cc: 
-Summary: [PPC] XSP has a jit bug which causes failures
+Summary: [PATCH] XSP exposes a socket bug
 
 Running xsp / mod_mono on HEAD is currently failing due to a jit bug.
 
 I believe this is a similar one to the last stack (un)winding.  The call that is being improperly 
 handled is in XSPApplicationHost.cs:
 
@@ -67,6 +67,38 @@
                                         timeouts.Remove (s);
 +                                       s.Blocking = true;
                                         IWorker worker = webSource.CreateWorker (s, this);
                                         ThreadPool.QueueUserWorkItem (new WaitCallback 
 (worker.Run));
                                 }
+
+------- Additional Comments From grompf@sublimeintervention.com  2004-10-14 02:05 -------
+This is definately not a jit bug; I've tracked the problem down to a socket bug.  On linux 
+sockets from an accept () call have default flags.  On Darwin (possibly other BSDs?) they 
+inherit the listeners flags.  Run the following program on linux and you will get (http://
+cvs.apache.org/~jorton/nonblock.c):
+
+plasma@calvin:~$ uname -a 
+Linux calvin 2.4.6 #7 SMP Wed Mar 20 14:22:11 EST 2002 i686 unknown
+plasma@calvin:~$ ./nonblock 
+found port: 1184
+O_NONBLOCK is not set in the child.
+
+Run it on OSX and you get:
+junglist:~ plasma$ uname -a
+Darwin junglist.local 7.5.0 Darwin Kernel Version 7.5.0: Thu Aug  5 19:26:16 PDT 2004; 
+root:xnu/xnu-517.7.21.obj~3/RELEASE_PPC  Power Macintosh powerpc
+junglist:~ plasma$ ./nonblock 
+found port: 64916
+
+As a result you can see that the NONBlocking listener in XSP when accepting a new 
+connection is defaulting to nonblocking on osx.  This behaviour is incorrect.
+
+Proposed patch attached
+
+Could someone with Net/Free/Dragonfly BSD please check to see what happens with 
+socket flags (I dont have one to test on)?
+
+Perhaps the #ifdef __APPLE__ should be a #ifdef __APPLE__ || __BSD__
+
+-kangaroo
+