[xml] seg fault



Hi All

I have written a small app to parse the xsd file ,

When I run the following xsd file , I am getting seg fault in libxml , and if I give backtrace, it loops indefinitely and prints the following message

 

#3221 0x4008a100 in xmlFARecurseDeterminism (ctxt=0x804eca0, state=0x804ea28, to=9, atom=0x0) at xmlregexp.c:2429

 

My xsd file contains the following .

 

<?xml version="1.0" encoding="UTF-8" ?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"

                targetNamespace="http://www.pub.org"

                xmlns="http://www.pub.org"

                elementFormDefault="qualified">

        <xsd:element name="BookCatalogue">

                <xsd:complexType>

                        <xsd:sequence minOccurs="1" maxOccurs="13">

                                <xsd:element name="Book1"  minOccurs="0" />

                <xsd:sequence minOccurs="1" maxOccurs="23">

                    <xsd:element name="Book11" minOccurs="0" />

                    <xsd:element name="Book12" minOccurs="0" />

                    <xsd:sequence minOccurs="1" maxOccurs="34">

                            <xsd:element name="Book21" minOccurs="0" />

                            <xsd:element name="Book22" minOccurs="0" />

                    </xsd:sequence>

                </xsd:sequence>

                                <xsd:element name="Book3"  minOccurs="0"/>

                        </xsd:sequence>

                </xsd:complexType>

        </xsd:element>

</xsd:schema>

 

My App is below

 

 

static int print_parseDS(xmlDocPtr doc){

    xmlSchemaPtr schemaPtr = NULL;

 

    xmlSchemaParserCtxtPtr ctxt = NULL ;

    xmlSchemaValidCtxtPtr vxt = NULL;

    ctxt  = xmlSchemaNewDocParserCtxt(doc);

    schemaPtr = xmlSchemaParse(ctxt);

}

int main(int argc , char **argv) {

 

    xmlDocPtr doc = NULL;

 

    doc = xmlReadFile(argv[1] ,NULL,0);

    print_parseDS(doc);

    xmlFreeDoc(doc);

    xmlCleanupParser();

    return 0;

 

}



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