BUG: GPF on Session Expiration Using Active Server PagesID: Q164495
|
Under certain circumstances, you may see a Genereral Protection Fault (GPF) when a session expires, or when Microsoft Internet Information Server is shut down.
This error is caused by a reference counting problem in Active Server Pages (ASP, which can occur if you attempt store an array containing objects in a Session variable. Consider the code example below:
dim Arr(1)
Arr(0) = Server.CreateObject("My Object")
Session("MyVar") = Arr
When the session ends, or is terminated by an Internet Information Server
shutdown, the object pointer is released. In addition, VariantClear() is
called on the Variant containing the array "Arr". This results in a second
attempt to release the object pointer stored in "Arr", and thus a GPF.
The best workaround for this problem is to avoid storing arrays of objects in Session variables.
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.
<HTML>
<HEAD><TITLE>Document Title</TITLE></HEAD>
<BODY>
<%
Dim MyArray(2)
Set MyArray(1) = Server.CreateObject("ADODB.Connection")
Set MyArray(2) = Server.CreateObject("ADODB.Connection")
Session("SessionAry") = MyArray
%>
</BODY>
</HTML>
For the latest Knowledge Base articles and other support information on Visual InterDev and Active Server Pages, see the following page on the Microsoft Technical Support site:
http://support.microsoft.com/support/vinterdev/
Additional query words:
Keywords : kbprg kbsample kbASP kbASPObj kbVBScript kbWebServer kbGrpASP
Version : winnt:
Platform : winnt
Issue type : kbbug
Last Reviewed: May 27, 1999