I am writing a program using some RPC infrastructure. there is code
like this:
MyServer* server = dynamic_cast<MyServer*>(GetServerByName(MY_SERVER) );
Here GetServerByName() will return a GenericServer*, which is the
parent class of MyServer*. The problem here is, I can only do this for
the first time. After some server cycle and I reach here again, there
will be a SIGSEGV problem on dynamic_cast. I am sure that the returned
value has correct dynamic type, since it works for the first time and
the address returned by GetServerByName() is also not changed.
What might be the cause here? I know there are too many thing behind
this process that may complicate this problem, but I just want to know,
in what case will dynamic_cast give you memory error?
Tian