[linux-audio-dev] A C++ question

Nick Tsocanos nicktsocanos at charter.net
Thu Apr 17 16:28:00 UTC 2003


Hi I know it's not a C++ specific list, but maybe someone can shed some
light on this. I have encountered this problem with all C++ compilers
and I don't know exactly what it is.

Sometimes I might make a class, and inherit it from another. Or, the
class just has virtual functions in it ( I am planning to derive others
from it). In any case, I am trying to access a virtual function in an
instantiated instance at runtime, and when I do, the program crashes. I
try to see if it is reaching the function (printf("Hi!") from inside or
something), but it doesn't. It is like the vtable is being destroyed
somehow.

So, is it possible to smash the vtable of a class? I can't imagine all
compilers have the same quirk, because I have seen this problem on half
a dozen compilers. Usually it is in classes where I am doing heavy
memory management. My guess is that the vtable can be corrupted somehow
by a smash.








More information about the Linux-audio-dev mailing list