开发者

access violation (c system exception code : c0000005 ) while accessing ccomptr pointer and application got crash

开发者 https://www.devze.com 2023-04-06 16:34 出处:网络
While accessing a computer I get an access violation error. The error is not consistent and only reproducible while trying to access a huge data.

While accessing a computer I get an access violation error. The error is not consistent and only reproducible while trying to access a huge data. I have 2900 components and for each component I am calling a function. In this function I am accessing a ccompter, while doing this application gets crashed at random position like on 200, 210, 2500 etc. The position in not fixed when it crashes.

This issue is specific to the system with following configuration: Window Server 2003 R2 Xeon CPU , 2.66 ghz 2 GB of RAM

here is my code

XGGraphicAttribute* pAttr = pExtraGraphicInfo->GetAttribute();
if(pAttr)
{
    DBAttributes* db_attributes = NULL;

    db_attributes = static_cast<DBAttributes*> (pAttr->GetDBAttrib开发者_高级运维utes());

    CComPtr<IEPGraphicData> pIEPGraphicData;

    if(db_attributes)
    {
        pIEPGraphicData = db_attributes->GetGraphicData(); // here my app got crashed 
    }

}


IEPGraphicData* DBAttributes::GetGraphicData () const
{
    return m_pIEPGraphicData;
}


Possibilities:

  1. The object returned by GetGraphicData() might not support the IEPGraphicData interface. I would expect the smart pointer assignment to result in a null pointer though, rather than an access violation.

  2. The db_attributes object has been deleted from underneath your feet.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号