[Mono-bugs] [Bug 81749][Maj] New - mod-mono-server2 crashes (w/ workaround)

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sun May 27 15:00:01 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 mmorano at mikeandwan.us.

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

--- shadow/81749	2007-05-27 15:00:01.000000000 -0400
+++ shadow/81749.tmp.22808	2007-05-27 15:00:01.000000000 -0400
@@ -0,0 +1,119 @@
+Bug#: 81749
+Product: Mono: Class Libraries
+Version: 1.2
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: Sys.Web
+AssignedTo: mhabersack at novell.com                            
+ReportedBy: mmorano at mikeandwan.us               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: mod-mono-server2 crashes (w/ workaround)
+
+I recently updated mono/mcs/xsp/mod_mono from svn and afterwards my website
+no longer worked via apache/mod_mono, however it would still work properly
+when accessed via xsp2.
+
+After restarting all the processes, I could see mod-mono-server2 properly
+established and awaiting requests.  However, when I made the first request
+to the site, fairly quickly the process would die.  I was eventually able
+to run the process manually by setting MonoRunXSP to false, and saw that it
+was segfaulting.
+
+I then ran the process manually with tracing enabled using the following
+command:
+
+MONO_OPTIONS="--trace=T:Mono.WebServer.MonoWorkerRequest,Mono.WebServer.ModMonoWorkerRequest,T:System.Web.Configuration.WebConfigurationManager,T:System.Web.Util.WebEncoding,T:System.Web.Configuration.GlobalizationSection,T:System.Web.Compilation.AppCodeCompiler,T:System.Web.HttpApplicationFactory,T:System.Web.HttpRequest"
+/usr/local/bin/mod-mono-server2 --filename /tmp/mod_mono_server_maw
+--applications www.mikeandwan.us:/:/usr/share/webapps/mikeandwan_us
+--nonstop --root /usr/share/webapps/mikeandwan_us > x.txt
+
+The output (sample is attached after this post) illustrates an issue with
+resolving the Path for the request, and appears to be associated with how
+the system tries to identify the Encoding to use (causes infinite loop).
+
+Anyways, I have been able to work around this issue for now by adding the
+following method to ModMonoWorkerRequest.cs in the xsp tree:
+
+
+        public override byte [] GetQueryStringRawBytes ()
+        {
+            if (queryString == null || queryString.Length == 0)
+                return null;
+
+            return Encoding.GetBytes (queryString);
+        }
+
+
+This was modeled after the same method that is in XSPWorkerRequest, but
+introduces a check so if the length of the querystring is 0, this returns null.
+
+I'm sure this is probably not the correct fix, but it does get around the
+problem for me, and it is not clear to me where to appropriately fix this
+issue.  I was also curious if this is somehow specific to how I have Apache
+configured for this virtual host, which follows below:
+
+
+<VirtualHost *:80>
+    ServerName www.mikeandwan.us
+    ServerAdmin mmorano at mikeandwan.us
+    DocumentRoot "/usr/share/webapps/mikeandwan_us"
+
+    Include conf/mod_mono.conf
+    MonoDocumentRootDir maw "/usr/share/webapps/mikeandwan_us"
+    MonoApplications maw "www.mikeandwan.us:/:/usr/share/webapps/mikeandwan_us"
+    MonoServerPath maw "/usr/local/bin/mod-mono-server2"
+
+    #MonoRunXSP maw false
+    #MonoDebug maw true
+    #MonoUnixSocket maw "/tmp/mod_mono_www.mikeandwan.us"
+
+    SetOutputFilter DEFLATE
+
+    ErrorLog /var/log/apache2/mikeandwan_error.log
+    TransferLog /var/log/apache2/mikeandwan_access.log
+
+    <IfModule mod_rewrite.c>
+        RewriteEngine on
+        RewriteCond %{REQUEST_METHOD} !^(GET|POST|HEAD)$
+        RewriteRule .* - [F]
+    </IfModule>
+
+    <Directory "/usr/share/webapps/mikeandwan_us">
+        MonoSetServerAlias maw
+        #AddHandler mono .aspx .ascx .asax .ashx .config .cs .asmx .axd
+        SetHandler mono
+
+        <FilesMatch "\.(gif|jp?g|png|css|ico|xsl|wmv|zip)$">
+            SetHandler None
+        </FilesMatch>
+
+        Options Indexes FollowSymLinks
+        #DirectoryIndex index.aspx
+        AllowOverride None
+        Order allow,deny
+        Allow from all
+    </Directory>
+
+    <IfDefine INFO>
+        <Location /mono>
+            SetHandler mono-ctrl
+            Order deny,allow
+            Deny from all
+            Allow from 127.0.0.1
+        </Location>
+    </IfDefine>
+</VirtualHost>
+
+
+Let me know if there is anything else that would be useful to track this
+down, it's taken me a bit of time to get this far...
+
+
+Thanks!


More information about the mono-bugs mailing list