GNOME Bugzilla – Bug 776895
Add "Schemas streaming regression tests" to runtest in libxml2
Last modified: 2021-07-05 13:22:39 UTC
Bug 766834 is a regression in XSD schema validation that only occurs when using the streaming/reader/SAX API, not the DOM-based API. This regression was likely missed because the "runtest" test harness only runs streaming tests for the DOM-based API ("Schemas regression tests"), not the SAX-based API. This bug covers adding "Schemas streaming regression tests" to runtest so that regressions are caught much earlier.
So as it turns out, we don't need to add the test case from Bug 766834 because running the "Schemas streaming regression test" with 3169602058bd2d04913909e869c61d1540bc7fb4 backed out, we get a number of errors and a segfault (under ASan). Note that Bug 766834 only affected the streaming/reader/SAX API, not the DOM API: $ ./runtest "Schemas regression test" ## Schemas regression tests Total 196 tests, no errors $ ./runtest "Schemas streaming regression test" ## Schemas streaming regression tests Result for ./test/schemas/582887_0.xml failed in result/schemas/582887_0_0 instance ./test/schemas/582887_0.xml failed File ./test/schemas/582887_0.xsd generated an error Result for ./test/schemas/766834_0.xml failed in result/schemas/766834_0_0 instance ./test/schemas/766834_0.xml failed File ./test/schemas/766834_0.xsd generated an error Result for ./test/schemas/any1_0.xml failed in result/schemas/any1_0_0 instance ./test/schemas/any1_0.xml failed File ./test/schemas/any1_0.xsd generated an error Result for ./test/schemas/any2_0.xml failed in result/schemas/any2_0_0 instance ./test/schemas/any2_0.xml failed File ./test/schemas/any2_0.xsd generated an error file result/schemas/anyAttr-processContents-err1_0_0.err.rdr is 432 bytes, result is 429 bytes Error for ./test/schemas/anyAttr-processContents-err1_0.xml failed ./test/schemas/anyAttr-processContents-err1_0.xml:8: Schemas validity error : Element '{http://FOO}elem.lax', attribute '{http://FOO}bar': '' is not a valid value of the atomic type 'xs:language'. ./test/schemas/anyAttr-processContents-err1_0.xml:9: Schemas validity error : Element '{http://FOO}elem.strict', attribute '{http://FOO}barB': No matching global attribute declaration available, but demanded by the strict wildcard. instance ./test/schemas/anyAttr-processContents-err1_0.xml failed File ./test/schemas/anyAttr-processContents-err1_0.xsd generated an error Result for ./test/schemas/anyAttr-processContents1_0.xml failed in result/schemas/anyAttr-processContents1_0_0 instance ./test/schemas/anyAttr-processContents1_0.xml failed File ./test/schemas/anyAttr-processContents1_0.xsd generated an error Result for ./test/schemas/attr0_0.xml failed in result/schemas/attr0_0_0 instance ./test/schemas/attr0_0.xml failed File ./test/schemas/attr0_0.xsd generated an error Result for ./test/schemas/bug145246_0.xml failed in result/schemas/bug145246_0_0 instance ./test/schemas/bug145246_0.xml failed File ./test/schemas/bug145246_0.xsd generated an error file result/schemas/bug303566_1_1.err.rdr is 147 bytes, result is 3417 bytes Error for ./test/schemas/bug303566_1.xml failed ./test/schemas/bug303566_1.xml:5: Schemas validity error : Element 'Country', attribute 'code': [facet 'pattern'] The value '' is not accepted by the pattern '[A-Z]+'. ./test/schemas/bug303566_1.xml:5: Schemas validity error : Element 'Country', attribute 'code': '' is not a valid value of the atomic type 'codeType'. ./test/schemas/bug303566_1.xml:5: Schemas validity error : Element 'Country', attribute 'code': Warning: No precomputed value available, the value was either invalid or something strange happend. ./test/schemas/bug303566_1.xml:8: Schemas validity error : Element 'Part', attribute 'country': [facet 'pattern'] The value '' is not accepted by the pattern '[A-Z]+'. ./test/schemas/bug303566_1.xml:8: Schemas validity error : Element 'Part', attribute 'country': '' is not a valid value of the atomic type 'codeType'. ./test/schemas/bug303566_1.xml:8: Schemas validity error : Element 'Part', attribute 'country': Warning: No precomputed value available, the value was either invalid or something strange happend. ./test/schemas/bug303566_1.xml:9: Schemas validity error : Element 'Part', attribute 'country': [facet 'pattern'] The value '' is not accepted by the pattern '[A-Z]+'. ./test/schemas/bug303566_1.xml:9: Schemas validity error : Element 'Part', attribute 'country': '' is not a valid value of the atomic type 'codeType'. ./test/schemas/bug303566_1.xml:9: Schemas validity error : Element 'Part', attribute 'country': Warning: No precomputed value available, the value was either invalid or something strange happend. ./test/schemas/bug303566_1.xml:11: Schemas validity error : Element 'Country': Not all fields of key identity-constraint 'CountryDummyKey' evaluate to a node. ./test/schemas/bug303566_1.xml:12: Schemas validity error : Element 'Country', attribute 'code': [facet 'pattern'] The value '' is not accepted by the pattern '[A-Z]+'. ./test/schemas/bug303566_1.xml:12: Schemas validity error : Element 'Country', attribute 'code': '' is not a valid value of the atomic type 'codeType'. ./test/schemas/bug303566_1.xml:12: Schemas validity error : Element 'Country', attribute 'code': Warning: No precomputed value available, the value was either invalid or something strange happend. ./test/schemas/bug303566_1.xml:14: Schemas validity error : Element 'Part', attribute 'country': [facet 'pattern'] The value '' is not accepted by the pattern '[A-Z]+'. ./test/schemas/bug303566_1.xml:14: Schemas validity error : Element 'Part', attribute 'country': '' is not a valid value of the atomic type 'codeType'. ./test/schemas/bug303566_1.xml:14: Schemas validity error : Element 'Part', attribute 'country': Warning: No precomputed value available, the value was either invalid or something strange happend. ./test/schemas/bug303566_1.xml:15: Schemas validity error : Element 'Part', attribute 'country': [facet 'pattern'] The value '' is not accepted by the pattern '[A-Z]+'. ./test/schemas/bug303566_1.xml:15: Schemas validity error : Element 'Part', attribute 'country': '' is not a valid value of the atomic type 'codeType'. ./test/schemas/bug303566_1.xml:15: Schemas validity error : Element 'Part', attribute 'country': Warning: No precomputed value available, the value was either invalid or something strange happend. ./test/schemas/bug303566_1.xml:17: Schemas validity error : Element 'Country': Not all fields of key identity-constraint 'CountryDummyKey' evaluate to a node. instance ./test/schemas/bug303566_1.xml failed File ./test/schemas/bug303566_1.xsd generated an error Result for ./test/schemas/bug306806_0.xml failed in result/schemas/bug306806_1_0 instance ./test/schemas/bug306806_0.xml failed File ./test/schemas/bug306806_1.xsd generated an error Result for ./test/schemas/bug312957_0.xml failed in result/schemas/bug312957_1_0 instance ./test/schemas/bug312957_0.xml failed File ./test/schemas/bug312957_1.xsd generated an error Result for ./test/schemas/bug455953_0.xml failed in result/schemas/bug455953_0_0 instance ./test/schemas/bug455953_0.xml failed File ./test/schemas/bug455953_0.xsd generated an error file result/schemas/changelog093_1_0.err.rdr is 263 bytes, result is 1334 bytes Error for ./test/schemas/changelog093_0.xml failed ./test/schemas/changelog093_0.xml:6: Schemas validity error : Element '{http://www.blackperl.com/XML/ChangeLog}description', attribute 'lang': '' is not a valid value of the atomic type 'xs:language'. ./test/schemas/changelog093_0.xml:6: Schemas validity error : Element '{http://www.blackperl.com/XML/ChangeLog}description', attribute 'lang': Warning: No precomputed value available, the value was either invalid or something strange happend. ./test/schemas/changelog093_0.xml:7: Schemas validity error : Element '{http://www.blackperl.com/XML/ChangeLog}description', attribute 'lang': '' is not a valid value of the atomic type 'xs:language'. ./test/schemas/changelog093_0.xml:7: Schemas validity error : Element '{http://www.blackperl.com/XML/ChangeLog}description', attribute 'lang': Warning: No precomputed value available, the value was either invalid or something strange happend. ./test/schemas/changelog093_0.xml:11: Schemas validity error : Element '{http://www.blackperl.com/XML/ChangeLog}description', attribute 'lang': '' is not a valid value of the atomic type 'xs:language'. ./test/schemas/changelog093_0.xml:11: Schemas validity error : Element '{http://www.blackperl.com/XML/ChangeLog}description', attribute 'lang': Warning: No precomputed value available, the value was either invalid or something strange happend. instance ./test/schemas/changelog093_0.xml failed File ./test/schemas/changelog093_1.xsd generated an error ASAN:DEADLYSIGNAL ================================================================= ==13277==ERROR: AddressSanitizer: SEGV on unknown address 0x00000000005c (pc 0x00010ccd6546 bp 0x7fff533896b0 sp 0x7fff53389430 T0) #0 0x10ccd6545 in xmlSchemaVPushText xmlschemas.c:26803 #1 0x10cc43c5e in xmlSchemaSAXHandleText xmlschemas.c:27302 #2 0x10cc467e9 in charactersSplit xmlschemas.c:28527 #3 0x10c90f696 in xmlParseCharData parser.c:4604 #4 0x10c98c794 in xmlParseTryOrFinish parser.c:11806 #5 0x10c98435b in xmlParseChunk parser.c:12545 #6 0x10cd389ec in xmlTextReaderPushData xmlreader.c:881 #7 0x10cd30fd3 in xmlTextReaderRead xmlreader.c:1310 #8 0x10c87daa3 in streamProcessTest runtest.c:2197 #9 0x10c879a25 in schemasStreamTest runtest.c:3249 #10 0x10c886712 in launchTests runtest.c:4565 #11 0x10c872751 in runtest runtest.c:4617 #12 0x10c872442 in main runtest.c:4649 #13 0x7fffdb149234 in start (libdyld.dylib+0x5234) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV xmlschemas.c:26803 in xmlSchemaVPushText ==13277==ABORTING Abort trap: 6 Will upload the patch next week.
(In reply to David Kilzer from comment #1) > Will upload the patch next week. Still working through the approval process.
Created attachment 352915 [details] [review] Patch v1
(In reply to David Kilzer from comment #2) > (In reply to David Kilzer from comment #1) > > Will upload the patch next week. > > Still working through the approval process. Sorry for the delay. Working on getting approval for an expedited approval process for future patches.
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/libxml2/-/issues/ Thank you for your understanding and your help.