Board index » Visual Studio » RTTI Errors

RTTI Errors

Visual Studio376
I have a COM+ component that continues to throw "Access violation - no

RTTI data" even though the module has been compiled with the RTTI

switch.

I am wondering if anyone has experience of under what other

circumstances this might occur?


-
 

Re:RTTI Errors



"davidn" <newmandav@gmail.com>a écrit dans le message de news:

1171432829.364963.104210@p10g2000cwp.googlegroups.com...

Quote
I have a COM+ component that continues to throw "Access violation - no

RTTI data" even though the module has been compiled with the RTTI

switch.

I am wondering if anyone has experience of under what other

circumstances this might occur?



You should post some code....

RTTI is generated for a class only if this class has at least one virtual

function. This is perhaps the reason for your problem.



Arnaud

MVP - VC





-

Re:RTTI Errors



Quote
RTTI is generated for a class only if this class has at least one virtual

function.



Never heard "RTTI is generated". What you mean?





--

======

Arman





-

Re:RTTI Errors

donotspam wrote:

Quote
[Quoting Arnaud Debaene]

>RTTI is generated for a class only if this class has at least one virtual

>function.



Never heard "RTTI is generated". What you mean?



Do you know what RTTI is? Look it up on the web or a book!



Now, RTTI is a requirement for some operations but only generated and

embedded in the binary code in above mentioned case.



Uli



-

Re:RTTI Errors



"Arman Sahakyan" <armancho_x@rambler.ru(donotspam)>a écrit dans le message

de news: 59042CF3-F776-4745-8459-CF131D8BC335@microsoft.com...

Quote


>RTTI is generated for a class only if this class has at least one virtual

>function.



Never heard "RTTI is generated". What you mean?



The information that is needed for dynamic_cast and typeid to work (that is,

a type identifier that you can query at run-time on an object) is generated

for a class only if that class has a virtual function. This is because this

information is stored in the v-tbl of the class, and is accessed through the

v-pointer.



Arnaud

MVP - VC





-

Re:RTTI Errors

On Feb 15, 8:28 am, "Arnaud Debaene" <adeba...@club-internet.fr>

wrote:

Quote
"Arman Sahakyan" <armanch...@rambler.ru(donotspam)>a =E9crit dans le mes=

sage

denews: 59042CF3-F776-4745-8459-CF131D8BC__BEGIN_MASK_n#9g02mG7!__...__EN=

D_MASK_i?a63jfAD$z__@microsoft.com...







>>RTTI is generated for a class only if this class has at least one virt=

ual

>>function.



>Never heard "RTTI is generated". What you mean?



The information that is needed for dynamic_cast and typeid to work (that =

is,

a type identifier that you can query at run-time on an object) is generat=

ed

for a class only if that class has a virtual function. This is because th=

is

information is stored in the v-tbl of the class, and is accessed through =

the

v-pointer.



Arnaud

MVP - VC



first of all thank you to you all for taking the trouble to reply, it

is really appreciated.



firstly before i post code i want to give a bit a background

the component is part of a classic 3 tier web app where you have asp

for front end, COM+ c++ middle tier components and sql serve db.

the particular component of concern is one of the components of the

middle tier. The component that throws the error i have mentioned

seems only to throw it after a period of time. The component is one of

a set of components that have been set up to run in their own process

(high isolation). Looking at the logs for the app one can see that

things are ok then the no rtti errors start to be thrown continuously.

Quote
From this point the application degenerates and it seems the only way

to fix it is to stop & start the com app which fixes the problem for a

while. This has been happening for a long time and many suggestions

have been put forward in particular memory leaks could be occuring

somewhere. This has not been entirely eliminated as a possibility but

i thought i would put a post out to canvas opinion/knowledge . I have

written test scripts that call this component in the manner in which

it is called in the app to run all night and never invoked any rtti

errors. So thats the problem i cannot seem to replicate the problem in

any test environment so i am seeking some knowledge regarding RTTI and

under what other circumstances it would ultimately throw this error.



to you Arnaud.. i will have a look at the code and see if there is a

virtual fuction anywhere in the class



once again thanks to all



david



-

Re:RTTI Errors

Quote
firstly before i post code i want to give a bit a background

the component is part of a classic 3 tier web app where you have asp

for front end, COM+ c++ middle tier components and sql serve db.

the particular component of concern is one of the components of the

middle tier. The component that throws the error i have mentioned

seems only to throw it after a period of time. The component is one of

a set of components that have been set up to run in their own process

(high isolation). Looking at the logs for the app one can see that

things are ok then the no rtti errors start to be thrown continuously.

From this point the application degenerates and it seems the only way

to fix it is to stop & start the com app which fixes the problem for a

while. This has been happening for a long time and many suggestions

have been put forward in particular memory leaks could be occuring

somewhere. This has not been entirely eliminated as a possibility but

i thought i would put a post out to canvas opinion/knowledge . I have

written test scripts that call this component in the manner in which

it is called in the app to run all night and never invoked any rtti

errors. So thats the problem i cannot seem to replicate the problem in

any test environment so i am seeking some knowledge regarding RTTI and

under what other circumstances it would ultimately throw this error.



to you Arnaud.. i will have a look at the code and see if there is a

virtual fuction anywhere in the class



First, I'm sorry to have to say so, but I believe it's dangerous to write

COM+ components, 3-tiers apps and this kind of voodoo if you don't perfectly

understand the caveats of the language you are using (C++ in your case).



So, with wich library is your COM+ compenent written? ATL, MFC, something

else? Anyway, your component most probably have a virtual function, if it is

a COM component... So, other possible explanations are :

- part of the compoenent is compiled with RTTI enabled (compiler flag /GR))

and part isn't, wich will incur a disperancy in the binary represnetion of

the object.

- you have a wild pointer somewhere that is trahsing memory and happens to

fill with garbage the RTTI information of your object. Look for suspicous

pointer manipulation.



In order to reproduce the problem, can you run the program in "live"

environment with a debugger attached and configured to stop when an Access

Violation is raised? If you can't deploy Visual Studio in your live

environment, you could use WinDbg a a "light", installable-by-xcopy,

debugger.



Arnaud

MVP - VC





-

Re:RTTI Errors

davidn wrote:

Quote
The component that throws the error i have mentioned seems only to

throw it after a period of time. The component is one of a set of

components that have been set up to run in their own process (high

isolation). Looking at the logs for the app one can see that

things are ok then the no rtti errors start to be thrown continuously.

From this point the application degenerates and it seems the only way

to fix it is to stop & start the com app which fixes the problem for

a while.



This looks very strongly like a resource leak. I'd try to track things like

memory and handles. I guess that some allocation fails after some time and

then new returns null or throws bad_alloc. If you don't handle this error,

you will keep on working with invalid data that might cause above errors.



Uli



-

Re:RTTI Errors

Quote
firstly before i post code i want to give a bit a background

the component is part of a classic 3 tier web app where you have asp

for front end, COM+ c++ middle tier components and sql serve db.

the particular component of concern is one of the components of the

middle tier. The component that throws the error i have mentioned

seems only to throw it after a period of time. The component is one of

a set of components that have been set up to run in their own process

(high isolation). Looking at the logs for the app one can see that

things are ok then the no rtti errors start to be thrown continuously.

>From this point the application degenerates and it seems the only way

to fix it is to stop & start the com app which fixes the problem for a

while. This has been happening for a long time and many suggestions

have been put forward in particular memory leaks could be occuring

somewhere. This has not been entirely eliminated as a possibility but

i thought i would put a post out to canvas opinion/knowledge . I have

written test scripts that call this component in the manner in which

it is called in the app to run all night and never invoked any rtti

errors. So thats the problem i cannot seem to replicate the problem in

any test environment so i am seeking some knowledge regarding RTTI and

under what other circumstances it would ultimately throw this error.



I can guess that one dll refers directly or indirectly RTTI of some class

from other dll. When referred dll is unloaded (and possibly reloaded again)

the RTTI reference points to an invalid location, which leads to the error.

--

Vladimir Nesterovsky





-

Re:RTTI Errors

On Feb 16, 4:50 am, "Vladimir Nesterovsky" <vladi...@nesterovsky-

bros.com>wrote:

Quote
>firstly before i post code i want to give a bit a background

>the component is part of a classic 3 tier web app where you have asp

>for front end, COM+ c++ middle tier components and sql serve db.

>the particular component of concern is one of the components of the

>middle tier. The component that throws the error i have mentioned

>seems only to throw it after a period of time. The component is one of

>a set of components that have been set up to run in their own process

>(high isolation). Looking at the logs for the app one can see that

>things are ok then the no rtti errors start to be thrown continuously.

>>From this point the application degenerates and it seems the only way

>to fix it is to stop & start the com app which fixes the problem for a

>while. This has been happening for a long time and many suggestions

>have been put forward in particular memory leaks could be occuring

>somewhere. This has not been entirely eliminated as a possibility but

>i thought i would put a post out to canvas opinion/knowledge . I have

>written test scripts that call this component in the manner in which

>it is called in the app to run all night and never invoked any rtti

>errors. So thats the problem i cannot seem to replicate the problem in

>any test environment so i am seeking some knowledge regarding RTTI and

>under what other circumstances it would ultimately throw this error.



I can guess that one dll refers directly or indirectly RTTI of some class

from other dll. When referred dll is unloaded (and possibly reloaded again)

the RTTI reference points to an invalid location, which leads to the error.

--

Vladimir Nesterovsky- Hide quoted text -



- Show quoted text -



ok thanks to you all



the com component is ATL and many have been written in the company i

work for and underpin many of their early apps. so the use of ATL and

COM is well estalished but i think most avoid it if possible!!!

Obviously now we have moved onto .NET (c#) & java for new

applications. i am involved in maintaining th legacy stuff and that is

why i am asking this question. Also many of the people who were

involved in writting it originally are no longer with us which is

awkward.

Anyway once again thanks you have given me some things to look at/

think about



-