1.概述
日期: 2013-10-31
服务器: 11#
现象:
运行期间出现"microsoft visual c++ debug library"窗口.但程序仍在运行。
2.分析
"重试"后取回crash分析。
分析发现:
windbg定位代码是CBizicPlugin::OnRecv10622函数(在bizic4.cpp中)中下列标记的位置.
string strF034v_1001;
strF034v_1001 = prsTempRow->GetFieldValueByName(0,"f034v_1001");
if(strF034v_1001[0] == ',')
strF034v_1001 = strF034v_1001.substr(1,strF034v_1001.length()-1);
if(strF034v_1001[strF034v_1001.length() - 1] == ',')///< @windbg指示的错误位置
strF034v_1001 = strF034v_1001.substr(0,strF034v_1001.length()-1);
f034v_1001是用户主管的品类信息.
代码的意图是去掉该串的前后分隔符(',')。
修改如下:
if (strF034v_1001.length()>0) { ///< @note 增加此判定
if(strF034v_1001[0] == ',')
strF034v_1001 = strF034v_1001.substr(1,strF034v_1001.length()-1);
if(strF034v_1001[strF034v_1001.length() - 1] == ',')
strF034v_1001 = strF034v_1001.substr(0,strF034v_1001.length()-1);
}
3.处理
已在trunk上修改代码.
编译bizic后更新.