[Mono-bugs] [Bug 76444][Blo] New - HttpRuntime.ProcessRequest hangup on 1.1.9.x win32 versions

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Oct 14 18:19:25 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 ice-k at amnesty.scene.pl.

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

--- shadow/76444	2005-10-14 18:19:25.000000000 -0400
+++ shadow/76444.tmp.25102	2005-10-14 18:19:25.000000000 -0400
@@ -0,0 +1,184 @@
+Bug#: 76444
+Product: Mono: Class Libraries
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Blocker
+Component: Sys.Web
+AssignedTo: gonzalo at ximian.com                            
+ReportedBy: ice-k at amnesty.scene.pl               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: HttpRuntime.ProcessRequest hangup on 1.1.9.x win32 versions
+
+after updating to the 1.1.9.x win32 mono version my host web server has
+strage behavior like
+1.
+Description: Error processing request.
+Error Message: HTTP 404. File not found 
+System.IO.FileNotFoundException
+C:\DOCUME~1\ice-k\USTAWI~1\Temp\ice-k-temp-aspnet-0\9a2f66ca\48130.dll :
+C:\DOCUME~1\ice-k\USTAWI~1\Temp\ice-k-temp-aspnet-0\9a2f66ca\48130.dll
+in <0x00000> <unknown method>
+... etc
+
+after some test case the next result
+2.
+stop on the method
+HttpRuntime.ProcessRequest(request);
+
+Steps to reproduce the problem:
+
+1. 
+create file test.aspx
+<%@ Page Language="C#" %>
+<script language="C#" runat=server>
+	void Page_Load (object sender, EventArgs e)
+	{
+		Response.Write("Hello World");
+	}
+</script>
+
+2. 
+use this code
+
+using System;
+using System.IO;
+using System.Text;
+using System.Web;
+using System.Web.Hosting;
+using System.Runtime.Remoting;
+using System.Globalization;
+using System.Threading;
+
+namespace AspNetTest
+{
+	class AspNet
+	{
+		public static object CreateApplicationHost(Type hostType, string
+virtualDir, string physicalDir) 
+		{
+
+			if (!(physicalDir.EndsWith("\\")))
+				physicalDir = physicalDir + "\\";
+
+			string aspDir = HttpRuntime.AspInstallDirectory;
+			string domainId =
+DateTime.Now.ToString(DateTimeFormatInfo.InvariantInfo).GetHashCode().ToString("x");
+			string appName = (virtualDir + physicalDir).GetHashCode().ToString("x");
+			string domain_id = "ASPHOST_" +
+DateTime.Now.ToString().GetHashCode().ToString("x");
+
+
+			AppDomainSetup setup = new AppDomainSetup();
+			setup.ApplicationName = appName;
+			setup.ConfigurationFile = "web.config";  // not necessary execept for
+debugging
+
+			setup.CachePath = null;
+			setup.ApplicationName = domain_id;
+			setup.DisallowCodeDownload = true;
+			setup.PrivateBinPath = "bin";
+			//setup.PrivateBinPathProbe = "*"; not working on Microsoft .NET
+			setup.ShadowCopyFiles = "true";
+
+			UriBuilder b = new UriBuilder ("file://", null, 0, Path.Combine
+(physicalDir, "bin"));
+			setup.ShadowCopyDirectories = b.Uri.ToString ();
+
+			string dynamic_dir = null;
+			string user = Environment.UserName;
+			for (int i = 0; ; i++){
+				string d = Path.Combine (Path.GetTempPath (),
+					String.Format ("{0}-temp-aspnet-{1:x}", user, i));
+			
+				try {
+					Directory.CreateDirectory (d);
+					string stamp = Path.Combine (d, "stamp");
+					Directory.CreateDirectory (stamp);
+					dynamic_dir = d;
+					Directory.Delete (stamp);
+					break;
+				} catch (UnauthorizedAccessException){
+					continue;
+				}
+
+			}
+			setup.DynamicBase = dynamic_dir;
+			Directory.CreateDirectory (setup.DynamicBase);
+	
+
+
+			AppDomain ad = AppDomain.CreateDomain(domainId, null, setup);
+			ad.SetData(".appDomain", "*");
+			ad.SetData(".appPath", physicalDir);
+			ad.SetData(".appVPath", virtualDir);
+			ad.SetData(".domainId", domainId);
+			ad.SetData(".hostingVirtualPath", virtualDir);
+			ad.SetData(".hostingInstallDir", aspDir);
+			ObjectHandle oh = ad.CreateInstance(hostType.Module.Assembly.FullName,
+hostType.FullName);
+			return oh.Unwrap();
+
+		}		
+	}			
+
+	public class MyHost : MarshalByRefObject 
+	{
+		public void ProcessRequest(String page) 
+		{
+			SimpleWorkerRequest request = new SimpleWorkerRequest(page, "",
+Console.Out);
+
+			HttpRuntime.ProcessRequest(request);
+
+			Thread.Sleep(2000);
+		}
+
+		public static void Main(String[] arguments) 
+		{
+			try
+			{
+			Console.WriteLine(Directory.GetCurrentDirectory());
+			MyHost host
+			
+			//= (MyHost)ApplicationHost.CreateApplicationHost(
+			= (MyHost)AspNet.CreateApplicationHost(
+				typeof(MyHost),"/Test",Directory.GetCurrentDirectory());
+
+			foreach (String page in arguments) 
+			{
+				host.ProcessRequest(page);
+			}
+			}
+			catch(Exception ex)
+			{
+				Console.WriteLine("EX:" + ex.Message);
+			}
+		}
+	}
+}
+3. 
+comiled as
+mcs Server.cs /r:System.Web.dll
+mono Server.exe test.aspx
+
+Actual Results:
+no responde
+stoped on the ProcessRequest
+
+Expected Results:
+Hello World
+
+How often does this happen? 
+since mono 1.1.9.x
+on mono 1.1.7 all is fine and m$ .net too
+
+Additional Information:
+tested on win32 platform 
+not tested on Linux/Unix


More information about the mono-bugs mailing list