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. Troubleshooting R6025 Runtime error message

Troubleshooting R6025 Runtime error message

Scheduled Pinned Locked Moved C / C++ / MFC
debugginghelptutorialc++question
7 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.
  • L Offline
    L Offline
    ledallam
    wrote on last edited by
    #1

    Hi, I am woking on VC++ project. When I run the project in Release mode, I am getting R6025 Runtime error message. The project has hundreds of virtual functions not written by me and I have no clue as to find out from where this message box is coming? If I run in debug mode, I am not getting this error message box. If I try to debug in release mode, I am still not getting this error message. Can anyone please guide me as to how to trace out the cause for thsi problem? Thanks Madhavi

    K S 2 Replies Last reply
    0
    • L ledallam

      Hi, I am woking on VC++ project. When I run the project in Release mode, I am getting R6025 Runtime error message. The project has hundreds of virtual functions not written by me and I have no clue as to find out from where this message box is coming? If I run in debug mode, I am not getting this error message box. If I try to debug in release mode, I am still not getting this error message. Can anyone please guide me as to how to trace out the cause for thsi problem? Thanks Madhavi

      K Offline
      K Offline
      kakan
      wrote on last edited by
      #2

      Check out this article: http://www.codeproject.com/debug/mapfile.asp[^]

      1 Reply Last reply
      0
      • L ledallam

        Hi, I am woking on VC++ project. When I run the project in Release mode, I am getting R6025 Runtime error message. The project has hundreds of virtual functions not written by me and I have no clue as to find out from where this message box is coming? If I run in debug mode, I am not getting this error message box. If I try to debug in release mode, I am still not getting this error message. Can anyone please guide me as to how to trace out the cause for thsi problem? Thanks Madhavi

        S Offline
        S Offline
        Stephen Hewitt
        wrote on last edited by
        #3

        As you're probably aware, this means that you called a pure virtual function. At first sight this seems impossible - But it is not. What's more, in general, such errors can't be caught at compile time. Here is some code that shows how this can happen:

        #include <iostream>
        using namespace std;
        
        class Base
        {
        public:
        	virtual VirtualFunction() = 0;
        };
        
        void UseIt(Base *pBase)
        {
        	pBase->VirtualFunction();
        }
        
        class Base2 : public Base
        {
        public:
        	Base2()
        	{
        		UseIt(this);
        	}
        };
        
        class Derived : public Base2
        {
        public:
        	Derived()
        	{
        	}
        
        	virtual VirtualFunction()
        	{
        		cout << "Derived::VirtualFunction\n";
        	}
        };
        
        int main(int argc, char* argv[])
        {
        	Derived d;
        	return 0;
        }
        

        It happens because you are calling a virtual function in a function that is called from a constructor (and the object is partially constructed). To debug it I would launch it in the debugger and when the error dialog appears break and look at the call stack. If it only happens in a release build, build a release build with debug info and follow the procudure above - Debugging with a map file isn't needed when you do this, it's the hard way. Steve

        L 2 Replies Last reply
        0
        • S Stephen Hewitt

          As you're probably aware, this means that you called a pure virtual function. At first sight this seems impossible - But it is not. What's more, in general, such errors can't be caught at compile time. Here is some code that shows how this can happen:

          #include <iostream>
          using namespace std;
          
          class Base
          {
          public:
          	virtual VirtualFunction() = 0;
          };
          
          void UseIt(Base *pBase)
          {
          	pBase->VirtualFunction();
          }
          
          class Base2 : public Base
          {
          public:
          	Base2()
          	{
          		UseIt(this);
          	}
          };
          
          class Derived : public Base2
          {
          public:
          	Derived()
          	{
          	}
          
          	virtual VirtualFunction()
          	{
          		cout << "Derived::VirtualFunction\n";
          	}
          };
          
          int main(int argc, char* argv[])
          {
          	Derived d;
          	return 0;
          }
          

          It happens because you are calling a virtual function in a function that is called from a constructor (and the object is partially constructed). To debug it I would launch it in the debugger and when the error dialog appears break and look at the call stack. If it only happens in a release build, build a release build with debug info and follow the procudure above - Debugging with a map file isn't needed when you do this, it's the hard way. Steve

          L Offline
          L Offline
          ledallam
          wrote on last edited by
          #4

          Hi Stephen Hewitt, Thanks for your help. I understood the concept here.. I went through the aricle available at:

          1 Reply Last reply
          0
          • S Stephen Hewitt

            As you're probably aware, this means that you called a pure virtual function. At first sight this seems impossible - But it is not. What's more, in general, such errors can't be caught at compile time. Here is some code that shows how this can happen:

            #include <iostream>
            using namespace std;
            
            class Base
            {
            public:
            	virtual VirtualFunction() = 0;
            };
            
            void UseIt(Base *pBase)
            {
            	pBase->VirtualFunction();
            }
            
            class Base2 : public Base
            {
            public:
            	Base2()
            	{
            		UseIt(this);
            	}
            };
            
            class Derived : public Base2
            {
            public:
            	Derived()
            	{
            	}
            
            	virtual VirtualFunction()
            	{
            		cout << "Derived::VirtualFunction\n";
            	}
            };
            
            int main(int argc, char* argv[])
            {
            	Derived d;
            	return 0;
            }
            

            It happens because you are calling a virtual function in a function that is called from a constructor (and the object is partially constructed). To debug it I would launch it in the debugger and when the error dialog appears break and look at the call stack. If it only happens in a release build, build a release build with debug info and follow the procudure above - Debugging with a map file isn't needed when you do this, it's the hard way. Steve

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

            Hi , Thanks for your help..I understood the concept here.. The problem is that there are hundreds of virtual functions in the project that are not written by me and moreover I get this exception only in release mode. If I run the application in release with debug information, I am still not able to reproduce this exception. So is there any way to find out from where this exception is coming while running in release mode? Thanks Madhavi.

            S 1 Reply Last reply
            0
            • L ledallam

              Hi , Thanks for your help..I understood the concept here.. The problem is that there are hundreds of virtual functions in the project that are not written by me and moreover I get this exception only in release mode. If I run the application in release with debug information, I am still not able to reproduce this exception. So is there any way to find out from where this exception is coming while running in release mode? Thanks Madhavi.

              S Offline
              S Offline
              Stephen Hewitt
              wrote on last edited by
              #6

              Building a release build with debug info will not alter the way the application behaves. To turn on debug info for the release build follow these steps (VC6): - Select the release configuration as the active config. - Project settings, "C/C++" tab, "General" category: Select "Program Database" in the "Debug Info" combo. - "Link" tab, "Debug" category: Tick "Debug info", "Microsoft format" & "Separate types". - Rebuild. If your workspace contains multiple projects follow the same steps for each one. Run the application in the debugger (still the release build however) and reproduce the problem. When the error dialog appears break in and look at the call stack. You may have to hunt for the correct thread. Because optimizations are enabled your debugger will "lie" to you from time to time (when some optimization trips it up) so beware. I actually always follow these steps for release builds. Having the .PDB files has many benefits such as simplifying postmortem analysis with crash dump files. In a production environment you should have a symbol server on the build machine and the .PDB files get added to the symbol server as part of the build process. Steve

              L 1 Reply Last reply
              0
              • S Stephen Hewitt

                Building a release build with debug info will not alter the way the application behaves. To turn on debug info for the release build follow these steps (VC6): - Select the release configuration as the active config. - Project settings, "C/C++" tab, "General" category: Select "Program Database" in the "Debug Info" combo. - "Link" tab, "Debug" category: Tick "Debug info", "Microsoft format" & "Separate types". - Rebuild. If your workspace contains multiple projects follow the same steps for each one. Run the application in the debugger (still the release build however) and reproduce the problem. When the error dialog appears break in and look at the call stack. You may have to hunt for the correct thread. Because optimizations are enabled your debugger will "lie" to you from time to time (when some optimization trips it up) so beware. I actually always follow these steps for release builds. Having the .PDB files has many benefits such as simplifying postmortem analysis with crash dump files. In a production environment you should have a symbol server on the build machine and the .PDB files get added to the symbol server as part of the build process. Steve

                L Offline
                L Offline
                ledallam
                wrote on last edited by
                #7

                Hi, Thanks for your reply.. This crash occurs only in release mode. It does not occur If I set the bebug information(i.e Link->GenerateDebugInfo settings ) in release mode. Moreover this does not reproduce in release mode always..It comes up some times only..i.e I don't have the steps for repeating this error. Hence I don't think it is problem with virtual function call. If it was a problem with virtual function call, I should be able to reproduce this error always in both debug and release builds ..right? Is there any other reason for this error message? Do my Link options of Project settings have any impact on this error? My link options are: CTS32D.LIB RTS32D.LIB TAPI32.LIB VERSION.LIB WINMM.LIB VFW32.LIB.. Please let me know if you have further inputs on this as I am not getting any clue for resolving this issue.. Is there any tool that can catch and take us to the code that is creating these runtime errors.. Thanks.. Madhavi..

                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