新书推介:《语义网技术体系》
作者:瞿裕忠,胡伟,程龚
   XML论坛     W3CHINA.ORG讨论区     计算机科学论坛     SOAChina论坛     Blog     开放翻译计划     新浪微博  
 
  • 首页
  • 登录
  • 注册
  • 软件下载
  • 资料下载
  • 核心成员
  • 帮助
  •   Add to Google

    >> XML编辑器,XML解析器,XML开发环境
    [返回] 中文XML论坛 - 专业的XML技术讨论区XML.ORG.CN讨论区 - XML技术『 XML工具及XML开发环境 』 → 关于xml解析的问题,大家帮帮忙啊,急 查看新帖用户列表

      发表一个新主题  发表一个新投票  回复主题  (订阅本版) 您是本帖的第 4783 个阅读者浏览上一篇主题  刷新本主题   树形显示贴子 浏览下一篇主题
     * 贴子主题: 关于xml解析的问题,大家帮帮忙啊,急 举报  打印  推荐  IE收藏夹 
       本主题类别:     
     moneyfire 帅哥哟,离线,有人找我吗?
      
      
      等级:大一新生
      文章:1
      积分:56
      门派:XML.ORG.CN
      注册:2006/8/8

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给moneyfire发送一个短消息 把moneyfire加入好友 查看moneyfire的个人资料 搜索moneyfire在『 XML工具及XML开发环境 』的所有贴子 引用回复这个贴子 回复这个贴子 查看moneyfire的博客楼主
    发贴心情 关于xml解析的问题,大家帮帮忙啊,急

    模块出错的地方
    pthread_detach(pthread_self());
        CPutResult* _this = (CPutResult*)arg;

        int retn;
        xmlDocPtr pDoc;
        xmlChar* buf = NULL;
        int buflen = 0;
        while (5) {
            pthread_mutex_lock(&g_result_mutex);
            while (g_result_target == "")
                pthread_cond_wait(&g_result_cond, &g_result_mutex);

            pDoc = xmlParseFile(g_result_target.c_str());    //模块执行几次到这就CORE掉
            if (!pDoc) {
                g_pApp->Logit("PutResult !xmlParseFile()");
            }
            xmlDocDumpMemory(pDoc, &buf, &buflen);

            int head_type = 0;
            if (strstr(g_result_target.c_str(), RESULT_STATIC_FILE))
                head_type = HEAD_TYPE_STATIC;
            else if (strstr(g_result_target.c_str(), RESULT_DYNAMIC_FILE))
                head_type = HEAD_TYPE_DYNAMIC;

            retn = _this->doPutResult(buf, buflen, head_type);
            if (pDoc)
                xmlFreeDoc(pDoc);
            xmlFree(buf);

            switch (retn) {
            case 0:
                break;
            default:
                g_pApp->Logit("发送聚合结果'%s'失败", g_result_target.c_str());
                break;
            }

            g_result_target = "";
            pthread_mutex_unlock(&g_result_mutex);
        }

        return NULL;
    }


    用GDB调试后出现下面情况:

    # dbx nfb core
    For information about new features see `help changes'
    To remove this message, put `dbxenv suppress_startup_message 7.1' in your .dbxrc
    Reading nfb
    core file header read successfully
    Reading ld.so.1
    Reading libsocket.so.1
    Reading libpthread.so.1
    Reading libxml2.so.2
    Reading libnsl.so.1
    Reading libstdc++.so.5.0.5
    Reading libiconv.so.2.1.0
    Reading libz.so.1
    Reading libm.so.1
    Reading libc.so.1
    Reading libgcc_s.so.1
    Reading libdl.so.1
    Reading libmp.so.2
    Reading libc_psr.so.1
    Reading libthread.so.1
    Reading zh_CN.gbk%UTF-8.so
    Reading UTF-8%zh_CN.gbk.so
    detected a multithreaded program
    t@7 (l@7) terminated by signal SEGV (no mapping at the fault address)
    0xff22e074: xmlParserInputShrink+0x0044:        ld      [%o2], %o0
    (dbx) where
    current thread: t@7
    =>[1] xmlParserInputShrink(0x85bf8, 0x3c, 0x11, 0xff224880, 0x7, 0x1), at 0xff22e074
      [2] xmlSHRINK(0x1cc860, 0x216077, 0x85bf8, 0x32, 0x4ef, 0x480c95), at 0xff231318
      [3] xmlParseContent(0x1cc860, 0x85bf8, 0x3e, 0xff224880, 0x216065, 0x85bf8), at 0xff2404f8
      [4] xmlParseElement(0x1cc860, 0x21605f, 0x85bf8, 0x3c, 0x4e2, 0xff966018), at 0xff24082c
      [5] xmlParseContent(0x1cc860, 0x85bf8, 0x3e, 0xff224880, 0x216057, 0x85bf8), at 0xff240444
      [6] xmlParseElement(0x1cc860, 0x216052, 0x85bf8, 0x3c, 0x4b3, 0xffe6e334), at 0xff24082c
      [7] xmlParseContent(0x1cc860, 0x85bf8, 0x3e, 0xd8d7, 0x216029, 0x85bf8), at 0xff240444
      [8] xmlParseElement(0x1cc860, 0x216023, 0x85bf8, 0x3c, 0xc2d108, 0x0), at 0xff24082c
      [9] xmlParseContent(0x1cc860, 0x85bf8, 0x3e, 0xff2a8cf0, 0x215b81, 0x85bf8), at 0xff240444
      [10] xmlParseElement(0x1cc860, 0x215b73, 0x85bf8, 0xff2d1338, 0xff246724, 0xff246704), at 0xff24082c
      [11] xmlParseDocument(0x1cc860, 0x8b320, 0x6, 0x8, 0x7, 0x11), at 0xff24276c
      [12] xmlSAXParseFileWithData(0x0, 0x8b4ac, 0x0, 0x0, 0x2e, 0xff065c34), at 0xff2460cc
      [13] _ZN10CPutResult9PutResultEPv(0x80678, 0x0, 0x0, 0x0, 0x0, 0x0), at 0x2eb3c
    (dbx)


       收藏   分享  
    顶(0)
      




    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2006/8/8 9:42:00
     
     GoogleAdSense
      
      
      等级:大一新生
      文章:1
      积分:50
      门派:无门无派
      院校:未填写
      注册:2007-01-01
    给Google AdSense发送一个短消息 把Google AdSense加入好友 查看Google AdSense的个人资料 搜索Google AdSense在『 XML工具及XML开发环境 』的所有贴子 访问Google AdSense的主页 引用回复这个贴子 回复这个贴子 查看Google AdSense的博客广告
    2024/5/1 11:58:16

    本主题贴数1,分页: [1]

    管理选项修改tag | 锁定 | 解锁 | 提升 | 删除 | 移动 | 固顶 | 总固顶 | 奖励 | 惩罚 | 发布公告
    W3C Contributing Supporter! W 3 C h i n a ( since 2003 ) 旗 下 站 点
    苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
    58.594ms