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. Catch c++ runtime library error

Catch c++ runtime library error

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpdebuggingannouncement
4 Posts 3 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.
  • J Offline
    J Offline
    JensB
    wrote on last edited by
    #1

    Hi I have a problem with a certain application which causes a runtime library error. This error is not frequently shown, the program can run about 3+ weeks non-stop, working perfectly .. sometimes it only lasts about 2 weeks. When it crashes, i get an runtime error : Microsoft Visual C++ Runtime library Runtime Error ! Program: myprogram.exe abnormal program termination 'OK' I want to catch c++ runtime librarys errors and avoid having to click on the 'OK' button. The program is build in release-mode, so i don't understand why i still get that message. I thought this would only happen on debug-programs. The program should crash & close yes, but not show any dialog. We monitor the program frequently & rerun the program automatically if necessary. I know i should find the error first, but i shouldn't swear neither ;) Best regards, Jens

    P T 2 Replies Last reply
    0
    • J JensB

      Hi I have a problem with a certain application which causes a runtime library error. This error is not frequently shown, the program can run about 3+ weeks non-stop, working perfectly .. sometimes it only lasts about 2 weeks. When it crashes, i get an runtime error : Microsoft Visual C++ Runtime library Runtime Error ! Program: myprogram.exe abnormal program termination 'OK' I want to catch c++ runtime librarys errors and avoid having to click on the 'OK' button. The program is build in release-mode, so i don't understand why i still get that message. I thought this would only happen on debug-programs. The program should crash & close yes, but not show any dialog. We monitor the program frequently & rerun the program automatically if necessary. I know i should find the error first, but i shouldn't swear neither ;) Best regards, Jens

      P Offline
      P Offline
      Prakash Nadar
      wrote on last edited by
      #2

      Check how much memory is your application consuming while executing. Check every day, Is it only incremental. Eventually your system will run out of memory and in some place you might have allocated memory (which failed) and written at that location which currupted certain memory area which is throwing that error. or you need you have a good logging info generated to figure out why and where it is failing.


      -prakash

      J 1 Reply Last reply
      0
      • P Prakash Nadar

        Check how much memory is your application consuming while executing. Check every day, Is it only incremental. Eventually your system will run out of memory and in some place you might have allocated memory (which failed) and written at that location which currupted certain memory area which is throwing that error. or you need you have a good logging info generated to figure out why and where it is failing.


        -prakash

        J Offline
        J Offline
        JensB
        wrote on last edited by
        #3

        Hi, i have already done that. The memory is not incremental, memory usages stays the same. Catching std::overflow_error& exception, won't this catch the runtime exception and prevent the program from displaying the error? Greetings, Jens

        1 Reply Last reply
        0
        • J JensB

          Hi I have a problem with a certain application which causes a runtime library error. This error is not frequently shown, the program can run about 3+ weeks non-stop, working perfectly .. sometimes it only lasts about 2 weeks. When it crashes, i get an runtime error : Microsoft Visual C++ Runtime library Runtime Error ! Program: myprogram.exe abnormal program termination 'OK' I want to catch c++ runtime librarys errors and avoid having to click on the 'OK' button. The program is build in release-mode, so i don't understand why i still get that message. I thought this would only happen on debug-programs. The program should crash & close yes, but not show any dialog. We monitor the program frequently & rerun the program automatically if necessary. I know i should find the error first, but i shouldn't swear neither ;) Best regards, Jens

          T Offline
          T Offline
          Tim Smith
          wrote on last edited by
          #4

          The message looks to be getting generated via a call to "abort" which turns aronud and calls "_NMSG_WRITE". To change where this information gets logged, change the "__error_mode" to "_OUT_TO_STDERR" via a call to "_set_error_mode". This will have to be done for the EXE and DLL that uses statically linked CRTL or just the EXE if everyone is linking dynamically to CRTL. Tim Smith I'm going to patent thought. I have yet to see any prior art.

          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