JiT Debugger w/ StackOverflowException kept appearing

Discussion in 'ASP .Net Security' started by den 2005, Mar 7, 2006.

  1. den 2005

    den 2005 Guest

    Hi everybody,
    Do not where to put this post? So, here is my case...
    Opening and login on the web page created by another person causes the
    JIT Debugger Dialog to appear with a message: An exception
    'System.StackOverflowException' has occurred in ... and when you click No,
    the web page displays Server Application Unavailable. We are using domain
    accounts here. What user account to use, how to set which accounts to use?
    what rights do this account needs? I need help. Thanks in advanced.

    Web Page Message:
    Server Application Unavailable

    Application Log Message:
    aspnet_wp.exe (PID: 2212) was recycled because it was suspected to be in a
    deadlocked state.
    It did not send any responses for pending requests in the last 180 seconds.

    System Log Message:
    IIS start command received from user <domain\username>. The logged data is
    the status code.

    --
    MCP Year 2005, Philippines
    den 2005, Mar 7, 2006
    #1
    1. Advertising

  2. Do you have a recursive function in the call stack?

    Joe K.

    "den 2005" <> wrote in message
    news:...
    > Hi everybody,
    > Do not where to put this post? So, here is my case...
    > Opening and login on the web page created by another person causes the
    > JIT Debugger Dialog to appear with a message: An exception
    > 'System.StackOverflowException' has occurred in ... and when you click No,
    > the web page displays Server Application Unavailable. We are using domain
    > accounts here. What user account to use, how to set which accounts to use?
    > what rights do this account needs? I need help. Thanks in advanced.
    >
    > Web Page Message:
    > Server Application Unavailable
    >
    > Application Log Message:
    > aspnet_wp.exe (PID: 2212) was recycled because it was suspected to be in
    > a
    > deadlocked state.
    > It did not send any responses for pending requests in the last 180
    > seconds.
    >
    > System Log Message:
    > IIS start command received from user <domain\username>. The logged data is
    > the status code.
    >
    > --
    > MCP Year 2005, Philippines
    Joe Kaplan \(MVP - ADSI\), Mar 7, 2006
    #2
    1. Advertising

  3. den 2005

    den 2005 Guest

    Hi Joe,
    What do you recursive function in the call stack? Not familiar with the
    terms.
    The default page contains 2 user controls.

    Second User Control. Security.ascx

    Code:
    Public Sub PageValidate(ByVal sender As Object, ByVal e As System.EventArgs)
    SessionApp_Validation()
    Page_Access()
    End Sub
    
    Private Sub SessionApp_Validation()
    Try
    
    If (Session("GUID") = "") Or (Session("UserName") = "") Or
    (Session("UserGroupCode") = "") Then
    Session.Abandon()
    Response.Redirect("default.aspx")
    End If
    
    If (Session("UserGroupCode").ToString() <> "I1") And
    (Session("UserGroupCode").ToString() <> "IA") And (Session("COGUID") = "")
    Then
    Session.Abandon()
    Response.Redirect("default.aspx")
    End If
    
    If (IsNothing(Application.Get(Session("GUID").ToString()))) Then
    Session.Abandon()
    Response.Redirect("default.aspx")
    End If
    
    If Not (Application.Get(Session("GUID").ToString()).ToString() =
    Session.SessionID.ToString()) Then
    Session.Abandon()
    Response.Redirect("default.aspx")
    End If
    
    Catch exp As Exception
    objHelper.LogEvent(exp, "IndustryWeb.Security")
    Session.Abandon()
    Response.Redirect("default.aspx")
    
    End Try
    End Sub
    
    Private Sub Page_Access()
    Dim cMotherPage As String
    Dim ldsPage As New DataSet()
    Dim ldrwPage As DataRow()
    Try
    cMotherPage = Request.ServerVariables("URL")
    cMotherPage = Right(cMotherPage, Len(cMotherPage) -
    Len(Application.Get("Root")))
    If cMotherPage <> "default.asp" Then
    
    ldsPage =
    CType(Application.Get(Session("UserGroupCode").ToString()), DataSet)
    
    ldrwPage = ldsPage.Tables(0).Select("FileName='" &
    cMotherPage & "'") ' and Access = 'Y'")
    
    If (Not (ldrwPage.Length > 0)) Then
    Session.Abandon()
    Response.Redirect("default.aspx")
    End If
    
    If Session("Suspend").ToString() And
    ldrwPage(0).Item("ViewInSuspended").ToString() <> "Y" Then
    Session.Abandon()
    Response.Redirect("default.aspx")
    End If
    
    End If
    
    If cMotherPage <> "ChangePromptPass.aspx" And
    Session("Prompt").ToString() <> "N" Then
    Response.Redirect("ChangePromptPass.aspx")
    End If
    
    If UCase(Session("UserGroupCode").ToString()) = "AU" Then
    If cMotherPage <> "ChangePromptPass.aspx" And cMotherPage <>
    "User_Preference.aspx" And Session("IsAIF") And Not
    (Session("HasPreference")) Then
    Response.Redirect("User_Preference.aspx")
    End If
    End If
    
    Catch exp As Exception
    objHelper.LogEvent(exp, "IndustryWeb.Security")
    
    End Try
    End Sub
    [\code]
    
    First User Control. login.ascx
    
    [code]
    Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As
    System.EventArgs) Handles btnSubmit.Click
    End Sub
    [\code]
    
    Inside global.asax.cs
    
    [code]
    Public Class Global
    Inherits System.Web.HttpApplication
    
    Dim mobjHelper As New Helpers()
    Private Const modName As String = "Application"
    
    Public Function PageAccess(ByVal astrUserGroupCode As String) As DataSet
    Dim lobjDBHelper As New DBHelper()
    Dim lobjMenuTools As New
    WebMenuTools(Application.Get("Connection").ToString())
    Dim ldsPage As New WebMenuDS()
    
    Try
    ldsPage = lobjMenuTools.GetMenuDS(astrUserGroupCode.ToString())
    
    Return ldsPage
    
    Catch exp As Exception
    mobjHelper.LogEvent(exp, "IndustryWeb." & modName, True)
    Finally
    lobjDBHelper.Close()
    ldsPage.Dispose()
    End Try
    End Function
    
    Public Function UserGroupGet() As SqlDataReader
    Dim lobjDBHelper As New DBHelper()
    Dim ldrUserGroup As SqlDataReader
    
    Try
    With lobjDBHelper
    .ConnectionString = Application.Get("Connection").ToString()
    .Open()
    ldrUserGroup = .ExecuteReturnDR("sp_RFUserGroups_Get",
    CommandType.StoredProcedure)
    End With
    
    Return ldrUserGroup
    
    Catch exp As Exception
    mobjHelper.LogEvent(exp, "IndustryWeb." & modName, True)
    
    Finally
    lobjDBHelper.Close()
    End Try
    End Function
    
    Public Sub AppVar()
    Dim lobjDBHelper As New DBHelper()
    Dim ldrEntity As SqlDataReader
    
    Try
    
    With lobjDBHelper
    .ConnectionString = Application.Get("Connection").ToString()
    .Open()
    ldrEntity = .ExecuteReturnDR("sp_entity_get",
    CommandType.StoredProcedure, _
    .mp("@IndustryName", DbType.String, 50, ""))
    End With
    
    Do While (ldrEntity.Read())
    Application.Add(ldrEntity("IndustryName").ToString(),
    ldrEntity("IndustryID").ToString())
    Loop
    
    Catch exp As Exception
    . . .
    
    Finally
    lobjDBHelper.Close()
    
    End Try
    End Sub
    .. . ..
    Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
    ' Fires when the application is started
    Dim ldrUserGroup As SqlDataReader
    Dim lobjIndustryDB As New ConnectionStrings()
    Try
    
    Application.Add("Connection", lobjIndustryDB.Industry.ToString())
    Application.Add("DocConnection",
    lobjIndustryDB.Document.ToString())
    Application.Add("AIFConnection", lobjIndustryDB.AIF.ToString())
    Application.Add("Root", "/InsuranceWeb/")
    Application.Add("BatchQueue", "FormatName:Direct=TCP:<ip
    address>\private$\<folder name>")
    AppVar()
    ldrUserGroup = UserGroupGet()
    If Not (IsNothing(ldrUserGroup)) Then
    Do While (ldrUserGroup.Read())
    
    Application.Add(ldrUserGroup("UserGroupCode").ToString(),
    PageAccess(ldrUserGroup("UserGroupCode").ToString()))
    Loop
    ldrUserGroup.Close()
    Else
    
    End If
    
    Catch exp As Exception
    mobjHelper.LogEvent(exp, "IndustryWeb." & modName, True)
    
    Finally
    
    End Try
    
    End Sub
    
    Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
    ' Fires when the session ends
    Dim lobjDBHelper As New DBHelper()
    Try
    With lobjDBHelper
    .ConnectionString = Application.Get("Connection").ToString()
    .Open()
    .ExecuteNonQuery("sp_Last_Login_Update",
    CommandType.StoredProcedure, .mp("@GUID", DbType.Guid, 16, New
    Guid(Session("GUID").ToString())))
    End With
    Application.Remove(Session("GUID").ToString())
    Catch exp As Exception
    
    End Try
    
    End Sub
    End Class
    [\code]
    
    Hope this makes it clearer. Thanks for the reply.
    
    Den2005
    --
    MCP Year 2005, Philippines
    
    
    "Joe Kaplan (MVP - ADSI)" wrote:
    [color=blue]
    > Do you have a recursive function in the call stack?
    >
    > Joe K.
    >
    > "den 2005" <> wrote in message
    > news:...[color=green]
    > > Hi everybody,
    > >   Do not where to put this post? So, here is my case...
    > >   Opening and login on the web page created by another person causes the
    > > JIT Debugger Dialog to appear with a message: An exception
    > > 'System.StackOverflowException' has occurred in ... and when you click No,
    > > the web page displays Server Application Unavailable. We are using domain
    > > accounts here. What user account to use, how to set which accounts to use?
    > > what rights do this account needs? I need help. Thanks in advanced.
    > >
    > > Web Page Message:
    > > Server Application Unavailable
    > >
    > > Application Log Message:
    > > aspnet_wp.exe  (PID: 2212) was recycled because it was suspected to be in
    > > a
    > > deadlocked state.
    > > It did not send any responses for pending requests in the last 180
    > > seconds.
    > >
    > > System Log Message:
    > > IIS start command received from user <domain\username>. The logged data is
    > > the status code.
    > >
    > > --
    > > MCP Year 2005, Philippines[/color]
    >
    >
    >[/color]
    den 2005, Mar 7, 2006
    #3
  4. A recursive function is a function that calls itself. Something like:

    Sub Foo()
    Foo()
    End Sub

    Recursive functions have a tendency to cause you to run out of stack space
    if they allocate too much memory on the call stack.

    Glancing through the code, I don't see any obvious recursion. However, I
    didn't look that closely. You might also consider adding some logging to
    see what's going on and where you are running out of stack space or just try
    running the code in the debugger and see what you are doing when it blows
    up.

    It might also be helpful to post the full stack trace of the exception.

    Joe K.

    "den 2005" <> wrote in message
    news:...
    > Hi Joe,
    > What do you recursive function in the call stack? Not familiar with the
    > terms.
    > The default page contains 2 user controls.
    >
    > Second User Control. Security.ascx
    >
    >
    Code:
    > Public Sub PageValidate(ByVal sender As Object, ByVal e As
    > System.EventArgs)
    >        SessionApp_Validation()
    >        Page_Access()
    >    End Sub
    >
    >    Private Sub SessionApp_Validation()
    >        Try
    >
    >            If (Session("GUID") = "") Or (Session("UserName") = "") Or
    > (Session("UserGroupCode") = "") Then
    >                Session.Abandon()
    >                Response.Redirect("default.aspx")
    >            End If
    >
    >            If (Session("UserGroupCode").ToString() <> "I1") And
    > (Session("UserGroupCode").ToString() <> "IA") And (Session("COGUID") = "")
    > Then
    >                Session.Abandon()
    >                Response.Redirect("default.aspx")
    >            End If
    >
    >            If (IsNothing(Application.Get(Session("GUID").ToString())))
    > Then
    >                Session.Abandon()
    >                Response.Redirect("default.aspx")
    >            End If
    >
    >            If Not (Application.Get(Session("GUID").ToString()).ToString()
    > =
    > Session.SessionID.ToString()) Then
    >                Session.Abandon()
    >                Response.Redirect("default.aspx")
    >            End If
    >
    >        Catch exp As Exception
    >            objHelper.LogEvent(exp, "IndustryWeb.Security")
    >            Session.Abandon()
    >            Response.Redirect("default.aspx")
    >
    >        End Try
    >    End Sub
    >
    >    Private Sub Page_Access()
    >        Dim cMotherPage As String
    >        Dim ldsPage As New DataSet()
    >        Dim ldrwPage As DataRow()
    >        Try
    >            cMotherPage = Request.ServerVariables("URL")
    >            cMotherPage = Right(cMotherPage, Len(cMotherPage) -
    > Len(Application.Get("Root")))
    >            If cMotherPage <> "default.asp" Then
    >
    >                ldsPage =
    > CType(Application.Get(Session("UserGroupCode").ToString()), DataSet)
    >
    >                ldrwPage = ldsPage.Tables(0).Select("FileName='" &
    > cMotherPage & "'") ' and Access = 'Y'")
    >
    >                If (Not (ldrwPage.Length > 0)) Then
    >                    Session.Abandon()
    >                    Response.Redirect("default.aspx")
    >                End If
    >
    >                If Session("Suspend").ToString() And
    > ldrwPage(0).Item("ViewInSuspended").ToString() <> "Y" Then
    >                    Session.Abandon()
    >                    Response.Redirect("default.aspx")
    >                End If
    >
    >            End If
    >
    >            If cMotherPage <> "ChangePromptPass.aspx" And
    > Session("Prompt").ToString() <> "N" Then
    >                Response.Redirect("ChangePromptPass.aspx")
    >            End If
    >
    >            If UCase(Session("UserGroupCode").ToString()) = "AU" Then
    >                If cMotherPage <> "ChangePromptPass.aspx" And cMotherPage
    > <>
    > "User_Preference.aspx" And Session("IsAIF") And Not
    > (Session("HasPreference")) Then
    >                    Response.Redirect("User_Preference.aspx")
    >                End If
    >            End If
    >
    >        Catch exp As Exception
    >            objHelper.LogEvent(exp, "IndustryWeb.Security")
    >
    >        End Try
    >    End Sub
    > [\code]
    >
    > First User Control. login.ascx
    >
    > [code]
    > Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As
    > System.EventArgs) Handles btnSubmit.Click
    >    End Sub
    > [\code]
    >
    > Inside global.asax.cs
    >
    > [code]
    > Public Class Global
    >    Inherits System.Web.HttpApplication
    >
    >    Dim mobjHelper As New Helpers()
    >    Private Const modName As String = "Application"
    >
    >    Public Function PageAccess(ByVal astrUserGroupCode As String) As
    > DataSet
    >        Dim lobjDBHelper As New DBHelper()
    >        Dim lobjMenuTools As New
    > WebMenuTools(Application.Get("Connection").ToString())
    >        Dim ldsPage As New WebMenuDS()
    >
    >        Try
    >            ldsPage = lobjMenuTools.GetMenuDS(astrUserGroupCode.ToString())
    >
    >            Return ldsPage
    >
    >        Catch exp As Exception
    >            mobjHelper.LogEvent(exp, "IndustryWeb." & modName, True)
    >        Finally
    >            lobjDBHelper.Close()
    >            ldsPage.Dispose()
    >        End Try
    >    End Function
    >
    >    Public Function UserGroupGet() As SqlDataReader
    >        Dim lobjDBHelper As New DBHelper()
    >        Dim ldrUserGroup As SqlDataReader
    >
    >        Try
    >            With lobjDBHelper
    >                .ConnectionString =
    > Application.Get("Connection").ToString()
    >                .Open()
    >                ldrUserGroup = .ExecuteReturnDR("sp_RFUserGroups_Get",
    > CommandType.StoredProcedure)
    >            End With
    >
    >            Return ldrUserGroup
    >
    >        Catch exp As Exception
    >            mobjHelper.LogEvent(exp, "IndustryWeb." & modName, True)
    >
    >        Finally
    >            lobjDBHelper.Close()
    >        End Try
    >    End Function
    >
    >    Public Sub AppVar()
    >        Dim lobjDBHelper As New DBHelper()
    >        Dim ldrEntity As SqlDataReader
    >
    >        Try
    >
    >            With lobjDBHelper
    >                .ConnectionString =
    > Application.Get("Connection").ToString()
    >                .Open()
    >                ldrEntity = .ExecuteReturnDR("sp_entity_get",
    > CommandType.StoredProcedure, _
    >                    .mp("@IndustryName", DbType.String, 50, ""))
    >            End With
    >
    >            Do While (ldrEntity.Read())
    >                Application.Add(ldrEntity("IndustryName").ToString(),
    > ldrEntity("IndustryID").ToString())
    >            Loop
    >
    >        Catch exp As Exception
    >            . . .
    >
    >        Finally
    >            lobjDBHelper.Close()
    >
    >        End Try
    >    End Sub
    > . . ..
    > Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
    >        ' Fires when the application is started
    >        Dim ldrUserGroup As SqlDataReader
    >        Dim lobjIndustryDB As New ConnectionStrings()
    >        Try
    >
    >            Application.Add("Connection",
    > lobjIndustryDB.Industry.ToString())
    >            Application.Add("DocConnection",
    > lobjIndustryDB.Document.ToString())
    >            Application.Add("AIFConnection", lobjIndustryDB.AIF.ToString())
    >            Application.Add("Root", "/InsuranceWeb/")
    >            Application.Add("BatchQueue", "FormatName:Direct=TCP:<ip
    > address>\private$\<folder name>")
    >            AppVar()
    >            ldrUserGroup = UserGroupGet()
    >            If Not (IsNothing(ldrUserGroup)) Then
    >                Do While (ldrUserGroup.Read())
    >
    > Application.Add(ldrUserGroup("UserGroupCode").ToString(),
    > PageAccess(ldrUserGroup("UserGroupCode").ToString()))
    >                Loop
    >                ldrUserGroup.Close()
    >            Else
    >
    >            End If
    >
    >        Catch exp As Exception
    >            mobjHelper.LogEvent(exp, "IndustryWeb." & modName, True)
    >
    >        Finally
    >
    >        End Try
    >
    >    End Sub
    >
    >   Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
    >        ' Fires when the session ends
    >        Dim lobjDBHelper As New DBHelper()
    >        Try
    >            With lobjDBHelper
    >                .ConnectionString =
    > Application.Get("Connection").ToString()
    >                .Open()
    >                .ExecuteNonQuery("sp_Last_Login_Update",
    > CommandType.StoredProcedure, .mp("@GUID", DbType.Guid, 16, New
    > Guid(Session("GUID").ToString())))
    >            End With
    >            Application.Remove(Session("GUID").ToString())
    >        Catch exp As Exception
    >
    >        End Try
    >
    >    End Sub
    > End Class
    > [\code]
    >
    > Hope this makes it clearer. Thanks for the reply.
    >
    > Den2005
    > --
    > MCP Year 2005, Philippines
    >
    >
    > "Joe Kaplan (MVP - ADSI)" wrote:
    >[color=green]
    >> Do you have a recursive function in the call stack?
    >>
    >> Joe K.
    >>
    >> "den 2005" <> wrote in message
    >> news:...[color=darkred]
    >> > Hi everybody,
    >> >   Do not where to put this post? So, here is my case...
    >> >   Opening and login on the web page created by another person causes
    >> > the
    >> > JIT Debugger Dialog to appear with a message: An exception
    >> > 'System.StackOverflowException' has occurred in ... and when you click
    >> > No,
    >> > the web page displays Server Application Unavailable. We are using
    >> > domain
    >> > accounts here. What user account to use, how to set which accounts to
    >> > use?
    >> > what rights do this account needs? I need help. Thanks in advanced.
    >> >
    >> > Web Page Message:
    >> > Server Application Unavailable
    >> >
    >> > Application Log Message:
    >> > aspnet_wp.exe  (PID: 2212) was recycled because it was suspected to be
    >> > in
    >> > a
    >> > deadlocked state.
    >> > It did not send any responses for pending requests in the last 180
    >> > seconds.
    >> >
    >> > System Log Message:
    >> > IIS start command received from user <domain\username>. The logged data
    >> > is
    >> > the status code.
    >> >
    >> > --
    >> > MCP Year 2005, Philippines[/color]
    >>
    >>
    >>[/color][/color]
    Joe Kaplan \(MVP - ADSI\), Mar 8, 2006
    #4
  5. den 2005

    den 2005 Guest

    Hi Joe,
    Thanks for the reply.
    I have solved this problem. There is no recursive or inifinite loop. It
    has to do with using domain account to access local web application. A
    co-worker of mine found a post on dotnet247.com about this same problem as
    suggested in that post change the UserName attribute of processModel tag of
    Machine.config file will solved the problem and it did works.

    den2005
    --
    MCP Year 2005, Philippines


    "Joe Kaplan (MVP - ADSI)" wrote:

    > A recursive function is a function that calls itself. Something like:
    >
    > Sub Foo()
    > Foo()
    > End Sub
    >
    > Recursive functions have a tendency to cause you to run out of stack space
    > if they allocate too much memory on the call stack.
    >
    > Glancing through the code, I don't see any obvious recursion. However, I
    > didn't look that closely. You might also consider adding some logging to
    > see what's going on and where you are running out of stack space or just try
    > running the code in the debugger and see what you are doing when it blows
    > up.
    >
    > It might also be helpful to post the full stack trace of the exception.
    >
    > Joe K.
    >
    > "den 2005" <> wrote in message
    > news:...
    > > Hi Joe,
    > > What do you recursive function in the call stack? Not familiar with the
    > > terms.
    > > The default page contains 2 user controls.
    > >
    > > Second User Control. Security.ascx
    > >
    > >
    Code:
    > > Public Sub PageValidate(ByVal sender As Object, ByVal e As
    > > System.EventArgs)
    > >        SessionApp_Validation()
    > >        Page_Access()
    > >    End Sub
    > >
    > >    Private Sub SessionApp_Validation()
    > >        Try
    > >
    > >            If (Session("GUID") = "") Or (Session("UserName") = "") Or
    > > (Session("UserGroupCode") = "") Then
    > >                Session.Abandon()
    > >                Response.Redirect("default.aspx")
    > >            End If
    > >
    > >            If (Session("UserGroupCode").ToString() <> "I1") And
    > > (Session("UserGroupCode").ToString() <> "IA") And (Session("COGUID") = "")
    > > Then
    > >                Session.Abandon()
    > >                Response.Redirect("default.aspx")
    > >            End If
    > >
    > >            If (IsNothing(Application.Get(Session("GUID").ToString())))
    > > Then
    > >                Session.Abandon()
    > >                Response.Redirect("default.aspx")
    > >            End If
    > >
    > >            If Not (Application.Get(Session("GUID").ToString()).ToString()
    > > =
    > > Session.SessionID.ToString()) Then
    > >                Session.Abandon()
    > >                Response.Redirect("default.aspx")
    > >            End If
    > >
    > >        Catch exp As Exception
    > >            objHelper.LogEvent(exp, "IndustryWeb.Security")
    > >            Session.Abandon()
    > >            Response.Redirect("default.aspx")
    > >
    > >        End Try
    > >    End Sub
    > >
    > >    Private Sub Page_Access()
    > >        Dim cMotherPage As String
    > >        Dim ldsPage As New DataSet()
    > >        Dim ldrwPage As DataRow()
    > >        Try
    > >            cMotherPage = Request.ServerVariables("URL")
    > >            cMotherPage = Right(cMotherPage, Len(cMotherPage) -
    > > Len(Application.Get("Root")))
    > >            If cMotherPage <> "default.asp" Then
    > >
    > >                ldsPage =
    > > CType(Application.Get(Session("UserGroupCode").ToString()), DataSet)
    > >
    > >                ldrwPage = ldsPage.Tables(0).Select("FileName='" &
    > > cMotherPage & "'") ' and Access = 'Y'")
    > >
    > >                If (Not (ldrwPage.Length > 0)) Then
    > >                    Session.Abandon()
    > >                    Response.Redirect("default.aspx")
    > >                End If
    > >
    > >                If Session("Suspend").ToString() And
    > > ldrwPage(0).Item("ViewInSuspended").ToString() <> "Y" Then
    > >                    Session.Abandon()
    > >                    Response.Redirect("default.aspx")
    > >                End If
    > >
    > >            End If
    > >
    > >            If cMotherPage <> "ChangePromptPass.aspx" And
    > > Session("Prompt").ToString() <> "N" Then
    > >                Response.Redirect("ChangePromptPass.aspx")
    > >            End If
    > >
    > >            If UCase(Session("UserGroupCode").ToString()) = "AU" Then
    > >                If cMotherPage <> "ChangePromptPass.aspx" And cMotherPage
    > > <>
    > > "User_Preference.aspx" And Session("IsAIF") And Not
    > > (Session("HasPreference")) Then
    > >                    Response.Redirect("User_Preference.aspx")
    > >                End If
    > >            End If
    > >
    > >        Catch exp As Exception
    > >            objHelper.LogEvent(exp, "IndustryWeb.Security")
    > >
    > >        End Try
    > >    End Sub
    > > [\code]
    > >
    > > First User Control. login.ascx
    > >
    > > [code]
    > > Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As
    > > System.EventArgs) Handles btnSubmit.Click
    > >    End Sub
    > > [\code]
    > >
    > > Inside global.asax.cs
    > >
    > > [code]
    > > Public Class Global
    > >    Inherits System.Web.HttpApplication
    > >
    > >    Dim mobjHelper As New Helpers()
    > >    Private Const modName As String = "Application"
    > >
    > >    Public Function PageAccess(ByVal astrUserGroupCode As String) As
    > > DataSet
    > >        Dim lobjDBHelper As New DBHelper()
    > >        Dim lobjMenuTools As New
    > > WebMenuTools(Application.Get("Connection").ToString())
    > >        Dim ldsPage As New WebMenuDS()
    > >
    > >        Try
    > >            ldsPage = lobjMenuTools.GetMenuDS(astrUserGroupCode.ToString())
    > >
    > >            Return ldsPage
    > >
    > >        Catch exp As Exception
    > >            mobjHelper.LogEvent(exp, "IndustryWeb." & modName, True)
    > >        Finally
    > >            lobjDBHelper.Close()
    > >            ldsPage.Dispose()
    > >        End Try
    > >    End Function
    > >
    > >    Public Function UserGroupGet() As SqlDataReader
    > >        Dim lobjDBHelper As New DBHelper()
    > >        Dim ldrUserGroup As SqlDataReader
    > >
    > >        Try
    > >            With lobjDBHelper
    > >                .ConnectionString =
    > > Application.Get("Connection").ToString()
    > >                .Open()
    > >                ldrUserGroup = .ExecuteReturnDR("sp_RFUserGroups_Get",
    > > CommandType.StoredProcedure)
    > >            End With
    > >
    > >            Return ldrUserGroup
    > >
    > >        Catch exp As Exception
    > >            mobjHelper.LogEvent(exp, "IndustryWeb." & modName, True)
    > >
    > >        Finally
    > >            lobjDBHelper.Close()
    > >        End Try
    > >    End Function
    > >
    > >    Public Sub AppVar()
    > >        Dim lobjDBHelper As New DBHelper()
    > >        Dim ldrEntity As SqlDataReader
    > >
    > >        Try
    > >
    > >            With lobjDBHelper
    > >                .ConnectionString =
    > > Application.Get("Connection").ToString()
    > >                .Open()
    > >                ldrEntity = .ExecuteReturnDR("sp_entity_get",
    > > CommandType.StoredProcedure, _
    > >                    .mp("@IndustryName", DbType.String, 50, ""))
    > >            End With
    > >
    > >            Do While (ldrEntity.Read())
    > >                Application.Add(ldrEntity("IndustryName").ToString(),
    > > ldrEntity("IndustryID").ToString())
    > >            Loop
    > >
    > >        Catch exp As Exception
    > >            . . .
    > >
    > >        Finally
    > >            lobjDBHelper.Close()
    > >
    > >        End Try
    > >    End Sub
    > > . . ..
    > > Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
    > >        ' Fires when the application is started
    > >        Dim ldrUserGroup As SqlDataReader
    > >        Dim lobjIndustryDB As New ConnectionStrings()
    > >        Try
    > >
    > >            Application.Add("Connection",
    > > lobjIndustryDB.Industry.ToString())
    > >            Application.Add("DocConnection",
    > > lobjIndustryDB.Document.ToString())
    > >            Application.Add("AIFConnection", lobjIndustryDB.AIF.ToString())
    > >            Application.Add("Root", "/InsuranceWeb/")
    > >            Application.Add("BatchQueue", "FormatName:Direct=TCP:<ip
    > > address>\private$\<folder name>")
    > >            AppVar()
    > >            ldrUserGroup = UserGroupGet()
    > >            If Not (IsNothing(ldrUserGroup)) Then
    > >                Do While (ldrUserGroup.Read())
    > >
    > > Application.Add(ldrUserGroup("UserGroupCode").ToString(),
    > > PageAccess(ldrUserGroup("UserGroupCode").ToString()))
    > >                Loop
    > >                ldrUserGroup.Close()
    > >            Else
    > >
    > >            End If
    > >
    > >        Catch exp As Exception
    > >            mobjHelper.LogEvent(exp, "IndustryWeb." & modName, True)
    > >
    > >        Finally
    > >
    > >        End Try
    > >
    > >    End Sub
    > >
    > >   Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
    > >        ' Fires when the session ends
    > >        Dim lobjDBHelper As New DBHelper()
    > >        Try
    > >            With lobjDBHelper
    > >                .ConnectionString =
    > > Application.Get("Connection").ToString()
    > >                .Open()
    > >                .ExecuteNonQuery("sp_Last_Login_Update",
    > > CommandType.StoredProcedure, .mp("@GUID", DbType.Guid, 16, New
    > > Guid(Session("GUID").ToString())))
    > >            End With
    > >            Application.Remove(Session("GUID").ToString())
    > >        Catch exp As Exception
    > >
    > >        End Try
    > >
    > >    End Sub
    > > End Class
    > > [\code]
    > >
    > > Hope this makes it clearer. Thanks for the reply.
    > >
    > > Den2005
    > > --
    > > MCP Year 2005, Philippines
    > >
    > >
    > > "Joe Kaplan (MVP - ADSI)" wrote:
    > >[color=darkred]
    > >> Do you have a recursive function in the call stack?
    > >>
    > >> Joe K.
    > >>
    > >> "den 2005" <> wrote in message
    > >> news:...
    > >> > Hi everybody,
    > >> >   Do not where to put this post? So, here is my case...
    > >> >   Opening and login on the web page created by another person causes
    > >> > the
    > >> > JIT Debugger Dialog to appear with a message: An exception
    > >> > 'System.StackOverflowException' has occurred in ... and when you click
    > >> > No,
    > >> > the web page displays Server Application Unavailable. We are using
    > >> > domain
    > >> > accounts here. What user account to use, how to set which accounts to
    > >> > use?
    > >> > what rights do this account needs? I need help. Thanks in advanced.
    > >> >
    > >> > Web Page Message:
    > >> > Server Application Unavailable
    > >> >
    > >> > Application Log Message:[/color][/color][/color]
    den 2005, Mar 8, 2006
    #5
  6. That's a pretty bizarre error. I'm glad you fixed it.

    Joe K.

    "den 2005" <> wrote in message
    news:...
    > Hi Joe,
    > Thanks for the reply.
    > I have solved this problem. There is no recursive or inifinite loop. It
    > has to do with using domain account to access local web application. A
    > co-worker of mine found a post on dotnet247.com about this same problem as
    > suggested in that post change the UserName attribute of processModel tag
    > of
    > Machine.config file will solved the problem and it did works.
    >
    > den2005
    > --
    > MCP Year 2005, Philippines
    >
    >
    > "Joe Kaplan (MVP - ADSI)" wrote:
    >
    >> A recursive function is a function that calls itself. Something like:
    >>
    >> Sub Foo()
    >> Foo()
    >> End Sub
    >>
    >> Recursive functions have a tendency to cause you to run out of stack
    >> space
    >> if they allocate too much memory on the call stack.
    >>
    >> Glancing through the code, I don't see any obvious recursion. However, I
    >> didn't look that closely. You might also consider adding some logging to
    >> see what's going on and where you are running out of stack space or just
    >> try
    >> running the code in the debugger and see what you are doing when it blows
    >> up.
    >>
    >> It might also be helpful to post the full stack trace of the exception.
    >>
    >> Joe K.
    >>
    >> "den 2005" <> wrote in message
    >> news:...
    >> > Hi Joe,
    >> > What do you recursive function in the call stack? Not familiar with
    >> > the
    >> > terms.
    >> > The default page contains 2 user controls.
    >> >
    >> > Second User Control. Security.ascx
    >> >
    >> >
    Code:
    >> > Public Sub PageValidate(ByVal sender As Object, ByVal e As
    >> > System.EventArgs)
    >> >        SessionApp_Validation()
    >> >        Page_Access()
    >> >    End Sub
    >> >
    >> >    Private Sub SessionApp_Validation()
    >> >        Try
    >> >
    >> >            If (Session("GUID") = "") Or (Session("UserName") = "") Or
    >> > (Session("UserGroupCode") = "") Then
    >> >                Session.Abandon()
    >> >                Response.Redirect("default.aspx")
    >> >            End If
    >> >
    >> >            If (Session("UserGroupCode").ToString() <> "I1") And
    >> > (Session("UserGroupCode").ToString() <> "IA") And (Session("COGUID") =
    >> > "")
    >> > Then
    >> >                Session.Abandon()
    >> >                Response.Redirect("default.aspx")
    >> >            End If
    >> >
    >> >            If (IsNothing(Application.Get(Session("GUID").ToString())))
    >> > Then
    >> >                Session.Abandon()
    >> >                Response.Redirect("default.aspx")
    >> >            End If
    >> >
    >> >            If Not
    >> > (Application.Get(Session("GUID").ToString()).ToString()
    >> > =
    >> > Session.SessionID.ToString()) Then
    >> >                Session.Abandon()
    >> >                Response.Redirect("default.aspx")
    >> >            End If
    >> >
    >> >        Catch exp As Exception
    >> >            objHelper.LogEvent(exp, "IndustryWeb.Security")
    >> >            Session.Abandon()
    >> >            Response.Redirect("default.aspx")
    >> >
    >> >        End Try
    >> >    End Sub
    >> >
    >> >    Private Sub Page_Access()
    >> >        Dim cMotherPage As String
    >> >        Dim ldsPage As New DataSet()
    >> >        Dim ldrwPage As DataRow()
    >> >        Try
    >> >            cMotherPage = Request.ServerVariables("URL")
    >> >            cMotherPage = Right(cMotherPage, Len(cMotherPage) -
    >> > Len(Application.Get("Root")))
    >> >            If cMotherPage <> "default.asp" Then
    >> >
    >> >                ldsPage =
    >> > CType(Application.Get(Session("UserGroupCode").ToString()), DataSet)
    >> >
    >> >                ldrwPage = ldsPage.Tables(0).Select("FileName='" &
    >> > cMotherPage & "'") ' and Access = 'Y'")
    >> >
    >> >                If (Not (ldrwPage.Length > 0)) Then
    >> >                    Session.Abandon()
    >> >                    Response.Redirect("default.aspx")
    >> >                End If
    >> >
    >> >                If Session("Suspend").ToString() And
    >> > ldrwPage(0).Item("ViewInSuspended").ToString() <> "Y" Then
    >> >                    Session.Abandon()
    >> >                    Response.Redirect("default.aspx")
    >> >                End If
    >> >
    >> >            End If
    >> >
    >> >            If cMotherPage <> "ChangePromptPass.aspx" And
    >> > Session("Prompt").ToString() <> "N" Then
    >> >                Response.Redirect("ChangePromptPass.aspx")
    >> >            End If
    >> >
    >> >            If UCase(Session("UserGroupCode").ToString()) = "AU" Then
    >> >                If cMotherPage <> "ChangePromptPass.aspx" And
    >> > cMotherPage
    >> > <>
    >> > "User_Preference.aspx" And Session("IsAIF") And Not
    >> > (Session("HasPreference")) Then
    >> >                    Response.Redirect("User_Preference.aspx")
    >> >                End If
    >> >            End If
    >> >
    >> >        Catch exp As Exception
    >> >            objHelper.LogEvent(exp, "IndustryWeb.Security")
    >> >
    >> >        End Try
    >> >    End Sub
    >> > [\code]
    >> >
    >> > First User Control. login.ascx
    >> >
    >> > [code]
    >> > Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As
    >> > System.EventArgs) Handles btnSubmit.Click
    >> >    End Sub
    >> > [\code]
    >> >
    >> > Inside global.asax.cs
    >> >
    >> > [code]
    >> > Public Class Global
    >> >    Inherits System.Web.HttpApplication
    >> >
    >> >    Dim mobjHelper As New Helpers()
    >> >    Private Const modName As String = "Application"
    >> >
    >> >    Public Function PageAccess(ByVal astrUserGroupCode As String) As
    >> > DataSet
    >> >        Dim lobjDBHelper As New DBHelper()
    >> >        Dim lobjMenuTools As New
    >> > WebMenuTools(Application.Get("Connection").ToString())
    >> >        Dim ldsPage As New WebMenuDS()
    >> >
    >> >        Try
    >> >            ldsPage =
    >> > lobjMenuTools.GetMenuDS(astrUserGroupCode.ToString())
    >> >
    >> >            Return ldsPage
    >> >
    >> >        Catch exp As Exception
    >> >            mobjHelper.LogEvent(exp, "IndustryWeb." & modName, True)
    >> >        Finally
    >> >            lobjDBHelper.Close()
    >> >            ldsPage.Dispose()
    >> >        End Try
    >> >    End Function
    >> >
    >> >    Public Function UserGroupGet() As SqlDataReader
    >> >        Dim lobjDBHelper As New DBHelper()
    >> >        Dim ldrUserGroup As SqlDataReader
    >> >
    >> >        Try
    >> >            With lobjDBHelper
    >> >                .ConnectionString =
    >> > Application.Get("Connection").ToString()
    >> >                .Open()
    >> >                ldrUserGroup = .ExecuteReturnDR("sp_RFUserGroups_Get",
    >> > CommandType.StoredProcedure)
    >> >            End With
    >> >
    >> >            Return ldrUserGroup
    >> >
    >> >        Catch exp As Exception
    >> >            mobjHelper.LogEvent(exp, "IndustryWeb." & modName, True)
    >> >
    >> >        Finally
    >> >            lobjDBHelper.Close()
    >> >        End Try
    >> >    End Function
    >> >
    >> >    Public Sub AppVar()
    >> >        Dim lobjDBHelper As New DBHelper()
    >> >        Dim ldrEntity As SqlDataReader
    >> >
    >> >        Try
    >> >
    >> >            With lobjDBHelper
    >> >                .ConnectionString =
    >> > Application.Get("Connection").ToString()
    >> >                .Open()
    >> >                ldrEntity = .ExecuteReturnDR("sp_entity_get",
    >> > CommandType.StoredProcedure, _
    >> >                    .mp("@IndustryName", DbType.String, 50, ""))
    >> >            End With
    >> >
    >> >            Do While (ldrEntity.Read())
    >> >                Application.Add(ldrEntity("IndustryName").ToString(),
    >> > ldrEntity("IndustryID").ToString())
    >> >            Loop
    >> >
    >> >        Catch exp As Exception
    >> >            . . .
    >> >
    >> >        Finally
    >> >            lobjDBHelper.Close()
    >> >
    >> >        End Try
    >> >    End Sub
    >> > . . ..
    >> > Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
    >> >        ' Fires when the application is started
    >> >        Dim ldrUserGroup As SqlDataReader
    >> >        Dim lobjIndustryDB As New ConnectionStrings()
    >> >        Try
    >> >
    >> >            Application.Add("Connection",
    >> > lobjIndustryDB.Industry.ToString())
    >> >            Application.Add("DocConnection",
    >> > lobjIndustryDB.Document.ToString())
    >> >            Application.Add("AIFConnection",
    >> > lobjIndustryDB.AIF.ToString())
    >> >            Application.Add("Root", "/InsuranceWeb/")
    >> >            Application.Add("BatchQueue", "FormatName:Direct=TCP:<ip
    >> > address>\private$\<folder name>")
    >> >            AppVar()
    >> >            ldrUserGroup = UserGroupGet()
    >> >            If Not (IsNothing(ldrUserGroup)) Then
    >> >                Do While (ldrUserGroup.Read())
    >> >
    >> > Application.Add(ldrUserGroup("UserGroupCode").ToString(),
    >> > PageAccess(ldrUserGroup("UserGroupCode").ToString()))
    >> >                Loop
    >> >                ldrUserGroup.Close()
    >> >            Else
    >> >
    >> >            End If
    >> >
    >> >        Catch exp As Exception
    >> >            mobjHelper.LogEvent(exp, "IndustryWeb." & modName, True)
    >> >
    >> >        Finally
    >> >
    >> >        End Try
    >> >
    >> >    End Sub
    >> >
    >> >   Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
    >> >        ' Fires when the session ends
    >> >        Dim lobjDBHelper As New DBHelper()
    >> >        Try
    >> >            With lobjDBHelper
    >> >                .ConnectionString =
    >> > Application.Get("Connection").ToString()
    >> >                .Open()
    >> >                .ExecuteNonQuery("sp_Last_Login_Update",
    >> > CommandType.StoredProcedure, .mp("@GUID", DbType.Guid, 16, New
    >> > Guid(Session("GUID").ToString())))
    >> >            End With
    >> >            Application.Remove(Session("GUID").ToString())
    >> >        Catch exp As Exception
    >> >
    >> >        End Try
    >> >
    >> >    End Sub
    >> > End Class
    >> > [\code]
    >> >
    >> > Hope this makes it clearer. Thanks for the reply.
    >> >
    >> > Den2005
    >> > --
    >> > MCP Year 2005, Philippines
    >> >
    >> >
    >> > "Joe Kaplan (MVP - ADSI)" wrote:
    >> >
    >> >> Do you have a recursive function in the call stack?
    >> >>
    >> >> Joe K.
    >> >>
    >> >> "den 2005" <> wrote in message
    >> >> news:...
    >> >> > Hi everybody,
    >> >> >   Do not where to put this post? So, here is my case...
    >> >> >   Opening and login on the web page created by another person causes
    >> >> > the
    >> >> > JIT Debugger Dialog to appear with a message: An exception
    >> >> > 'System.StackOverflowException' has occurred in ... and when you
    >> >> > click
    >> >> > No,
    >> >> > the web page displays Server Application Unavailable. We are using
    >> >> > domain
    >> >> > accounts here. What user account to use, how to set which accounts
    >> >> > to
    >> >> > use?
    >> >> > what rights do this account needs? I need help. Thanks in advanced.
    >> >> >
    >> >> > Web Page Message:
    >> >> > Server Application Unavailable
    >> >> >
    >> >> > Application Log Message:[/color][/color][/color]
    Joe Kaplan \(MVP - ADSI\), Mar 8, 2006
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest
    Replies:
    0
    Views:
    512
    Guest
    May 12, 2004
  2. Kevin Jackson

    JIT Debugger error upon startup of VS 2003

    Kevin Jackson, Oct 21, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    1,145
    Kevin Jackson
    Oct 21, 2005
  3. ubi_comp
    Replies:
    0
    Views:
    2,236
    ubi_comp
    Feb 3, 2006
  4. den2005 via DotNetMonster.com

    JIT Debugger dialog appears w/ stackoverflowexception message..

    den2005 via DotNetMonster.com, Mar 7, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    413
    den2005 via DotNetMonster.com
    Mar 7, 2006
  5. Jon   Paal

    disable JIT debugger

    Jon Paal, Oct 26, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    490
    Jon Paal
    Oct 27, 2006
Loading...

Share This Page