Ask a Question related to Mac Programming, Design and Development.
-
Stefan Arentz #1
GCC C++ Issue: pure virtual method called
I have a threaded C++ application that produces a 'pure virtual method called'
error about 3 out of 10 times while starting up the application. The error is
confusing because this should be a compile-time error instead of runtime.
My question is how I can trap an error like this so that I can look at a stack
trace from the debugger. I tried several things like setting a breakpoint on
__cxa_pure_virtual but none of these hooks seem to get called. It is difficult
to find the correct bit of documentation about these GCC 'internals'.
This is my GCC version:
Reading specs from /usr/libexec/gcc/darwin/ppc/3.3/specs
Thread model: posix
gcc version 3.3 20030304 (Apple Computer, Inc. build 1492)
I know that this is beta software but I also have the same problem with older
versions of GCC like 2.95 and 3.2.
S.
Stefan Arentz Guest
-
LoadPostData method called twice
Hi Everyone, I am building an ASP.NET server control. It implements the IPostBackDataHandler interface. My code contains implementation for both... -
#38456 [Asn->Csd]: Apache2 segfaults when virtual() is called in .php ErrorDocument
ID: 38456 Updated by: iliaa@php.net Reported By: alex dot dean at pni dot com -Status: Assigned +Status: ... -
#38456 [Asn]: Apache2 segfaults when virtual() is called in .php ErrorDocument
ID: 38456 User updated by: alex dot dean at pni dot com Reported By: alex dot dean at pni dot com Status: Assigned... -
how can method of a parent get name of what subclass its being called from?
I'm very unhappy with the error message that I'm giving in this method: /** * 11-23-03 - getter * * We want to run the query against a... -
Called as method or subroutine?
Hi is there a way to make a sub/method compatible with the two following calling methods? 1. MyClass::mySub(); 2. MyClass->mySub(); Using... -
Mike #2
Re: GCC C++ Issue: pure virtual method called
>
My guess is that it's a pointer error (a programming error). Some pointer points> I have a threaded C++ application that produces a 'pure virtual method called'
> error about 3 out of 10 times while starting up the application. The error is
> confusing because this should be a compile-time error instead of runtime.
>
> My question is how I can trap an error like this so that I can look at a stack
> trace from the debugger. I tried several things like setting a breakpoint on
> __cxa_pure_virtual but none of these hooks seem to get called. It is difficult
> to find the correct bit of documentation about these GCC 'internals'.
>
> This is my GCC version:
>
> Reading specs from /usr/libexec/gcc/darwin/ppc/3.3/specs
> Thread model: posix
> gcc version 3.3 20030304 (Apple Computer, Inc. build 1492)
>
> I know that this is beta software but I also have the same problem with older
> versions of GCC like 2.95 and 3.2.
at the wrong place in the vtab and causes a call to a method which cannot be
called.
Mike Guest
-
Stefan Arentz #3
Re: GCC C++ Issue: pure virtual method called
"Mike" <nospam@nospam.com> writes:
Yeah, probably combined with some weird timing issues. It could be many places, that>> >
> > I have a threaded C++ application that produces a 'pure virtual method called'
> > error about 3 out of 10 times while starting up the application. The error is
> > confusing because this should be a compile-time error instead of runtime.
> >
> > My question is how I can trap an error like this so that I can look at a stack
> > trace from the debugger. I tried several things like setting a breakpoint on
> > __cxa_pure_virtual but none of these hooks seem to get called. It is difficult
> > to find the correct bit of documentation about these GCC 'internals'.
> >
> > This is my GCC version:
> >
> > Reading specs from /usr/libexec/gcc/darwin/ppc/3.3/specs
> > Thread model: posix
> > gcc version 3.3 20030304 (Apple Computer, Inc. build 1492)
> >
> > I know that this is beta software but I also have the same problem with older
> > versions of GCC like 2.95 and 3.2.
> My guess is that it's a pointer error (a programming error). Some pointer points
> at the wrong place in the vtab and causes a call to a method which cannot be
> called.
is why I need a stack trace :-)
S.
Stefan Arentz Guest
-
Mike #4
Re: GCC C++ Issue: pure virtual method called
> > > I have a threaded C++ application that produces a 'pure virtual method called'
Have you looked in the crash log?>> >> > > error about 3 out of 10 times while starting up the application. The error is
> > > confusing because this should be a compile-time error instead of runtime.
> > >
> > > My question is how I can trap an error like this so that I can look at a stack
> > > trace from the debugger. I tried several things like setting a breakpoint on
> > > __cxa_pure_virtual but none of these hooks seem to get called. It is difficult
> > > to find the correct bit of documentation about these GCC 'internals'.
> > >
> > > This is my GCC version:
> > >
> > > Reading specs from /usr/libexec/gcc/darwin/ppc/3.3/specs
> > > Thread model: posix
> > > gcc version 3.3 20030304 (Apple Computer, Inc. build 1492)
> > >
> > > I know that this is beta software but I also have the same problem with older
> > > versions of GCC like 2.95 and 3.2.
> > My guess is that it's a pointer error (a programming error). Some pointer points
> > at the wrong place in the vtab and causes a call to a method which cannot be
> > called.
> Yeah, probably combined with some weird timing issues. It could be many places, that
> is why I need a stack trace :-)
Mike Guest
-
Benjamin Riefenstahl #5
Re: GCC C++ Issue: pure virtual method called
Hi Stefan,
Stefan Arentz <stefan.arentz@soze.com> writes:
"br __cxa_pure_virtual" works fine here to trap this (GCC 3.3, Apple> My question is how I can trap an error like this so that I can look
> at a stack trace from the debugger. I tried several things like
> setting a breakpoint on __cxa_pure_virtual but none of these hooks
> seem to get called.
build 1435). __cxa_pure_virtual() calls abort() here, so you can also
enable core dumps, run the program, reproduce the error and than run
gdb on the code dump.
You probably already know that this error is caused by calling pure
virtual methods from the constructor or destructor of the base class.
It must be an indirect call, because GCC will issue an error about
direct calls.
benny
Benjamin Riefenstahl Guest



Reply With Quote

