以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 XML工具及XML开发环境 』  (http://bbs.xml.org.cn/list.asp?boardid=7)
----  求教:解析XML格式文件出错是何原因?  (http://bbs.xml.org.cn/dispbbs.asp?boardid=7&rootid=&id=38649)


--  作者:realopen
--  发布时间:10/9/2006 10:04:00 AM

--  求教:解析XML格式文件出错是何原因?
源码:
       int ret;
   
        pthread_mutex_lock(&parseMutex);
        cout<<"This is in ____lock end 00000000000000"<<endl;

        FILE *fptest;
        fptest = fopen(msgfile,"r");
        if(fptest==NULL)
        {
                cout <<"cann't open file " <<msgfile <<endl;
                exit(0);
        }
        fclose(fptest);

        char cmdd[MAX_SQLLEN];
        RASHandle* handler =new RASHandle;
        parser->setDocumentHandler(handler);
        parser->parse(msgfile);  //该处经常CORE DUMP ,即debug的468行
        delete handler;
        pthread_mutex_unlock(&parseMutex);
        
在hp的 安腾运行程序 core dump ,debug如下:
hpux-11> gdb gdi_main core
HP gdb 4.5 for HP Itanium (32 or 64 bit) and target HP-UX 11.2x.
Copyright 1986 - 2001 Free Software Foundation, Inc.
Hewlett-Packard Wildebeest 4.5 (based on GDB) is covered by the
GNU General Public License. Type "show copying" to see the conditions to
change it and/or distribute copies. Type "show warranty" for warranty/support.
..
Core was generated by `gdi_main'.
Program terminated with signal 11, Segmentation fault.

warning: Load module /oracle/app/oracle/product/9.2/lib32/libclntsh.so.9.0 has been stripped.  
Debugging information is not available.


warning: Load module /oracle/app/oracle/product/9.2/lib32/libwtc9.so has been stripped.  
Debugging information is not available.

#0  0x60000000c0176e30:1 in real_malloc+0x7f1 () from /usr/lib/hpux32/libc.so.1
(gdb) where
#0  0x60000000c0176e30:1 in real_malloc+0x7f1 () from /usr/lib/hpux32/libc.so.1
#1  0x60000000c0176440:0 in _malloc+0x800 () from /usr/lib/hpux32/libc.so.1
#2  0x60000000c0183f30:0 in malloc+0x140 () from /usr/lib/hpux32/libc.so.1
#3  0x60000000c0855b30:0 in operator new+0x70 ()
   from /usr/lib/hpux32/libCsup.so.1
#4  0x60000000ce62da90:0 in xercesc_2_7::MemoryManagerImpl::allocate+0x30 ()
   from /data/users/cc2000/xerces-c/lib/libxerces-c.sl.27
#5  0x60000000ce916750:0 in xercesc_2_7::XMemory::operator new+0x50 ()
   from /data/users/cc2000/xerces-c/lib/libxerces-c.sl.27
#6  0x60000000ce5e5280:0 in xercesc_2_7::IGXMLScanner::scanStartTag+0xec0 ()
   from /data/users/cc2000/xerces-c/lib/libxerces-c.sl.27
#7  0x60000000ce5db100:0 in xercesc_2_7::IGXMLScanner::scanContent+0x370 ()
   from /data/users/cc2000/xerces-c/lib/libxerces-c.sl.27
#8  0x60000000ce5da5f0:0 in xercesc_2_7::IGXMLScanner::scanDocument+0x210 ()
   from /data/users/cc2000/xerces-c/lib/libxerces-c.sl.27
#9  0x60000000ce8c02d0:0 in xercesc_2_7::XMLScanner::scanDocument+0x2b0 ()
   from /data/users/cc2000/xerces-c/lib/libxerces-c.sl.27
#10 0x60000000ce8c13a0:0 in xercesc_2_7::XMLScanner::scanDocument+0x80 ()
   from /data/users/cc2000/xerces-c/lib/libxerces-c.sl.27
#11 0x60000000ce6edfe0:0 in xercesc_2_7::SAXParser::parse+0x1e0 ()
   from /data/users/cc2000/xerces-c/lib/libxerces-c.sl.27
#12 0x40b19c0:0 in RASClass::Parse (this=0x402166d0) at Ps01_gdi_ras.cxx:468
#13 0x4066440:0 in HandlerMessage (para=0x18) at Ps01_gdi_main.cxx:310
---Type <return> to continue, or q <return> to quit---
#14 0x60000000c0331d20:0 in __pthread_bound_body+0x170 ()
   from /usr/lib/hpux32/libpthread.so.1
(gdb)

多谢帮助!


W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
8,976.563ms