When validating multiple documents against a schema, there seems to be correlation between documents at play
Within gdb I cannot yet reproduce it yet, valgrind might show some hints, but I see two types of behavior by running the action. Either a Segmentation fault or examples/functions/fares/ENTUR-SchoolTwiceADayTripCarnet_2020120.xml:384: element OperatorRef: Schemas validity error : Element '{http://www.netex.org.uk/netex}OperatorRef', attribute 'ref': The XPath '@ref' of a field of keyref identity-constraint '{http://www.netex.org.uk/netex}Operator_KeyRef' evaluates to a node-set with more than one member.
How can this be reproduced?
Checkout the EPIAP branch of https://github.com/NeTEx-CEN/NeTEx/
xmllint --noout --schema xsd/NeTEx_publication.xsd examples/standards/epiap/.xml examples/functions/calendar/.xml examples/functions/fares/*.xml
The failure can be observed from our CI run: https://github.com/NeTEx-CEN/NeTEx/actions/runs/6757089214/job/18367289494
Valgrind output:
==116390== Invalid read of size 8
==116390== at 0x4A1108F: xmlSchemaXPathProcessHistory (in /usr/lib64/libxml2.so.2.11.5)
==116390== by 0x4A169EF: xmlSchemaVAttributesComplex (in /usr/lib64/libxml2.so.2.11.5)
==116390== by 0x4A18E28: xmlSchemaValidateElem (in /usr/lib64/libxml2.so.2.11.5)
==116390== by 0x4A1A58C: xmlSchemaVDocWalk (in /usr/lib64/libxml2.so.2.11.5)
==116390== by 0x4A1A9C0: xmlSchemaVStart (in /usr/lib64/libxml2.so.2.11.5)
==116390== by 0x4A1AB75: xmlSchemaValidateDoc (in /usr/lib64/libxml2.so.2.11.5)
==116390== by 0x40A631: parseAndPrintFile (in /usr/bin/xmllint)
==116390== by 0x40E1D5: main (in /usr/bin/xmllint)
==116390== Address 0xb677810 is 0 bytes after a block of size 160 alloc'd
==116390== at 0x484210B: realloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==116390== by 0x4A11009: xmlSchemaXPathProcessHistory (in /usr/lib64/libxml2.so.2.11.5)
==116390== by 0x4A169EF: xmlSchemaVAttributesComplex (in /usr/lib64/libxml2.so.2.11.5)
==116390== by 0x4A18E28: xmlSchemaValidateElem (in /usr/lib64/libxml2.so.2.11.5)
==116390== by 0x4A1A58C: xmlSchemaVDocWalk (in /usr/lib64/libxml2.so.2.11.5)
==116390== by 0x4A1A9C0: xmlSchemaVStart (in /usr/lib64/libxml2.so.2.11.5)
==116390== by 0x4A1AB75: xmlSchemaValidateDoc (in /usr/lib64/libxml2.so.2.11.5)
==116390== by 0x40A631: parseAndPrintFile (in /usr/bin/xmllint)
==116390== by 0x40E1D5: main (in /usr/bin/xmllint)
==116390==
==116390== Invalid read of size 8
==116390== at 0x4A110C1: xmlSchemaXPathProcessHistory (in /usr/lib64/libxml2.so.2.11.5)
==116390== by 0x4A169EF: xmlSchemaVAttributesComplex (in /usr/lib64/libxml2.so.2.11.5)
==116390== by 0x4A18E28: xmlSchemaValidateElem (in /usr/lib64/libxml2.so.2.11.5)
==116390== by 0x4A1A58C: xmlSchemaVDocWalk (in /usr/lib64/libxml2.so.2.11.5)
==116390== by 0x4A1A9C0: xmlSchemaVStart (in /usr/lib64/libxml2.so.2.11.5)
==116390== by 0x4A1AB75: xmlSchemaValidateDoc (in /usr/lib64/libxml2.so.2.11.5)
==116390== by 0x40A631: parseAndPrintFile (in /usr/bin/xmllint)
==116390== by 0x40E1D5: main (in /usr/bin/xmllint)
==116390== Address 0xc602ed0 is 928 bytes inside a block of size 1,048 free'd
==116390== at 0x484379F: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==116390== by 0x491792D: xmlDictFree (in /usr/lib64/libxml2.so.2.11.5)
==116390== by 0x495805E: xmlFreeDoc (in /usr/lib64/libxml2.so.2.11.5)
==116390== by 0x40A756: parseAndPrintFile (in /usr/bin/xmllint)
==116390== by 0x40E1D5: main (in /usr/bin/xmllint)
==116390== Block was alloc'd at
==116390== at 0x4844B1F: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==116390== by 0x49168B4: xmlDictAddString (in /usr/lib64/libxml2.so.2.11.5)
==116390== by 0x4917D00: xmlDictLookup (in /usr/lib64/libxml2.so.2.11.5)
==116390== by 0x49278CB: xmlDetectSAX2 (in /usr/lib64/libxml2.so.2.11.5)
==116390== by 0x49414D6: xmlParseDocument (in /usr/lib64/libxml2.so.2.11.5)
==116390== by 0x4949E4E: xmlDoRead (in /usr/lib64/libxml2.so.2.11.5)
==116390== by 0x4949F82: xmlReadFile (in /usr/lib64/libxml2.so.2.11.5)
==116390== by 0x4090B5: parseAndPrintFile (in /usr/bin/xmllint)
==116390== by 0x40E1D5: main (in /usr/bin/xmllint)