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. C / C++ / MFC
  4. Crashes in release mode but not in debug

Crashes in release mode but not in debug

Scheduled Pinned Locked Moved C / C++ / MFC
c++hardwaredebuggingquestionannouncement
5 Posts 4 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.
  • R Offline
    R Offline
    RedSonja
    wrote on last edited by
    #1

    My C++ project (embedded real-time stuff) has run nicely for years. Now I split off some of the code to a separate exe. I always test in debug mode, so I didn't worry much about release mode. So when the user starts it in release mode, as soon as the exe is called it comes with "The application has requested runtime to terminate it in an unusual way". I have seen this before, it was the exe throwing an unhandled exception. But the thing has more exception handlers than code now, and it runs fine in debug. What can be causing this? I checked the project properties, there is nothing surprising in there. Maybe someone can give me a tip what I should be looking for?

    ------------- Bibo ergo sum

    A H B R 4 Replies Last reply
    0
    • R RedSonja

      My C++ project (embedded real-time stuff) has run nicely for years. Now I split off some of the code to a separate exe. I always test in debug mode, so I didn't worry much about release mode. So when the user starts it in release mode, as soon as the exe is called it comes with "The application has requested runtime to terminate it in an unusual way". I have seen this before, it was the exe throwing an unhandled exception. But the thing has more exception handlers than code now, and it runs fine in debug. What can be causing this? I checked the project properties, there is nothing surprising in there. Maybe someone can give me a tip what I should be looking for?

      ------------- Bibo ergo sum

      A Offline
      A Offline
      Alan Balkany
      wrote on last edited by
      #2

      This is just what you need: http://www.codeproject.com/KB/debug/survivereleasever.aspx[^] (Surviving the Release Version By Joseph M. Newcomer)

      1 Reply Last reply
      0
      • R RedSonja

        My C++ project (embedded real-time stuff) has run nicely for years. Now I split off some of the code to a separate exe. I always test in debug mode, so I didn't worry much about release mode. So when the user starts it in release mode, as soon as the exe is called it comes with "The application has requested runtime to terminate it in an unusual way". I have seen this before, it was the exe throwing an unhandled exception. But the thing has more exception handlers than code now, and it runs fine in debug. What can be causing this? I checked the project properties, there is nothing surprising in there. Maybe someone can give me a tip what I should be looking for?

        ------------- Bibo ergo sum

        H Offline
        H Offline
        Hamid Taebi
        wrote on last edited by
        #3

        See Debugging Release Mode Problems[^].

        1 Reply Last reply
        0
        • R RedSonja

          My C++ project (embedded real-time stuff) has run nicely for years. Now I split off some of the code to a separate exe. I always test in debug mode, so I didn't worry much about release mode. So when the user starts it in release mode, as soon as the exe is called it comes with "The application has requested runtime to terminate it in an unusual way". I have seen this before, it was the exe throwing an unhandled exception. But the thing has more exception handlers than code now, and it runs fine in debug. What can be causing this? I checked the project properties, there is nothing surprising in there. Maybe someone can give me a tip what I should be looking for?

          ------------- Bibo ergo sum

          B Offline
          B Offline
          bob16972
          wrote on last edited by
          #4

          Make sure to check that any member variable pointers are in the class initialization list and set to NULL. This is usually the number one cause of the behavior you are describing, at least in my shop.

          1 Reply Last reply
          0
          • R RedSonja

            My C++ project (embedded real-time stuff) has run nicely for years. Now I split off some of the code to a separate exe. I always test in debug mode, so I didn't worry much about release mode. So when the user starts it in release mode, as soon as the exe is called it comes with "The application has requested runtime to terminate it in an unusual way". I have seen this before, it was the exe throwing an unhandled exception. But the thing has more exception handlers than code now, and it runs fine in debug. What can be causing this? I checked the project properties, there is nothing surprising in there. Maybe someone can give me a tip what I should be looking for?

            ------------- Bibo ergo sum

            R Offline
            R Offline
            RedSonja
            wrote on last edited by
            #5

            That was very kind of all of you - I now know that you really can debug in release mode - but the problem was something else entirely. When I first made my exe it was a dll project, then I decided to make an exe after all, and since I was in a hurry I did this by copying and renaming, then changing the properties to fit. Anyway, I ended up with both main and InitInstance. Debug runs main, it seems, and release takes InitInstance if it can find one, or maybe main is optimised out. I commented InitInstance out and suddenly all is well.

            ------------- Bibo ergo sum

            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