Connecting Tech Pros Worldwide Forums | Help | Site Map

ASP.NET web application sometimes does not respond

Ger Ger is offline
Newbie
 
Join Date: Feb 2007
Posts: 5
#1: Oct 29 '08
I'm writing an ASP.NET 2.0 web application in JScript.NET. It exchanges JSON messages with an AJAX client via HTTP POST.

This app runs flawlessly in local IIS 5.1 and in Visual Studio's ASP.NET Development Server (Cassini). However, on the IIS 6 production server, some requests fail (e.g. the user can't save the data s/he entered, but the exact same data can be saved in a local test).

I upload the app precompiled (ie. it compiles with 0 errors). The server definitely receives the POST request (I write out the request body to a log file), but then it fails (Charles reports: no response headers; i.e. no output is sent - xml http request status=0). I'm in trouble in reproducing this, because all is flawless in the local tests, but I don't have IIS 6.

One cause I suspect is timeout. This is a shared web hosting account, httpResponse executionTimeout=30 sec. However, when I deliberately set the timeout in a local test to like 3 seconds to force a failure, I receive a HTTP 500 internal server error, while on the IIS6 server I get xml http request status=0 (i.e. really no output is sent to the client).

How to figure out what happens? I'd really appreciate any ideas or tips.

Ger Ger is offline
Newbie
 
Join Date: Feb 2007
Posts: 5
#2: Nov 3 '08

re: ASP.NET web application sometimes does not respond


Guys, I still need help. Anyone please rescue me ;)

So there's a large JScript.NET DLL running on IIS6. It seems that if the app grows beyond a certain size, it hits some wall on that server. Some calls fail, some succeed. A small request (e.g. just posting a message to the server log) always works. A large request (a complex calculator calling 100s of kilobytes of code) will just fail. If I remove some code, everything works. The server admin told that executionTimeout is 30s. However, the calls fail in just like 3 seconds.

Any ideas? Is there some other timeout / size limitation / memory limitation setting in IIS that I overlooked? Or is it rather something JScript.NET specific?
Ger Ger is offline
Newbie
 
Join Date: Feb 2007
Posts: 5
#3: Nov 17 '08

re: ASP.NET web application sometimes does not respond


I managed to get hold of a Windows Server 2003 myself so that I can see the event log. It's IIS6 and ASP.NET 2.0. An error with event id = 1000 happens:

Error Properties

Type: Error
Source: .NET Runtime 2.0 Error
Category: None
Event ID: 1000

Description:

Faulting application w3wp.exe, version 6.0.3790.3959, stamp 45d6968e, faulting module kernel32.dll, version 5.2.3790.3959, stamp 45d70ad8, debug? 0, fault address 0x0000bee7.
Ger Ger is offline
Newbie
 
Join Date: Feb 2007
Posts: 5
#4: Dec 9 '08

re: ASP.NET web application sometimes does not respond


Just posting in case this helps someone. I found a workaround. The crash was related to a few valid but very large JavaScript arrays.

Quote:
var PostcodeTownIndex1=[[2000,2443],[2009,2062]]; // crashes
There is a short array of 2 elements in the example code above. This obviously does run without any problems. However, assume that problems do arise with around 3500 elements. The same problem also comes up with other kinds of large statements, such as a large array of strings.

The crash can be avoided by replacing standard JavaScript var statements with JScript.NET-specific typed var statements. Example:

Quote:
var PostcodeTownIndex1:uint[][]=[[2000,2443],[2009,2062]]; // works
The crash only occurs on IIS6 and IIS7 and not on IIS5.1 or Cassini, so it can not be located on an XP developer PC. So I had to install Windows Server 2003 and Visual Studio on a PC for testing. When the code is started in Visual Studio with debugging enabled, a System.StackOverflowException occured in Microsoft.JScript.dll. I managed to locate the cause by modifying the code and testing with VS debugger. I also tried DebugDiag, but it did not take me much ahead in this case.
Frinavale's Avatar
Site Moderator
 
Join Date: Oct 2006
Location: The Great White North
Posts: 5,131
#5: Dec 9 '08

re: ASP.NET web application sometimes does not respond


I think that you have more than one problem here.

JavaScript does not cause Server Side errors.

Especially ones that have an error message like:
Quote:
Faulting application w3wp.exe
I would check your app pools have the correct permissions required in order to process the request.

I would also check to make sure that you are properly handling the array (created through JavaScript) in your Server Side code. If your Server Side code is not allocating enough memory to handle this array your application may be attempting accessing memory that it is not allowed to access.

-Frinny
Reply