Bug 16796 - getting Houston... exception with xsp when using mod_mono module for apache 2.4 during file upload
Summary: getting Houston... exception with xsp when using mod_mono module for apache 2...
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: General (show other bugs)
Version: 2.10.x
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-12-13 23:10 UTC by Carl
Modified: 2014-10-10 14:22 UTC (History)
1 user (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
patch for mod_mono 2.10 for apache 2.4 (3.61 KB, patch)
2013-12-13 23:10 UTC, Carl
Details | Diff

Description Carl 2013-12-13 23:10:29 UTC
Created attachment 5659 [details]
patch for mod_mono 2.10 for apache 2.4

compiler:

architecture: x64
Bunutils: 2.20.1a
GCC: 4.6.4
eglibc: 2.13
GDB Server: 7.4.1
Arch: x86_64
Linux Kernel 3.2.51

Environment:

apr 1.5.0
apr-util 1.5.3
httpd 2.4.7
mono 2.10.8
libgdiplus 2.10
xsp 2.10.2
mod_mono 2.10

Details:

I applied a patch against mod_mono so that I can compile it with apache 2.4, will include that.

I have an asp.net website that allows you to upload a file.  The file is around 120 MB in size.  I am using the jquery qq-upload control to upload the file.  It shows the percentage as it is being uploaded.

I was getting an exception "Houston..." most of the time when the upload was very quick, since it was from a computer in the same network.  It also happens when the upload is slow sometimes, but never if the computer was a virtual machine.  Only if it was running on the hardware directly.

I found it was coming from this file:

xsp-2.10.2/src/Mono.WebServer.Apache/ModMonoRequest.cs

It came from this section of it:

public int GetClientBlock ([Out] byte [] bytes, int position, int size) 
{
	if (SetupClientBlock () != 0) return 0;

	/*
	 * turns out that that GET_CLIENT_BLOCK (ap_get_client_block) can
	 * return -1 if a socket is closed
	*/
	writer.Write ((int) ModMonoCmd.GET_CLIENT_BLOCK);
	writer.Write (size);
	Send ();
	
	FillBuffer (4);
	int i = reader.ReadInt32 ();
	if (i == -1)
		return -1;
	
	if (i > size)
		throw new Exception ("Houston...");

	FillBuffer ((uint)i);
	return reader.Read (bytes, position, i);
} 

When I included what values i and size are checking with, I got these results from 4 attempts:

GetClientBlock Exception (i>size): i = 960779623 size = 32768
GetClientBlock Exception (i>size): i = 1633895019 size = 32768
GetClientBlock Exception (i>size): i = 927229250 size = 32768
GetClientBlock Exception (i>size): i = 1817601579 size = 32768

So the variable i, never seems to be the same value when this happens.
Comment 1 Carl 2014-10-10 14:22:52 UTC
I have found that running xsp2 or xsp4 does not cause this exception to show up.  So the problem is definitely with the apache module mod_mono.

I want to use FastCGI to run mono, but there is no sample configurations out there.

Note You need to log in before you can comment on or make changes to this bug.