Chinaunix首页 | 论坛 | 博客
  • 博客访问: 573851
  • 博文数量: 493
  • 博客积分: 2891
  • 博客等级: 少校
  • 技术积分: 4960
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-17 17:11
文章分类

全部博文(493)

文章存档

2010年(493)

分类:

2010-05-12 19:02:39

1 现象:问题描述
在A项目系统测试的初期,发现了一个问题,在测试MOMT前转各种异常流程中,server频繁core,而且core的位置随机出现,查看所有的core信息,发现代码中所有涉及到core描述的地方不可能引起core。
2 关键过程:根本原因分析
后来用purify编译server,发现在新添加的代码中出现了ABW和ABR错误,以及FMR和FMW错误,仔细检视代码,发现问题出在下面的函数的蓝色的代码部分。
#define DEF_MMS_FETCH_MM4_RCV_SDACCOUNT_CURRENT(value) ((value) - DEF_MMS_FETCH_MM4_RCV_SDACCOUNT_START)
 
MMS_INT32 CMMSServiceDataAccount::DealMM4SendMap(MM4SendType * pMM4SendMap, MM4SendType *pMM4SendREQorRESMap)
{
MM4SendType::iterator it_main;
//因为MM4Forward.REQ MM4Forward.RES MM4DR.req和MM4DR.res使用的数据结
//构是相同的,所以在这里使用MM4SendType代替
MM4SendType::iterator it = pMM4SendREQorRESMap->begin();
MMS_INT32 iDestMMSCID = BUTT_INT32;
MMS_INT32 iSrcMMSCID = GetSrvSysParam()->getSysCurrentMMSCID();
 
MMS_INT32 iCurPos = BUTT_INT32;
MM4SendSDAType * pMM4SendSDAvector;
 
for ( ; it != pMM4SendREQorRESMap->end(); it++)
{
iDestMMSCID = it->first;
pMM4SendSDAvector = it->second;
it_main = pMM4SendMap->find(iDestMMSCID);
if (pMM4SendMap->end() == it_main)
{
MM4SendSDAType *tmp = NULL;
      MMS_NEW_NORETURN(tmp, MM4SendSDAType(DEF_MMS_FETCH_MM4_SND_SDACCOUNT_NUM));
if (NULL == tmp)
{
          continue;
       }
 
       MM4SendSDAType::iterator it_vector = pMM4SendSDAvector->begin();
          MMS_INT32 iSDAccountNameCode = BUTT_INT32;
for ( ; it_vector != pMM4SendSDAvector->end(); it_vector++ )
{
iSDAccountNameCode = (*it_vector).GetAccountDataNameCode();
          if (iSDAccountNameCode < DEF_MMS_FETCH_MM4_SND_SDACCOUNT_START
                     || iSDAccountNameCode > DEF_MMS_FETCH_MM4_SND_SDACCOUNT_END)
{
              continue;
          }
            iCurPos = DEF_MMS_FETCH_MM4_SND_SDACCOUNT_CURRENT (iSDAccountNameCode);
 
             (*tmp)[iCurPos].SetSrcMMSCID(iSrcMMSCID);
             (*tmp)[iCurPos].SetDestMMSCID(iDestMMSCID);
             (*tmp)[iCurPos].SetAccount((*it_vector).GetAccount());
             (*tmp)[iCurPos].SetAccountDataNameCode(iSDAccountNameCode);                           
}
(*pMM4SendMap)[iDestMMSCID] = tmp;
}
else
{
long iAccount = 0;
       MM4SendSDAType::iterator it_vector = pMM4SendSDAvector->begin();
       MMS_INT32 iSDAccountNameCode = BUTT_INT32;
       for ( ; it_vector != pMM4SendSDAvector->end(); it_vector++ )
       {            
iSDAccountNameCode = (*it_vector).GetAccountDataNameCode();
iCurPos = DEF_MMS_FETCH_MM4_SND_SDACCOUNT_CURRENT(iSDAccountNameCode);
          (*(it_main->second))[iCurPos].SetAccountDataNameCode(iSDAccountNameCode);
          (*(it_main->second))[iCurPos].SetSrcMMSCID(iSrcMMSCID);
          (*(it_main->second))[iCurPos].SetDestMMSCID(iDestMMSCID);
          //End Added by xuxiaoyu 42480 on 20050908 for NYGD06059
          iAccount = (*(it_main->second))[iCurPos].GetAccount() + (*it_vector).GetAccount();
          (*(it_main->second))[iCurPos].SetAccount(iAccount);
}
}
}
return MMS_OK;
}
阅读(313) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~