[xml] RE: [xslt] libxml2 segfault



Sorry for not providing details:

My system is intel RH 8.0, RPM libxml2-2.5.4-1, Apache/2.0.44 (prefork MPM),
PHP 4.3.0 (without threads)

There is a file /etc/xml/catalog coming from RPM xml-common-0.6.3-12 and contains following XML

<?xml version="1.0"?>
<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" 
"http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd";>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
  <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook XML" 
catalog="file:///usr/share/sgml/docbook/xmlcatalog"/>
  <delegatePublic publicIdStartString="-//OASIS//DTD DocBook XML" 
catalog="file:///usr/share/sgml/docbook/xmlcatalog"/>
  <delegatePublic publicIdStartString="ISO 8879:1986" catalog="file:///usr/share/sgml/docbook/xmlcatalog"/>
  <delegateSystem systemIdStartString="http://www.oasis-open.org/docbook/"; 
catalog="file:///usr/share/sgml/docbook/xmlcatalog"/>
  <delegateURI uriStartString="http://www.oasis-open.org/docbook/"; 
catalog="file:///usr/share/sgml/docbook/xmlcatalog"/>
  <rewriteSystem 
systemIdStartString="http://scrollkeeper.sourceforge.net/dtds/scrollkeeper-omf-1.0/scrollkeeper-omf.dtd"; 
rewritePrefix="/usr/share/xml/scrollkeeper/dtds/scrollkeeper-omf.dtd"/>
  <rewriteURI 
uriStartString="http://scrollkeeper.sourceforge.net/dtds/scrollkeeper-omf-1.0/scrollkeeper-omf.dtd"; 
rewritePrefix="/usr/share/xml/scrollkeeper/dtds/scrollkeeper-omf.dtd"/>
</catalog>

I really don't know whether the problem is in library itself or in an improper invoking from the php soap 
extension (which is in fact very experimental and full of bugs). The problem always comes up during loading 
wsdl file from soap server with exactly the same back-trace. It is not associated with a particular wsdl 
file, I tried several wsdl URLs. The code is quite simple:

sdlPtr load_wsdl(char *struri, sdlPtr parent)
{
        xmlDocPtr wsdl;
        xmlNodePtr root, definitions, types, binding, schema, service, import;
        xmlNodePtr trav, trav2, trav3;
        xmlAttrPtr targetNamespace;
        sdlPtr tmpsdl;
        TSRMLS_FETCH();

        if(!parent)
        {
                tmpsdl = malloc(sizeof(sdl));
                memset(tmpsdl, 0, sizeof(sdl));
                tmpsdl->source = strdup(struri);
        }
        else
                tmpsdl = parent;

        wsdl = xmlParseFile(struri);
        xmlCleanupParser();

        if(!wsdl)
                php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Couldn't load from %s", struri);

...


Segmentation fault occurs allways in xmlParseFile() but very rarely.


Regards

Marek




-----Original Message-----
From: Daniel Veillard [mailto:veillard redhat com] 
Sent: Friday, August 29, 2003 9:04 PM
To: xml gnome org
Cc: Novický Marek
Subject: Re: [xslt] libxml2 segfault

On Fri, Aug 29, 2003 at 06:46:00PM +0200, Novický Marek wrote:
Hi,

From time to time I get Segmentation fault in PECL::SOAP php module which internally use libxml2.

  Wrong list then, this should go to xml gnome org

Back-trace on gdb cannot resolve the last function called see bellow.

Is it possible to say where the problem come from or how to turn on some more debugging ?

  I really have no idea.
You don't even state the version of libxml2 used, nor the platform ...
this looks like Linux on ia32 ...
Do you use catalogs ? Do you have a /etc/xml/catalog ? 
Do you use threads ? Is the library compiled with thread support ?

Thanks for any idea.

  
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 8192 (LWP 22912)]
0x41671004 in ?? ()
(gdb) bt
#0  0x41671004 in ?? ()
#1  0x40a9279c in xmlParseCatalogFile () from /usr/lib/libxml2.so.2
#2  0x40a9320f in xmlParseCatalogFile () from /usr/lib/libxml2.so.2
#3  0x40a934f4 in xmlParseCatalogFile () from /usr/lib/libxml2.so.2
#4  0x40a9436f in xmlParseCatalogFile () from /usr/lib/libxml2.so.2
#5  0x40a956a7 in xmlACatalogResolve () from /usr/lib/libxml2.so.2
#6  0x40a95f8a in xmlCatalogResolve () from /usr/lib/libxml2.so.2

  I really don't see how xmlParserGetDirectory() called xmlCatalogResolve()
there is no such call in the code.

#7  0x40a51a52 in xmlParserGetDirectory () from /usr/lib/libxml2.so.2
#8  0x40a51aee in xmlLoadExternalEntity () from /usr/lib/libxml2.so.2
#9  0x40a429d2 in xmlCreateFileParserCtxt () from /usr/lib/libxml2.so.2
#10 0x40a42a9e in xmlSAXParseFileWithData () from /usr/lib/libxml2.so.2
#11 0x40a42bb5 in xmlSAXParseFile () from /usr/lib/libxml2.so.2
#12 0x40a42c2f in xmlParseFile () from /usr/lib/libxml2.so.2
#13 0x4164da0d in load_wsdl (
    struri=0x823166c "http://sun.aag.cz:81/jaxrpc-simple/simple?WSDL";,
    parent=0x0) at /tmp/php-4.3.2/ext/soap/php_sdl.c:545

  I really don't have enough information to even try to track this down.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]