Microsoft Knowledge Base Email Alertz

(164495) - Under certain circumstances, you may see a Genereral Protection Fault (GPF) when a session expires, or when Microsoft Internet Information Server is shut down.

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 164495 - Last Review: May 2, 2006 - Revision: 4.1

FIX: GPF on Session Expiration Using Active Server Pages

This article was previously published under Q164495

On This Page

SYMPTOMS

Under certain circumstances, you may see a Genereral Protection Fault (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("MyProgID.MyClassId")
   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 that this is a bug in the Microsoft products that are listed at the beginning of this article.

This bug was corrected in Windows 2000.

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/search/default.aspx?qu=vinterdev (http://support.microsoft.com/search/default.aspx?qu=vinterdev)

APPLIES TO
  • Microsoft Active Server Pages 4.0
  • Microsoft Internet Information Server 4.0
Keywords: 
kbaspobj kbbug kbfix kbiis500fix kboswin2000fix kbwebserver KB164495
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate