BUG: GPF on Session Expiration Using Active Server Pages

Last reviewed: December 11, 1997
Article ID: Q164495
The information in this article applies to:
  • Microsoft Active Server Pages, version 1.0

SYMPTOMS

Under certain circumstances, you may see a GPF when a session expires, or when Microsoft Internet Information Server is shut down.

CAUSE

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.

RESOLUTION

The best workaround for this problem is to avoid storing arrays of objects in Session variables.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Behavior

The following ASP page may cause the described error to occur when IIS is shut down or the session expires.

   PAGE1.ASP
   <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>

REFERENCES

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/

Keywords          : AXSFHTML kbprg kbbuglist
Version           : 1.00
Platform          : NT WINDOWS
Issue type        : kbbug


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: December 11, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.