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. Managed C++/CLI
  4. How to trace an unhandled exception in C++ using Visual Studio 2017

How to trace an unhandled exception in C++ using Visual Studio 2017

Scheduled Pinned Locked Moved Managed C++/CLI
visual-studiodebugginghelpcsharpc++
5 Posts 4 Posters 15 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.
  • D Offline
    D Offline
    Dominick Marciano
    wrote on last edited by
    #1

    I am currently working on fixing a project for a client. A little information about the project first: 1. Originally developed in Visual Studio 2012 using xp_v110 build tools 2. Multiple projects in the solution 3. Currently updating/debugging in Visual Studio 2017 using VS 2015/xp_v140 build tools 4. Working on Windows 10 The application will run in debug mode, however if I just leave the application after starting the debug session (i.e. not opening/clicking on the application to open it as it starts minimized in the tray), the application crashes after 1-2 minutes. Unfortunately the IDE is showing that the crash is taking place in chkstk.asm with the following message: Exception thrown at 0x0064EDF9 in <>: 0xC00000FD: Stack overflow (parameters 0x00000000, 0x000A2000). I have updated the exception settings to break when all C++ Exceptions are thrown, checked the box that says "Break when this exception type is thrown", and wrapped the initial method that runs in a try block, however I can never catch the error in the C++ code; it always occurs in the chkstk.asm file. Any suggestions on how I can find out where in the C++ code the exception is occurring. Like I said, this is an update for a client and the original programmer is not available, and they never commented their code, so it is difficult enough trying to go through all this. Any help/suggestions would be greatly appreciated. Thanks in advance.

    A black hole is where God tried to divide by zero. There are 10 kinds of people in the world; those who understand binary and those who don't.

    L J 2 Replies Last reply
    0
    • D Dominick Marciano

      I am currently working on fixing a project for a client. A little information about the project first: 1. Originally developed in Visual Studio 2012 using xp_v110 build tools 2. Multiple projects in the solution 3. Currently updating/debugging in Visual Studio 2017 using VS 2015/xp_v140 build tools 4. Working on Windows 10 The application will run in debug mode, however if I just leave the application after starting the debug session (i.e. not opening/clicking on the application to open it as it starts minimized in the tray), the application crashes after 1-2 minutes. Unfortunately the IDE is showing that the crash is taking place in chkstk.asm with the following message: Exception thrown at 0x0064EDF9 in <>: 0xC00000FD: Stack overflow (parameters 0x00000000, 0x000A2000). I have updated the exception settings to break when all C++ Exceptions are thrown, checked the box that says "Break when this exception type is thrown", and wrapped the initial method that runs in a try block, however I can never catch the error in the C++ code; it always occurs in the chkstk.asm file. Any suggestions on how I can find out where in the C++ code the exception is occurring. Like I said, this is an update for a client and the original programmer is not available, and they never commented their code, so it is difficult enough trying to go through all this. Any help/suggestions would be greatly appreciated. Thanks in advance.

      A black hole is where God tried to divide by zero. There are 10 kinds of people in the world; those who understand binary and those who don't.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      You need to get the stack trace at the time of the crash and walk back through it to find out who is using all the stack space.

      A 1 Reply Last reply
      0
      • D Dominick Marciano

        I am currently working on fixing a project for a client. A little information about the project first: 1. Originally developed in Visual Studio 2012 using xp_v110 build tools 2. Multiple projects in the solution 3. Currently updating/debugging in Visual Studio 2017 using VS 2015/xp_v140 build tools 4. Working on Windows 10 The application will run in debug mode, however if I just leave the application after starting the debug session (i.e. not opening/clicking on the application to open it as it starts minimized in the tray), the application crashes after 1-2 minutes. Unfortunately the IDE is showing that the crash is taking place in chkstk.asm with the following message: Exception thrown at 0x0064EDF9 in <>: 0xC00000FD: Stack overflow (parameters 0x00000000, 0x000A2000). I have updated the exception settings to break when all C++ Exceptions are thrown, checked the box that says "Break when this exception type is thrown", and wrapped the initial method that runs in a try block, however I can never catch the error in the C++ code; it always occurs in the chkstk.asm file. Any suggestions on how I can find out where in the C++ code the exception is occurring. Like I said, this is an update for a client and the original programmer is not available, and they never commented their code, so it is difficult enough trying to go through all this. Any help/suggestions would be greatly appreciated. Thanks in advance.

        A black hole is where God tried to divide by zero. There are 10 kinds of people in the world; those who understand binary and those who don't.

        J Offline
        J Offline
        John Schroedl
        wrote on last edited by
        #3

        I suggest you launch the app in the debugger and then wait for ~20 seconds then break into the debugger. Most likely you'll see the a deep stack as it's in the midst of eating up stack space. That callstack should lead you to the issue.

        1 Reply Last reply
        0
        • L Lost User

          You need to get the stack trace at the time of the crash and walk back through it to find out who is using all the stack space.

          A Offline
          A Offline
          AndreyAksenov
          wrote on last edited by
          #4

          You should make small memory dump using windows task manager. If you have application .pdb files and source files you can load windows dump file with Visual studio and debug it as managed code. If there are symbols debugging files (pdb) you can see thread`s stack in appropriate state.

          L 1 Reply Last reply
          0
          • A AndreyAksenov

            You should make small memory dump using windows task manager. If you have application .pdb files and source files you can load windows dump file with Visual studio and debug it as managed code. If there are symbols debugging files (pdb) you can see thread`s stack in appropriate state.

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            I think this message was meant for the OP.

            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