Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Unhandled exception at 0x5c329e17 (mfc90d.dll) in wcube.exe: 0xC0000005: Access violation reading location 0xfeeefeee.

532 views
Skip to first unread message

Vickz

unread,
Sep 16, 2010, 8:44:49 AM9/16/10
to
Hi All,

i am getting following exception while debugging.

Unhandled exception at 0x5c329e17 (mfc90d.dll) in wcube.exe:
0xC0000005: Access violation reading location 0xfeeefeee.

The same code used to run previously, all of suden it starts throwing
this access voilation in objcore.cpp code.

---------------------------------------------------------------------------------------------------------------------
BOOL CObject::IsKindOf(const CRuntimeClass* pClass) const
{
ENSURE(this != NULL);
// it better be in valid memory, at least for CObject size
ASSERT(AfxIsValidAddress(this, sizeof(CObject)));

// simple SI case
CRuntimeClass* pClassThis = GetRuntimeClass(); <---- here it throw
access voilation

ENSURE(pClassThis);
return pClassThis->IsDerivedFrom(pClass);
}

-------------------------------------------------------------------------------------------
i am using VS2008 as IDE.
Please help if anybody has idea, why it is throwing access voilation.

Joseph M. Newcomer

unread,
Sep 17, 2010, 12:15:07 PM9/17/10
to
On Thu, 16 Sep 2010 05:44:49 -0700 (PDT), Vickz <1981....@gmail.com> wrote:

>Hi All,
>
>i am getting following exception while debugging.
>
>Unhandled exception at 0x5c329e17 (mfc90d.dll) in wcube.exe:
>0xC0000005: Access violation reading location 0xfeeefeee.

****
This is a dead giveaway: you tried to use a pointer you found in a block of storage you
had already freed (the 0xfeeefeee tells you this)
****


>
>The same code used to run previously, all of suden it starts throwing
>this access voilation in objcore.cpp code.

****
It runs correctly if you don't free the object pointed to. If you pass it a bad pointer,
it takes an exception. So the fact that it "used to run previously" is completely useless
information. Any code runs correctly if you give it correct data. Give it bad data, and
you have no idea what it is going to do, and this is what happened to you.
****


>
>---------------------------------------------------------------------------------------------------------------------
>BOOL CObject::IsKindOf(const CRuntimeClass* pClass) const
>{
> ENSURE(this != NULL);
> // it better be in valid memory, at least for CObject size
> ASSERT(AfxIsValidAddress(this, sizeof(CObject)));
>
> // simple SI case
> CRuntimeClass* pClassThis = GetRuntimeClass(); <---- here it throw
>access voilation

****
Of course, you used the debugger to see what value was in "this", didn't you? And you
would have found 0xfeeefeee, in which case why are you bothering to show us this code? You
didn't show the calling code, or why you are using a pointer to freed storage.
****


>
> ENSURE(pClassThis);
> return pClassThis->IsDerivedFrom(pClass);
>}
>
>-------------------------------------------------------------------------------------------
>i am using VS2008 as IDE.
>Please help if anybody has idea, why it is throwing access voilation.

****
Because you passed it a bad pointer. Why are you bothering to show us the code that
failed, when you should be concerned with who called it, and why the caller is passing in
a pointer derived from a block of memory that has already been freed.
joe
****
Joseph M. Newcomer [MVP]
email: newc...@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm

0 new messages