473,725 Members | 2,281 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Debugging Runtime Error

Hello All,

I have been trying without luck to get some information on debugging
the Runtime Error R6025 - Pure Virtual Function Call. I am working in
C++ and have only one class that is derived from an Abstract class, I
do not believe that this class object is causing me my problem. Below
is that message I have posted before to other groups.

Question:

I am experiencing a Runtime Error R6025 - Pure Virtual Function Call
in an application I have written. I am trying to figure out what it
is that could be causing this error. I have searched Google Groups
for other posting that discuss the R6025 Error, and read many of them.

From what I can tell, this type of error is caused by an undefined or
unhandled virtual function call that a class object must define when
inheriting from an abstract class. Additionally I have read that this
error most offen occurrs during object construction due to a virtual
function being called before the object has been completely created.
This is not my error, I am 99.999% sure of that.

Rather than ask you all to read my own code to help me find my bug, I
was wondering if anyone could advise to me a good way of debugging
this type of error.

The most promising post I found on Google Groups for debugging such an
error discusses a process of redefining or linking with the function
"void __cdecl purecall(void)" from the C Runtime Library source file
PUREVIRT.C.

I first tried to define this function within my own project, and
putting a breakpoint inside my function definition which would allow
me to view the call stack. Unfortunately, this version of the
function in my own project never gets called. This makes me think
that the problem is somewhere else in Windows and not my own source.
Does this make sense to anyone?

I next attempted to add the line: #include "purevirt.c " in my source,
and adding the ..\VC98\CRT\SRC directory to my
Tools->Options->Directories->Include path of Visual Studio.
Attempting to build my project gives me the error "C2556 - Overloaded
function differs in return type".

Next I tried to add the PUREVIRT.C file directly to my project. This
gave me a host of linker errors including not being able to find my
main() function. Does anyone know what is it that I am doing wrong
trying to trap on the _purecall() to view the function stack? It
appears to me that this method is for use with standard C proramming
not C++, hence the undefined main() linker error.

If anyone follows my question and can give me advise on figuring out
where my error is occurring you would make my day. I have been going
batty trying to figure this out. Does my approach of trying to trap
the _purecall() function make sense since I am programming in C++? Is
there another way around debugging this type of error?

Any help is greatly appreciated, even if its just to tell me that I
have posted my message on the wrong message board. If this is true
however, please advise the best Google Group for answering this type
of question.

Thank You,

Bob Bamberg
Jul 19 '05 #1
5 15941
"Bob Bamberg" <ro************ @verizon.net> wrote...
I have been trying without luck to get some information on debugging
the Runtime Error R6025 - Pure Virtual Function Call. I am working in
C++ and have only one class that is derived from an Abstract class, I
do not believe that this class object is causing me my problem. Below
is that message I have posted before to other groups.
[...]


The easiest thing would be to _define_ the function that is allegedly
being called (instead of having it pure) and put a breakpoint in it.
You will see where it's called from.

Victor
Jul 19 '05 #2
Bob Bamberg wrote:

Any help is greatly appreciated, even if its just to tell me that I
have posted my message on the wrong message board. If this is true
however, please advise the best Google Group for answering this type
of question.


Make all exceptions stop in the debugger at the point of the
throw. You'll find that option under the debug menu.

Jul 19 '05 #3
lilburne <li******@godzi lla.net> wrote in message news:<bo******* ******@ID-203936.news.uni-berlin.de>...
Bob Bamberg wrote:

Any help is greatly appreciated, even if its just to tell me that I
have posted my message on the wrong message board. If this is true
however, please advise the best Google Group for answering this type
of question.


Make all exceptions stop in the debugger at the point of the
throw. You'll find that option under the debug menu.


Thank you Victor and lilburne for your responses to my question.

Unfortunately Victor, I don't know which function is being called. If
I did, I would make sure it was defined. As far as I can see, I have
defined the only virtual function needed to be handled in the one
class I have which inherits from an abstract base class. This is why
I was trying to follow up on the idea of putting a breakpoint in the
purecall() function.

lilburne, I'm not sure what you mean by making all exceptions stop in
the debugger through the debug menu. I am using Visual Studio and
there does not appear to be a debug menu directly. Could you please
give additional information here. Also, I'm still not sure that this
method will solve my problem. I do not believe that a Pure Virtual
Function Call causes an exception, but just a runtime error. If you
could give more details on trying your suggestion I am happy to try it
though since I am currently stuck here.

Thanks,

Bob
Jul 19 '05 #4
Bob Bamberg wrote:
lilburne <li******@godzi lla.net> wrote in message news:<bo******* ******@ID-203936.news.uni-berlin.de>...
lilburne, I'm not sure what you mean by making all exceptions stop in
the debugger through the debug menu. I am using Visual Studio and
there does not appear to be a debug menu directly. Could you please
give additional information here. Also, I'm still not sure that this
method will solve my problem. I do not believe that a Pure Virtual
Function Call causes an exception, but just a runtime error. If you
could give more details on trying your suggestion I am happy to try it
though since I am currently stuck here.


Indication is that an exception is being thrown, which
results in the runtime error report:
http://dbforums.com/arch/89/2002/5/374760

Not having access to msdev I can't confirm that but you
could quickly put together a test see below.

When you run your application from within msdev the 'build'
menu changes to a 'debug' menu - at least with VC++6. Under
this menu there is an item 'exceptions' this raises a dialog
where you can highlight all the exception types and set them
to 'stop always' rather than 'stop if unhandled'. Using this
technique you'll get to break into the debugger when the
exception is first thrown, rather than where it is caught,
and thus have a decent stack trace.

Alternatively you can use the technique presented here:
http://support.microsoft.com/default...;EN-US;q125749

but that presupposes that you know which virtual function is
being called. You do suggest though that you believe it is
some virtual in a class other than the one you are testing.

My suspicion would be that during construction of a base
class a pure virtual is being called, probably indirectly.
But without examining the code it is only a suspicion.

#include <iostream>

class A;

void f(A& a);

class A {
public:
A();
virtual void pure() = 0;
};

A::A()
{
f(*this);
}

class B : public A {
public:
virtual void pure();
};

void B::pure()
{
}

void f(A& a)
{
a.pure();
}

int main()
{
try {
B b;
}
catch (...) {
std::cout << "Caught exception" << std::endl;
}
return 0;
}
Jul 19 '05 #5
lilburne <li******@godzi lla.net> wrote in message news:<bo******* ******@ID-203936.news.uni-berlin.de>...
Bob Bamberg wrote:
lilburne <li******@godzi lla.net> wrote in message news:<bo******* ******@ID-203936.news.uni-berlin.de>...
lilburne, I'm not sure what you mean by making all exceptions stop in
the debugger through the debug menu. I am using Visual Studio and
there does not appear to be a debug menu directly. Could you please
give additional information here. Also, I'm still not sure that this
method will solve my problem. I do not believe that a Pure Virtual
Function Call causes an exception, but just a runtime error. If you
could give more details on trying your suggestion I am happy to try it
though since I am currently stuck here.


Indication is that an exception is being thrown, which
results in the runtime error report:
http://dbforums.com/arch/89/2002/5/374760

Not having access to msdev I can't confirm that but you
could quickly put together a test see below.

When you run your application from within msdev the 'build'
menu changes to a 'debug' menu - at least with VC++6. Under
this menu there is an item 'exceptions' this raises a dialog
where you can highlight all the exception types and set them
to 'stop always' rather than 'stop if unhandled'. Using this
technique you'll get to break into the debugger when the
exception is first thrown, rather than where it is caught,
and thus have a decent stack trace.

Alternatively you can use the technique presented here:
http://support.microsoft.com/default...;EN-US;q125749

but that presupposes that you know which virtual function is
being called. You do suggest though that you believe it is
some virtual in a class other than the one you are testing.

My suspicion would be that during construction of a base
class a pure virtual is being called, probably indirectly.
But without examining the code it is only a suspicion.

#include <iostream>

class A;

void f(A& a);

class A {
public:
A();
virtual void pure() = 0;
};

A::A()
{
f(*this);
}

class B : public A {
public:
virtual void pure();
};

void B::pure()
{
}

void f(A& a)
{
a.pure();
}

int main()
{
try {
B b;
}
catch (...) {
std::cout << "Caught exception" << std::endl;
}
return 0;
}


Thanks for the additional information lilburne. I was able to
following your directions once my program was started in debug mode.
It appears as though my problem is occurring due to a Pure Virtual
function that I should not be required to provide. Specifically it is
a Media Service Provider's pure virtual function that is supposed to
be handled by TAPI 3.0. I am not supposed to be dealing with it at
all.

I think I have a handle on where things are going wrong. Thanks again
for your followup posting.

Bob
Jul 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1267
by: Gary Karasik | last post by:
Hi, One of my SBS 2K3 servers is giving the following errors when trying to run certain applications. Some Googling indicates that these are .Net Framework errors. I've tried reapplying .Net Framework Service Pack 1 for Windows Server 2003, but that didn't help. I'm afraid I might need to pay MS on this one, but before I spend $245 of my client's money, I thought I'd take a shot here. Anybody have any ideas about how to track this one...
1
6246
by: Sathiamoorthy | last post by:
I received a runtime error when I was working in MyApp.exe MyApp.exe Common Language Runtime Debugging Services Application has generated an exception that could not be handled. Process ID=0x14 (1300), Thread Id=0xe8(232) Any one help me
1
2971
by: simpsoro | last post by:
How do you enable debugging so that people see it from the client side? I have gone in to properties, clicked on edit www service, clicked on the home directory tab, clicked on the configuration button, clicked on the app debugging tab and then checked the box that says enable ASP client-side script debugging. But on the client side they still get the generic debug message: ...
10
8711
by: Shawn | last post by:
JIT Debugging failed with the following error: Access is denied. JIT Debugging was initiated by the following account 'PLISKEN\ASPNET' I get this messag in a dialog window when I try to open an asp.net page. If I press OK then I get a page with this message: Server Application Unavailable The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser...
5
3635
by: snicks | last post by:
I'm trying to exec a program external to my ASP.NET app using the following code. The external app is a VB.NET application. Dim sPPTOut As String sPPTOut = MDEPDirStr + sID + ".ppt" Dim p As New System.Diagnostics.Process 'p.Start(MDEPDirStr & "macrun.exe", sPPTOut) p.Start("C:\WINDOWS\SYSTEM32\CALC.EXE") 'p.Start("C:\WINDOWS\SYSTEM32\macrun.exe", sPPTOut)
5
7801
by: phnimx | last post by:
Hi , We have developed a number of plug-in .NET Library Components that we typically deploy with our various applications by installing them into the GAC. Each of the applications contains an app.config file referencing arbitrary versions of the plug-in components they wish to consume. Here's the problem: Assuming I have installed any one of our application software,
0
999
by: TC | last post by:
When I'm debugging code and a runtime error occurs, Visual Studio usually gives me a specific error message and identifies the line which caused the error. Sometimes, however, it does not do those things. Instead, it gives me the generic error message "Exception has been thrown by the target of an invocation" and identifies a line higher up in the call stack. When this happens, it can be difficult to diagnose the cause of the runtime...
0
379
by: stimpy_cm | last post by:
Hi everyone, I’m not a programmer but have a little notion about how things work. I recently downloaded an emulator for my calculator (Texas Instruments Voyage 200), the program uses a library created for .Net framework 1.0 and 1.1. I also activated the compatibility mode for Windows XP SP2 (Which it was the OS the programs were created for). By the way I’ve an HP Pavillion with Intel Core 2 Duo 2.0Ghz processor, and my OS is Windows Vista...
0
2412
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgRGVzYXJyb2xsbw==?= | last post by:
Hi misters, i have application winforms in VB.NET When I press F5, for executing Debug....it's slows... I see,
0
8889
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8752
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9401
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9257
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9179
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8099
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3228
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.