You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by "Tempelaar E. (Erik)" <Er...@vanoord.com> on 2020/05/28 14:15:10 UTC

No schema defaults / segfault with fgXercesDOMHasPSVIInfo

Hi all,

Our application uses several schemas to validate XML-files and I recently adjusted the validation to use a Wrapper4InputSource and loadGrammar; inspired by this blogpost:
https://www.codesynthesis.com/~boris/blog/2010/03/15/validating-external-schemas-xerces-cxx/

Unfortunately I lost the schemas' default-values in the process and I can't figure out how to get those back.
I get a SIGSEGV during parse if I enable the following option:
conf->setParameter(XMLUni::fgXercesDOMHasPSVIInfo, true);

Here's the stacktrace:
Thread #1 0 (Suspended : Signal : SIGSEGV:Segmentation fault)
            xercesc_3_2::IGXMLScanner::buildAttList() at 0x61f81b
            xercesc_3_2::IGXMLScanner::scanStartTagNS() at 0x618e64
            xercesc_3_2::IGXMLScanner::scanContent() at 0x61ae7b
            xercesc_3_2::IGXMLScanner::scanDocument() at 0x61b0b7
            xercesc_3_2::XMLScanner::scanDocument() at 0x5067be
            xercesc_3_2::AbstractDOMParser::parse() at 0x528b93
            xercesc_3_2::DOMLSParserImpl::parseURI() at 0x52c47b

Am I supposed to supply the PSVIhandler myself somehow? Any pointers on how to do that? The PSVIWriter-sample perhaps?

Perhaps I'm running into this bug:
https://issues.apache.org/jira/browse/XERCESC-1667
Or its clone:
https://issues.apache.org/jira/browse/XERCESC-1671

I also checked the linked post; and tried the suggestion to enable/disable pool locking, but it didn't help:
https://marc.info/?l=xerces-c-users&m=124580697906104&w=2

Please advise.

Kind regards,

Erik Tempelaar







Disclaimer: This mail transmission and any attached files are confidential and are intended for the addressee only. If you are not the person or organization to whom it is addressed, you must not copy, disclose, distribute or take any action in reliance upon it. If you have received this message in error, please contact the sender by email and delete all copies of this message and all copies of any attached files.

RE: No schema defaults / segfault with fgXercesDOMHasPSVIInfo

Posted by "Tempelaar E. (Erik)" <Er...@vanoord.com>.
Disregard my previous e-mail.

I had disabled validation for my actual reader, that's probably why the PSVI was not included.

Unsure about the crash though, I doesn't happen without:
conf->setParameter(XMLUni::fgXercesDOMHasPSVIInfo, true);

And it appears I don't need that after all.

-----Original Message-----
From: Tempelaar E. (Erik) <Er...@vanoord.com> 
Sent: 28 May 2020 16:15
To: c-users@xerces.apache.org
Subject: No schema defaults / segfault with fgXercesDOMHasPSVIInfo

Hi all,

Our application uses several schemas to validate XML-files and I recently adjusted the validation to use a Wrapper4InputSource and loadGrammar; inspired by this blogpost:
https://eur01.safelinks.protection.outlook.com/?url=https:%2F%2Fwww.codesynthesis.com%2F~boris%2Fblog%2F2010%2F03%2F15%2Fvalidating-external-schemas-xerces-cxx%2F&amp;data=02%7C01%7CErik.Tempelaar%40vanoord.com%7Cc186de22f7e742d3b13a08d803118fff%7Cd62ada1bca424fe2b9e7ceb843af0ad2%7C0%7C1%7C637262721252810011&amp;sdata=hoolTT6yQRiDOqYbEeMBj%2BS69lZVfICL899KOkLcxew%3D&amp;reserved=0

Unfortunately I lost the schemas' default-values in the process and I can't figure out how to get those back.
I get a SIGSEGV during parse if I enable the following option:
conf->setParameter(XMLUni::fgXercesDOMHasPSVIInfo, true);

Here's the stacktrace:
Thread #1 0 (Suspended : Signal : SIGSEGV:Segmentation fault)
            xercesc_3_2::IGXMLScanner::buildAttList() at 0x61f81b
            xercesc_3_2::IGXMLScanner::scanStartTagNS() at 0x618e64
            xercesc_3_2::IGXMLScanner::scanContent() at 0x61ae7b
            xercesc_3_2::IGXMLScanner::scanDocument() at 0x61b0b7
            xercesc_3_2::XMLScanner::scanDocument() at 0x5067be
            xercesc_3_2::AbstractDOMParser::parse() at 0x528b93
            xercesc_3_2::DOMLSParserImpl::parseURI() at 0x52c47b

Am I supposed to supply the PSVIhandler myself somehow? Any pointers on how to do that? The PSVIWriter-sample perhaps?

Perhaps I'm running into this bug:
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fissues.apache.org%2Fjira%2Fbrowse%2FXERCESC-1667&amp;data=02%7C01%7CErik.Tempelaar%40vanoord.com%7Cc186de22f7e742d3b13a08d803118fff%7Cd62ada1bca424fe2b9e7ceb843af0ad2%7C0%7C1%7C637262721252810011&amp;sdata=jbhWMzwlcaI%2BKuf2Lmi8eS4XsDii5Wi%2BdZ66QdGUboM%3D&amp;reserved=0
Or its clone:
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fissues.apache.org%2Fjira%2Fbrowse%2FXERCESC-1671&amp;data=02%7C01%7CErik.Tempelaar%40vanoord.com%7Cc186de22f7e742d3b13a08d803118fff%7Cd62ada1bca424fe2b9e7ceb843af0ad2%7C0%7C1%7C637262721252810011&amp;sdata=CS63bMUiX%2FCypuJ38cAwNmWQL8azYZq9ni67ZKBq%2FTI%3D&amp;reserved=0

I also checked the linked post; and tried the suggestion to enable/disable pool locking, but it didn't help:
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmarc.info%2F%3Fl%3Dxerces-c-users%26m%3D124580697906104%26w%3D2&amp;data=02%7C01%7CErik.Tempelaar%40vanoord.com%7Cc186de22f7e742d3b13a08d803118fff%7Cd62ada1bca424fe2b9e7ceb843af0ad2%7C0%7C1%7C637262721252810011&amp;sdata=rXmNW%2B%2FSNXFmC9Hx6HhW%2BuniBtpG9txdKIk1SUY3rVM%3D&amp;reserved=0

Please advise.

Kind regards,

Erik Tempelaar







Disclaimer: This mail transmission and any attached files are confidential and are intended for the addressee only. If you are not the person or organization to whom it is addressed, you must not copy, disclose, distribute or take any action in reliance upon it. If you have received this message in error, please contact the sender by email and delete all copies of this message and all copies of any attached files.