Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. The Dreaded Stackoverflow Exception

The Dreaded Stackoverflow Exception

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharpasp-netdotnetvisual-studiodebugging
10 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    L Viljoen
    wrote on last edited by
    #1

    Can anyone help me basically my situation is as follow. I used to develop in .net 3.5 sp1 using visual studio 2008 I was able to run/debug my program without any hassles whatsoever. Then I recently upgraded my solutions to .net framework 4 on visual studio 2010 My programs still run fine but when i try to run it in debug mode i get the following exception in visual studio, An unhandled exception of type 'System.StackOverflowException' occurred If anyone can point me to something i can do or a hotfix for this i would be very happy. My System a Dual CORE CPU 4 Gigs ram running on a 64 bit windows 7 operating system. I do my development inside an XP Pro(32bit) virtual machine (VMware) 2.5 gigs of ram allocated. Many thanks

    Chona1171 Web Developer (C#), Silverlight

    P A R 3 Replies Last reply
    0
    • L L Viljoen

      Can anyone help me basically my situation is as follow. I used to develop in .net 3.5 sp1 using visual studio 2008 I was able to run/debug my program without any hassles whatsoever. Then I recently upgraded my solutions to .net framework 4 on visual studio 2010 My programs still run fine but when i try to run it in debug mode i get the following exception in visual studio, An unhandled exception of type 'System.StackOverflowException' occurred If anyone can point me to something i can do or a hotfix for this i would be very happy. My System a Dual CORE CPU 4 Gigs ram running on a 64 bit windows 7 operating system. I do my development inside an XP Pro(32bit) virtual machine (VMware) 2.5 gigs of ram allocated. Many thanks

      Chona1171 Web Developer (C#), Silverlight

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      Unfortunately, this is one of those situations where you're going to have to do a lot of debugging yourself. You're going to have to set breakpoints in your code at strategic locations and start refining from there. Two things: Does this only happen in debug? Have you changed any code when you upgraded?

      I'm not a stalker, I just know things. Oh by the way, you're out of milk.

      Forgive your enemies - it messes with their heads

      My blog | My articles | MoXAML PowerToys | Onyx

      L 1 Reply Last reply
      0
      • P Pete OHanlon

        Unfortunately, this is one of those situations where you're going to have to do a lot of debugging yourself. You're going to have to set breakpoints in your code at strategic locations and start refining from there. Two things: Does this only happen in debug? Have you changed any code when you upgraded?

        I'm not a stalker, I just know things. Oh by the way, you're out of milk.

        Forgive your enemies - it messes with their heads

        My blog | My articles | MoXAML PowerToys | Onyx

        L Offline
        L Offline
        L Viljoen
        wrote on last edited by
        #3

        Yes this only happens when i debug, and the code is a precise exact copy of what I had , aside from the fact that the projects are set to .net framework 4; also setting this back to 3.5 sp1 does not change anything From what i gather this error seems to be loosely related to COM classes that i am using , the second i try to run code associated with that com interop it gives me this error , I got a loader lock warning at the beginning and I told the debugger to ignore it now i am stuck with this stack overflow.

        Chona1171 Web Developer (C#), Silverlight

        P 1 Reply Last reply
        0
        • L L Viljoen

          Yes this only happens when i debug, and the code is a precise exact copy of what I had , aside from the fact that the projects are set to .net framework 4; also setting this back to 3.5 sp1 does not change anything From what i gather this error seems to be loosely related to COM classes that i am using , the second i try to run code associated with that com interop it gives me this error , I got a loader lock warning at the beginning and I told the debugger to ignore it now i am stuck with this stack overflow.

          Chona1171 Web Developer (C#), Silverlight

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          There's your problem then. The Loader Lock was introduced in VS2005. From MSDN[^]: "The loaderLock managed debugging assistant (MDA) detects attempts to execute managed code on a thread that holds the Microsoft Windows operating system loader lock. Any such execution is illegal because it can lead to deadlocks and to use of DLLs before they have been initialized by the operating system's loader."

          I'm not a stalker, I just know things. Oh by the way, you're out of milk.

          Forgive your enemies - it messes with their heads

          My blog | My articles | MoXAML PowerToys | Onyx

          L 1 Reply Last reply
          0
          • P Pete OHanlon

            There's your problem then. The Loader Lock was introduced in VS2005. From MSDN[^]: "The loaderLock managed debugging assistant (MDA) detects attempts to execute managed code on a thread that holds the Microsoft Windows operating system loader lock. Any such execution is illegal because it can lead to deadlocks and to use of DLLs before they have been initialized by the operating system's loader."

            I'm not a stalker, I just know things. Oh by the way, you're out of milk.

            Forgive your enemies - it messes with their heads

            My blog | My articles | MoXAML PowerToys | Onyx

            L Offline
            L Offline
            L Viljoen
            wrote on last edited by
            #5

            Then why was i able to debug my application in version 2008 and now in 2010 version I cant. Is there any workarounds/hotfixes that will be able to help me ?

            Chona1171 Web Developer (C#), Silverlight

            P D 2 Replies Last reply
            0
            • L L Viljoen

              Then why was i able to debug my application in version 2008 and now in 2010 version I cant. Is there any workarounds/hotfixes that will be able to help me ?

              Chona1171 Web Developer (C#), Silverlight

              P Offline
              P Offline
              Pete OHanlon
              wrote on last edited by
              #6

              .NET 4 is a complete overhaul of .NET rather than an upgrade path from .NET 2. It sounds like the problem's actually in the COM part. Have a read of the link I gave you (specifically the Resolution part) and follow the links in that page.

              I'm not a stalker, I just know things. Oh by the way, you're out of milk.

              Forgive your enemies - it messes with their heads

              My blog | My articles | MoXAML PowerToys | Onyx

              1 Reply Last reply
              0
              • L L Viljoen

                Can anyone help me basically my situation is as follow. I used to develop in .net 3.5 sp1 using visual studio 2008 I was able to run/debug my program without any hassles whatsoever. Then I recently upgraded my solutions to .net framework 4 on visual studio 2010 My programs still run fine but when i try to run it in debug mode i get the following exception in visual studio, An unhandled exception of type 'System.StackOverflowException' occurred If anyone can point me to something i can do or a hotfix for this i would be very happy. My System a Dual CORE CPU 4 Gigs ram running on a 64 bit windows 7 operating system. I do my development inside an XP Pro(32bit) virtual machine (VMware) 2.5 gigs of ram allocated. Many thanks

                Chona1171 Web Developer (C#), Silverlight

                A Offline
                A Offline
                Abhinav S
                wrote on last edited by
                #7

                You might have to do some searching on the internet. There might be something in your code that causes this error to occur. I found a couple of threads where such issues have been discussed. One was this[^] and the other was with lambda expressions.

                The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it. My latest tip/trick

                1 Reply Last reply
                0
                • L L Viljoen

                  Then why was i able to debug my application in version 2008 and now in 2010 version I cant. Is there any workarounds/hotfixes that will be able to help me ?

                  Chona1171 Web Developer (C#), Silverlight

                  D Offline
                  D Offline
                  Dave Kreskowiak
                  wrote on last edited by
                  #8

                  It seems you are hell-bent on finding a "fix" for this. Did you consider the possibility that you've been exploiting a bug in the .NET Framework and that bug has now been fixed under .NET 4.0? I can't find a hotfix, for either Visual Studio 2010 or .NET 4.0, for this problem anywhere, other than change your code.

                  A guide to posting questions on CodeProject[^]
                  Dave Kreskowiak

                  L 1 Reply Last reply
                  0
                  • D Dave Kreskowiak

                    It seems you are hell-bent on finding a "fix" for this. Did you consider the possibility that you've been exploiting a bug in the .NET Framework and that bug has now been fixed under .NET 4.0? I can't find a hotfix, for either Visual Studio 2010 or .NET 4.0, for this problem anywhere, other than change your code.

                    A guide to posting questions on CodeProject[^]
                    Dave Kreskowiak

                    L Offline
                    L Offline
                    L Viljoen
                    wrote on last edited by
                    #9

                    Nope This problem only occurs when using visual studio 2010 even when setting the project back to 3.5 does not fix it. But nice theory. Again only occurs when debugging if compiled and running outside of debug mode the program runs beautifully, i can live with it but i sure am gonna miss stepping through code

                    Chona1171 Web Developer (C#), Silverlight

                    1 Reply Last reply
                    0
                    • L L Viljoen

                      Can anyone help me basically my situation is as follow. I used to develop in .net 3.5 sp1 using visual studio 2008 I was able to run/debug my program without any hassles whatsoever. Then I recently upgraded my solutions to .net framework 4 on visual studio 2010 My programs still run fine but when i try to run it in debug mode i get the following exception in visual studio, An unhandled exception of type 'System.StackOverflowException' occurred If anyone can point me to something i can do or a hotfix for this i would be very happy. My System a Dual CORE CPU 4 Gigs ram running on a 64 bit windows 7 operating system. I do my development inside an XP Pro(32bit) virtual machine (VMware) 2.5 gigs of ram allocated. Many thanks

                      Chona1171 Web Developer (C#), Silverlight

                      R Offline
                      R Offline
                      Robert Tanenbaum
                      wrote on last edited by
                      #10

                      you mentioned that you upgraded from VS 2008 .Net 3.5 to VS 2010 .Net 4.0 and that the problem is in some COM code. Go back and check your reference assemblies. Many reference assemblies have different .dll versions for 3.5 versus 4.0. Be sure you are using the updated assembly. Good luck. Robert Tanenbaum

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups