[xerces-c] branch master updated: Mark Xerces Dependencies as PRIVATE in CMake
This is an automated email from the ASF dual-hosted git repository. rleigh pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/xerces-c.git The following commit(s) were added to refs/heads/master by this push: new 549592880 Mark Xerces Dependencies as PRIVATE in CMake new 0f109e531 Merge pull request #49 from oci-labs/xercesc-2236 549592880 is described below commit 549592880ec8d97f1ab8140cb72b1414ed285768 Author: Fred Hornsey AuthorDate: Tue May 17 16:37:21 2022 -0500 Mark Xerces Dependencies as PRIVATE in CMake Fixes https://issues.apache.org/jira/browse/XERCESC-2236, where trying to use the generated CMake config package doesn't work because the dependencies are not loaded using find_package in the config package. This change assumes they're not necessary for users of the library and marks them as PRIVATE so they don't end up in the config package in the first place. --- src/CMakeLists.txt | 2 +- tests/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c29aa257b..9a81e50c6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1271,7 +1271,7 @@ set_target_properties(xerces-c-headers PROPERTIES FOLDER "Library") add_library(xerces-c ${libxerces_c_SOURCES} ${libxerces_c_RESOURCES}) -target_link_libraries(xerces-c ${libxerces_c_DEPS}) +target_link_libraries(xerces-c PRIVATE ${libxerces_c_DEPS}) if(XERCES_USE_NETACCESSOR_CURL) target_include_directories(xerces-c SYSTEM PRIVATE ${CURL_INCLUDE_DIRS}) endif() diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 78cd1171d..e87ccaa94 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -112,6 +112,7 @@ if(NOT XERCES_USE_MUTEXMGR_NOTHREAD) add_test_executable(ThreadTest src/ThreadTest/ThreadTest.cpp ) + target_link_libraries(ThreadTest Threads::Threads) endif() # Fails to compile under gcc 4 (ambiguous calls to NullPointerException) - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[xerces-c] branch master updated: DFAContentModel::buildDFA(): correctly zero-initialize fFollowList
This is an automated email from the ASF dual-hosted git repository. rleigh pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/xerces-c.git The following commit(s) were added to refs/heads/master by this push: new ef2e9b4 DFAContentModel::buildDFA(): correctly zero-initialize fFollowList new 045bdf8 Merge pull request #45 from rouault/fix_wrong_init ef2e9b4 is described below commit ef2e9b4b94bef326ff03a9f3e12145317424ce0a Author: Even Rouault AuthorDate: Mon Dec 20 20:13:02 2021 +0100 DFAContentModel::buildDFA(): correctly zero-initialize fFollowList Due to a copy issue, the intended zero-initialization of fFollowList wasn't done (copy issue), and thus in case of OutOfMemory exception when initializing the array, the memory freeing in cleanup() could access uninitialized elements. Follow-up of https://github.com/apache/xerces-c/pull/40 / a65990d79d3fc333d7481f010da4e165a88b6cb3 Fixes GDAL's https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=42636 --- src/xercesc/validators/common/DFAContentModel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xercesc/validators/common/DFAContentModel.cpp b/src/xercesc/validators/common/DFAContentModel.cpp index 6d6b124..856f88f 100644 --- a/src/xercesc/validators/common/DFAContentModel.cpp +++ b/src/xercesc/validators/common/DFAContentModel.cpp @@ -682,7 +682,7 @@ void DFAContentModel::buildDFA(ContentSpecNode* const curNode) ( fLeafCount * sizeof(CMStateSet*) ); //new CMStateSet*[fLeafCount]; -memset(fLeafList, 0, fLeafCount*sizeof(CMStateSet*)); +memset(fFollowList, 0, fLeafCount*sizeof(CMStateSet*)); for (index = 0; index < fLeafCount; index++) fFollowList[index] = new (fMemoryManager) CMStateSet(fLeafCount, fMemoryManager); - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[xerces-c] branch master updated: DFAContentModel::buildSyntaxTree(): fix memory leaks when OutOfMemoryException occurs
This is an automated email from the ASF dual-hosted git repository. rleigh pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/xerces-c.git The following commit(s) were added to refs/heads/master by this push: new cb4b4cf DFAContentModel::buildSyntaxTree(): fix memory leaks when OutOfMemoryException occurs new 8ac9637 Merge pull request #43 from rouault/dfa_buildsyntax_tree_memleak cb4b4cf is described below commit cb4b4cf70a2a69fdf18bd6c06924e923b9b21aab Author: Even Rouault AuthorDate: Mon Nov 15 17:32:26 2021 +0100 DFAContentModel::buildSyntaxTree(): fix memory leaks when OutOfMemoryException occurs Fixes GDAL's https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=40866 --- src/xercesc/validators/common/DFAContentModel.cpp | 60 ++- 1 file changed, 36 insertions(+), 24 deletions(-) diff --git a/src/xercesc/validators/common/DFAContentModel.cpp b/src/xercesc/validators/common/DFAContentModel.cpp index ddca8ec..6d6b124 100644 --- a/src/xercesc/validators/common/DFAContentModel.cpp +++ b/src/xercesc/validators/common/DFAContentModel.cpp @@ -1498,33 +1498,45 @@ CMNode* DFAContentModel::buildSyntaxTree(ContentSpecNode* const curNode retNode = buildSyntaxTree(cursor, curIndex); for(unsigned int i=0;igetLastPos(); -const CMStateSet& first = newRight->getFirstPos(); +CMNode* newRight = nullptr; +try +{ +newRight = buildSyntaxTree(rightNode, curIndex); -// -// Now, for every position which is in our left child's last set -// add all of the states in our right child's first set to the -// follow set for that position. -// -CMStateSetEnumerator enumLast(); -while(enumLast.hasMoreElements()) +// +// Now handle our level. We use our left child's last pos set and our +// right child's first pos set, so get them now for convenience. +// +const CMStateSet& last = retNode->getLastPos(); +const CMStateSet& first = newRight->getFirstPos(); + +// +// Now, for every position which is in our left child's last set +// add all of the states in our right child's first set to the +// follow set for that position. +// +CMStateSetEnumerator enumLast(); +while(enumLast.hasMoreElements()) +{ +XMLSize_t index=enumLast.nextElement(); +*fFollowList[index] |= first; +} + +retNode = new (fMemoryManager) CMBinaryOp +( +ContentSpecNode::Sequence +, retNode +, newRight +, fLeafCount +, fMemoryManager +); +} +catch( const OutOfMemoryException& ) { -XMLSize_t index=enumLast.nextElement(); -*fFollowList[index] |= first; +delete newRight; +delete retNode; +throw; } -retNode = new (fMemoryManager) CMBinaryOp -( -ContentSpecNode::Sequence -, retNode -, newRight -, fLeafCount -, fMemoryManager -); } return retNode; } - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[xerces-c] branch master updated: IGXMLScanner::scanDocTypeDecl(): fix memory leak on exception
This is an automated email from the ASF dual-hosted git repository. rleigh pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/xerces-c.git The following commit(s) were added to refs/heads/master by this push: new 8a4c024 IGXMLScanner::scanDocTypeDecl(): fix memory leak on exception new ecdc077 Merge pull request #42 from rouault/fix_memleak_IGXMLScanner_scanDocTypeDecl 8a4c024 is described below commit 8a4c024169c69ed744a570f692656522d7b51dc7 Author: Even Rouault AuthorDate: Fri Oct 29 01:20:14 2021 +0200 IGXMLScanner::scanDocTypeDecl(): fix memory leak on exception The method can leak pubId and sysId when subsequent call to fReaderMgr.skipPastSpaces() throws an exception (e.g. a TranscodingException) --- src/xercesc/internal/IGXMLScanner.cpp | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/xercesc/internal/IGXMLScanner.cpp b/src/xercesc/internal/IGXMLScanner.cpp index 7ee8b7f..4417d44 100644 --- a/src/xercesc/internal/IGXMLScanner.cpp +++ b/src/xercesc/internal/IGXMLScanner.cpp @@ -1374,7 +1374,14 @@ void IGXMLScanner::scanDocTypeDecl() // Get copies of the ids we got pubId = XMLString::replicate(bbPubId.getRawBuffer(), fMemoryManager); sysId = XMLString::replicate(bbSysId.getRawBuffer(), fMemoryManager); +} + +// Insure that the ids get cleaned up, if they got allocated +ArrayJanitor janSysId(sysId, fMemoryManager); +ArrayJanitor janPubId(pubId, fMemoryManager); +if (hasExtSubset) +{ // Skip spaces and check again for the opening of an internal subset fReaderMgr.skipPastSpaces(); @@ -1384,10 +1391,6 @@ void IGXMLScanner::scanDocTypeDecl() } } -// Insure that the ids get cleaned up, if they got allocated -ArrayJanitor janSysId(sysId, fMemoryManager); -ArrayJanitor janPubId(pubId, fMemoryManager); - // If we have a doc type handler and advanced callbacks are enabled, // call the doctype event. if (fDocTypeHandler) - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[xerces-c] branch master updated: DFAContentModel: fix memory leaks when OutOfMemoryException occurs
This is an automated email from the ASF dual-hosted git repository. rleigh pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/xerces-c.git The following commit(s) were added to refs/heads/master by this push: new a65990d DFAContentModel: fix memory leaks when OutOfMemoryException occurs new 6d5e52d Merge pull request #40 from rouault/fix_memleaks_DFAContentModel a65990d is described below commit a65990d79d3fc333d7481f010da4e165a88b6cb3 Author: Even Rouault AuthorDate: Thu Sep 23 16:50:38 2021 +0200 DFAContentModel: fix memory leaks when OutOfMemoryException occurs Fixes GDAL's https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=39159 --- src/xercesc/validators/common/CMStateSet.hpp | 11 +- src/xercesc/validators/common/DFAContentModel.cpp | 178 +- src/xercesc/validators/common/DFAContentModel.hpp | 1 + 3 files changed, 147 insertions(+), 43 deletions(-) diff --git a/src/xercesc/validators/common/CMStateSet.hpp b/src/xercesc/validators/common/CMStateSet.hpp index 6e4a393..4cfc85f 100644 --- a/src/xercesc/validators/common/CMStateSet.hpp +++ b/src/xercesc/validators/common/CMStateSet.hpp @@ -32,6 +32,7 @@ // #include +#include #include #include #include @@ -93,7 +94,15 @@ public : fDynamicBuffer->fArraySize = fBitCount / CMSTATE_BITFIELD_CHUNK; if (fBitCount % CMSTATE_BITFIELD_CHUNK) fDynamicBuffer->fArraySize++; -fDynamicBuffer->fBitArray = (XMLInt32**) fDynamicBuffer->fMemoryManager->allocate(fDynamicBuffer->fArraySize*sizeof(XMLInt32*)); +try +{ +fDynamicBuffer->fBitArray = (XMLInt32**) fDynamicBuffer->fMemoryManager->allocate(fDynamicBuffer->fArraySize*sizeof(XMLInt32*)); +} +catch( const OutOfMemoryException& ) +{ +fDynamicBuffer->fMemoryManager->deallocate(fDynamicBuffer); +throw; +} for(XMLSize_t index = 0; index < fDynamicBuffer->fArraySize; index++) fDynamicBuffer->fBitArray[index]=NULL; } diff --git a/src/xercesc/validators/common/DFAContentModel.cpp b/src/xercesc/validators/common/DFAContentModel.cpp index 5030565..ddca8ec 100644 --- a/src/xercesc/validators/common/DFAContentModel.cpp +++ b/src/xercesc/validators/common/DFAContentModel.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -87,7 +88,15 @@ DFAContentModel::DFAContentModel( const bool dtd , fMemoryManager(manager) { // And build the DFA data structures -buildDFA(elemContentSpec); +try +{ +buildDFA(elemContentSpec); +} +catch( const OutOfMemoryException& ) +{ +cleanup(); +throw; +} } DFAContentModel::DFAContentModel( const bool dtd @@ -115,37 +124,83 @@ DFAContentModel::DFAContentModel( const bool dtd , fMemoryManager(manager) { // And build the DFA data structures -buildDFA(elemContentSpec); +try +{ +buildDFA(elemContentSpec); +} +catch( const OutOfMemoryException& ) +{ +cleanup(); +throw; +} } DFAContentModel::~DFAContentModel() { +cleanup(); +} + +void DFAContentModel::cleanup() +{ // // Clean up all the stuff that is not just temporary representation // data that was cleaned up after building the DFA. // -fMemoryManager->deallocate(fFinalStateFlags); //delete [] fFinalStateFlags; +if( fFinalStateFlags ) +{ +fMemoryManager->deallocate(fFinalStateFlags); //delete [] fFinalStateFlags; +fFinalStateFlags = NULL; +} unsigned int index; -for (index = 0; index < fTransTableSize; index++) -fMemoryManager->deallocate(fTransTable[index]); //delete [] fTransTable[index]; -fMemoryManager->deallocate(fTransTable); //delete [] fTransTable; +if( fTransTable ) +{ +for (index = 0; index < fTransTableSize; index++) +fMemoryManager->deallocate(fTransTable[index]); //delete [] fTransTable[index]; +fMemoryManager->deallocate(fTransTable); //delete [] fTransTable; +fTransTable = NULL; +} if(fCountingStates) { for (unsigned int j = 0; j < fTransTableSize; ++j) delete fCountingStates[j]; fMemoryManager->deallocate(fCountingStates); +fCountingStates = NULL; } -for (index = 0; index < fLeafCount; index++) -delete fElemMap[index]; -fMemoryManager->deallocate(fElemMap); //delete [] fElemMap; +if( fElemMap ) +{ +for (index = 0; index < fLeafCount; index++) +delete fElemMap[index]; +fMemoryManager->deallocate(fElemMap); //delete [] fElemMap; +fElemMap = NULL; +}
[xerces-c] branch master updated (cec74e5 -> acd9752)
This is an automated email from the ASF dual-hosted git repository. rleigh pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/xerces-c.git. from cec74e5 Merge pull request #41 from rleigh-codelibre/XERCESC-2208_size_t_revert new 0dfd295 Fix potential memory leak in ContentSpecNode() constructor new 5e07b37 ComplexTypeInfo::makeContentModel(): fix memory leaks when a OutOfMemoryException occurs new d1f06f4 ComplexTypeInfo::convertContentSpecTree(): fix memory leaks when a OutOfMemoryException occurs new cc6dc0e ComplexTypeInfo::expandContentModel(): fix memory leaks when a OutOfMemoryException occurs new 884c163 ComplexTypeInfo::expandContentModel(): restore use of retNode as in original code (this is equivalent) new acd9752 Merge pull request #39 from rouault/memleak_fixes_ContentSpecNode_ComplexTypeInfo The 6455 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: src/xercesc/validators/common/ContentSpecNode.cpp | 41 ++- src/xercesc/validators/common/ContentSpecNode.hpp | 2 + src/xercesc/validators/schema/ComplexTypeInfo.cpp | 308 +- 3 files changed, 213 insertions(+), 138 deletions(-) - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[xerces-c] branch master updated (88726c3 -> 12a3c84)
This is an automated email from the ASF dual-hosted git repository. rleigh pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/xerces-c.git. from 88726c3 Merge pull request #38 from rleigh-codelibre/XERCESC-2226_cmake_3.12 new 2401d2b XERCESC-2208: Use cstdint, cstddef and cwchar unconditionally new 25389e3 XERCESC-2208: Add special cases for C++11 character types new 6ef31ab XERCESC-2208: Move common and deprecated type definitions into XercesDefs.hpp new 0689fef XERCESC-2208: XSValue is implemented in terms of explicitly-sized integer types new 9defdbf XERCESC-2208: Remove unused autoconf header checks new 12a3c84 Merge pull request #21 from rleigh-codelibre/xerces-XERCESC-2208_Use_cstdint The 6446 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: CMakeLists.txt | 1 - cmake/XercesIntTypes.cmake | 162 -- cmake/XercesXMLCh.cmake| 3 +- config.h.cmake.in | 68 configure.ac | 47 +- m4/xerces_int_types.m4 | 183 - m4/xerces_xmlch_selection.m4 | 4 +- src/xercesc/framework/psvi/XSValue.cpp | 61 +++ src/xercesc/framework/psvi/XSValue.hpp | 20 +-- src/xercesc/internal/XMLScanner.cpp| 4 +- src/xercesc/internal/XMLScanner.hpp| 4 +- src/xercesc/util/Base64.cpp| 3 +- src/xercesc/util/BitOps.hpp| 16 ++ src/xercesc/util/XMLUTF16Transcoder.cpp| 2 +- src/xercesc/util/XercesDefs.hpp| 86 -- .../util/Xerces_autoconf_config.hpp.cmake.in | 69 src/xercesc/util/Xerces_autoconf_config.hpp.in | 70 tests/src/XSValueTest/XSValueTest.cpp | 166 +++ 18 files changed, 171 insertions(+), 798 deletions(-) delete mode 100644 cmake/XercesIntTypes.cmake delete mode 100644 m4/xerces_int_types.m4 - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[xerces-c] branch master updated: XERCESC-2226: Update minimum CMake version to 3.12
This is an automated email from the ASF dual-hosted git repository. rleigh pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/xerces-c.git The following commit(s) were added to refs/heads/master by this push: new fd4806a XERCESC-2226: Update minimum CMake version to 3.12 new 88726c3 Merge pull request #38 from rleigh-codelibre/XERCESC-2226_cmake_3.12 fd4806a is described below commit fd4806a5620b7f11c58e3a907e11206b8c04a062 Author: Roger Leigh AuthorDate: Mon Sep 20 22:07:33 2021 +0100 XERCESC-2226: Update minimum CMake version to 3.12 * Required for CURL imported target usage in XERCESC-2225 * Drop old cmake_policy settings which are now the default behaviour --- CMakeLists.txt | 13 + 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ecd6e1..06bdd9d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,18 +19,7 @@ # Run "cmake" to generate the build files for your platform -cmake_minimum_required(VERSION 3.2.0) - -# Use new variable expansion policy. -if (POLICY CMP0053) - cmake_policy(SET CMP0053 NEW) -endif(POLICY CMP0053) -if (POLICY CMP0054) - cmake_policy(SET CMP0054 NEW) -endif(POLICY CMP0054) -if (POLICY CMP0067) - cmake_policy(SET CMP0067 NEW) -endif(POLICY CMP0067) +cmake_minimum_required(VERSION 3.12.0) # Try C++17, then fall back to C++14, C++11 then C++98. Used for feature tests # for optional features. - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[xerces-c] branch master updated: link to installed CMake targets of CURL
This is an automated email from the ASF dual-hosted git repository. rleigh pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/xerces-c.git The following commit(s) were added to refs/heads/master by this push: new af1935b link to installed CMake targets of CURL new 6b82b24 Merge pull request #34 from prince-chrismc/patch-1 af1935b is described below commit af1935b567c18c8b2de71d6ea97239be60876335 Author: Chris Mc AuthorDate: Fri Sep 3 20:21:37 2021 -0400 link to installed CMake targets of CURL Just like how it was done for ICU --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 344851f..f396fc5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1085,7 +1085,7 @@ endif() if(XERCES_USE_NETACCESSOR_CURL) list(APPEND libxerces_c_SOURCES ${curl_sources}) list(APPEND libxerces_c_HEADERS ${curl_headers}) - list(APPEND libxerces_c_DEPS ${CURL_LIBRARIES}) + list(APPEND libxerces_c_DEPS CURL::libcurl) endif() if(XERCES_USE_NETACCESSOR_SOCKET) - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[xerces-c] branch master updated: DFAContentModel::checkUniqueParticleAttribution (): speed enhancement
This is an automated email from the ASF dual-hosted git repository. rleigh pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/xerces-c.git The following commit(s) were added to refs/heads/master by this push: new 02cec95 DFAContentModel::checkUniqueParticleAttribution (): speed enhancement new c0b90c2 Merge pull request #37 from rouault/faster_checkUniqueParticleAttribution 02cec95 is described below commit 02cec9524882815db078fa5fb7486762928a4d3d Author: Even Rouault AuthorDate: Mon Sep 20 11:59:45 2021 +0200 DFAContentModel::checkUniqueParticleAttribution (): speed enhancement The complexity of this method is roughly O(n^3). Fuzzers can generate schemas with n = several thousands. The test fTransTable[i][j] == XMLContentModel::gInvalidTrans is independant of the k loop, and can thus being moved at a upper level to improve runtime. --- src/xercesc/validators/common/DFAContentModel.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/xercesc/validators/common/DFAContentModel.cpp b/src/xercesc/validators/common/DFAContentModel.cpp index 2f590fe..5030565 100644 --- a/src/xercesc/validators/common/DFAContentModel.cpp +++ b/src/xercesc/validators/common/DFAContentModel.cpp @@ -1642,9 +1642,10 @@ void DFAContentModel::checkUniqueParticleAttribution (SchemaGrammar*const pG // for each state, check whether it has overlap transitions for (i = 0; i < fTransTableSize; i++) { for (j = 0; j < fElemMapSize; j++) { +if (fTransTable[i][j] == XMLContentModel::gInvalidTrans) +continue; for (k = j+1; k < fElemMapSize; k++) { -if (fTransTable[i][j] != XMLContentModel::gInvalidTrans && -fTransTable[i][k] != XMLContentModel::gInvalidTrans && +if (fTransTable[i][k] != XMLContentModel::gInvalidTrans && conflictTable[j][k] == 0) { // If this is text in a Schema mixed content model, skip it. - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[xerces-c] branch master updated: SAX2XMLReaderImpl::error(): use exception memory manager, otherwise regular memory manager might fail to fully allocate the strings in the exception and cause memory
This is an automated email from the ASF dual-hosted git repository. rleigh pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/xerces-c.git The following commit(s) were added to refs/heads/master by this push: new 328f5be SAX2XMLReaderImpl::error(): use exception memory manager, otherwise regular memory manager might fail to fully allocate the strings in the exception and cause memory leaks new 7dd9c51 Merge pull request #36 from rouault/SAX2XMLReaderImpl_error_fix 328f5be is described below commit 328f5be1006faf4859f1dfeffb56ccf9a9e5ee16 Author: Even Rouault AuthorDate: Wed Sep 15 21:08:40 2021 +0200 SAX2XMLReaderImpl::error(): use exception memory manager, otherwise regular memory manager might fail to fully allocate the strings in the exception and cause memory leaks --- src/xercesc/parsers/SAX2XMLReaderImpl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xercesc/parsers/SAX2XMLReaderImpl.cpp b/src/xercesc/parsers/SAX2XMLReaderImpl.cpp index 23f2923..473fb66 100644 --- a/src/xercesc/parsers/SAX2XMLReaderImpl.cpp +++ b/src/xercesc/parsers/SAX2XMLReaderImpl.cpp @@ -1229,7 +1229,7 @@ void SAX2XMLReaderImpl::error( const unsigned int , systemId , lineNum , colNum -, fMemoryManager +, fMemoryManager->getExceptionMemoryManager() ); if (!fErrorHandler) - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[xerces-c] branch master updated: DFAContentModel::checkUniqueParticleAttribution(): fix memory leak
This is an automated email from the ASF dual-hosted git repository. rleigh pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/xerces-c.git The following commit(s) were added to refs/heads/master by this push: new 79f61cb DFAContentModel::checkUniqueParticleAttribution(): fix memory leak new 60fd4e2 Merge pull request #35 from rouault/fix_memleak_checkUniqueParticleAttribution 79f61cb is described below commit 79f61cb45672546187b2bc6863858ee410267d00 Author: Even Rouault AuthorDate: Sat Sep 11 23:31:37 2021 +0200 DFAContentModel::checkUniqueParticleAttribution(): fix memory leak If a memory allocation of conflictTable[] fails, or later in the function, the array is not freed. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=38533 --- src/xercesc/validators/common/DFAContentModel.cpp | 30 --- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/src/xercesc/validators/common/DFAContentModel.cpp b/src/xercesc/validators/common/DFAContentModel.cpp index 615eba9..2f590fe 100644 --- a/src/xercesc/validators/common/DFAContentModel.cpp +++ b/src/xercesc/validators/common/DFAContentModel.cpp @@ -1603,6 +1603,32 @@ void DFAContentModel::checkUniqueParticleAttribution (SchemaGrammar*const pG ( fElemMapSize * sizeof(signed char*) ); +memset(conflictTable, 0, fElemMapSize * sizeof(signed char*)); + +struct ConflictTableKeeper +{ +MemoryManager* fMemoryManager; +signed char** fConflictTable; +unsigned int fElemMapSize; + +ConflictTableKeeper(MemoryManager* memoryManager, +signed char** conflictTable, +unsigned int elemMapSize): +fMemoryManager(memoryManager), +fConflictTable(conflictTable), +fElemMapSize(elemMapSize) +{ +} + +~ConflictTableKeeper() +{ +for (int i = 0; i < fElemMapSize; i++) +fMemoryManager->deallocate(fConflictTable[i]); +fMemoryManager->deallocate(fConflictTable); +} +}; + +ConflictTableKeeper keeper(fMemoryManager, conflictTable, fElemMapSize); // initialize the conflict table for (j = 0; j < fElemMapSize; j++) { @@ -1676,10 +1702,6 @@ void DFAContentModel::checkUniqueParticleAttribution (SchemaGrammar*const pG } } } - -for (i = 0; i < fElemMapSize; i++) -fMemoryManager->deallocate(conflictTable[i]); -fMemoryManager->deallocate(conflictTable); } } - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[xerces-c] branch master updated: Fix -Wmemset-transposed-args warnings of clang++
This is an automated email from the ASF dual-hosted git repository. rleigh pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/xerces-c.git The following commit(s) were added to refs/heads/master by this push: new dc3bd8f Fix -Wmemset-transposed-args warnings of clang++ new 4f5404b Merge pull request #33 from rouault/fix_memset-transposed-args dc3bd8f is described below commit dc3bd8fd1bffc7c7d7ca37dc98036954921691ef Author: Even Rouault AuthorDate: Fri Aug 27 23:46:48 2021 +0200 Fix -Wmemset-transposed-args warnings of clang++ Fixes: xercesc/util/XMLChTranscoder.cpp:73:23: warning: setting buffer to a 'sizeof' expression; did you mean to transpose the last two arguments? [-Wmemset-transposed-args] memset(charSizes, sizeof(XMLCh), countToDo); ^ xercesc/util/XMLChTranscoder.cpp:73:23: note: cast the second argument to 'int' to silence and xercesc/util/XMLUTF16Transcoder.cpp:114:23: warning: setting buffer to a 'sizeof' expression; did you mean to transpose the last two arguments? [-Wmemset-transposed-args] memset(charSizes, sizeof(UTF16Ch), countToDo); ^ xercesc/util/XMLUTF16Transcoder.cpp:114:23: note: cast the second argument to 'int' to silence 1 warning generated. --- src/xercesc/util/XMLChTranscoder.cpp| 2 +- src/xercesc/util/XMLUTF16Transcoder.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/xercesc/util/XMLChTranscoder.cpp b/src/xercesc/util/XMLChTranscoder.cpp index 05b0692..8b57cc1 100644 --- a/src/xercesc/util/XMLChTranscoder.cpp +++ b/src/xercesc/util/XMLChTranscoder.cpp @@ -70,7 +70,7 @@ XMLChTranscoder::transcodeFrom( const XMLByte* const srcData bytesEaten = countToDo * sizeof(XMLCh); // Set the character sizes to the fixed size -memset(charSizes, sizeof(XMLCh), countToDo); +memset(charSizes, static_cast(sizeof(XMLCh)), countToDo); // Return the chars we transcoded return countToDo; diff --git a/src/xercesc/util/XMLUTF16Transcoder.cpp b/src/xercesc/util/XMLUTF16Transcoder.cpp index 6d7f4f2..2233f8a 100644 --- a/src/xercesc/util/XMLUTF16Transcoder.cpp +++ b/src/xercesc/util/XMLUTF16Transcoder.cpp @@ -111,7 +111,7 @@ XMLUTF16Transcoder::transcodeFrom( const XMLByte* const srcData bytesEaten = countToDo * sizeof(UTF16Ch); // Set the character sizes to the fixed size -memset(charSizes, sizeof(UTF16Ch), countToDo); +memset(charSizes, static_cast(sizeof(UTF16Ch)), countToDo); // Return the chars we transcoded return countToDo; - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[xerces-c] branch master updated: InMemMsgLoader::loadMsg(): fix memory leak when transcoding fails.
This is an automated email from the ASF dual-hosted git repository. rleigh pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/xerces-c.git The following commit(s) were added to refs/heads/master by this push: new 1bdf6d8 InMemMsgLoader::loadMsg(): fix memory leak when transcoding fails. new 471e23c Merge pull request #32 from rouault/fix_ossfuzz_37666 1bdf6d8 is described below commit 1bdf6d8ba878c1fe1d779824be70001fc0bebd2c Author: Even Rouault AuthorDate: Fri Aug 27 01:33:27 2021 +0200 InMemMsgLoader::loadMsg(): fix memory leak when transcoding fails. Seen with the IconvGNU transcoder when parsing " #include +#include #include #include #include @@ -153,14 +154,28 @@ bool InMemMsgLoader::loadMsg(const XMLMsgLoader::XMLMsgId msgToLoad XMLCh* tmp4 = 0; bool bRet = false; -if (repText1) -tmp1 = XMLString::transcode(repText1, manager); -if (repText2) -tmp2 = XMLString::transcode(repText2, manager); -if (repText3) -tmp3 = XMLString::transcode(repText3, manager); -if (repText4) -tmp4 = XMLString::transcode(repText4, manager); +try +{ +if (repText1) +tmp1 = XMLString::transcode(repText1, manager); +if (repText2) +tmp2 = XMLString::transcode(repText2, manager); +if (repText3) +tmp3 = XMLString::transcode(repText3, manager); +if (repText4) +tmp4 = XMLString::transcode(repText4, manager); +} +catch( const TranscodingException& ) +{ +if (tmp1) +manager->deallocate(tmp1); +if (tmp2) +manager->deallocate(tmp2); +if (tmp3) +manager->deallocate(tmp3); +// Note: tmp4 cannot leak +throw; +} bRet = loadMsg(msgToLoad, toFill, maxChars, tmp1, tmp2, tmp3, tmp4, manager); - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[xerces-c] branch xerces-3.2 updated: XMLReader constructor: fix memory leak when refreshRawBuffer() throws
This is an automated email from the ASF dual-hosted git repository. rleigh pushed a commit to branch xerces-3.2 in repository https://gitbox.apache.org/repos/asf/xerces-c.git The following commit(s) were added to refs/heads/xerces-3.2 by this push: new 286051c XMLReader constructor: fix memory leak when refreshRawBuffer() throws new a3be9dc Merge pull request #31 from rouault/fix_ossfuzz_37529_backport_3_2 286051c is described below commit 286051c73667be145b36d86febbe2ce9e48d42ff Author: Even Rouault AuthorDate: Mon Aug 23 21:39:48 2021 +0200 XMLReader constructor: fix memory leak when refreshRawBuffer() throws Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=37529 on GDAL The backtrace of the exception that caused the memory leak was: ``` Catchpoint 1 (exception thrown), 0x75547672 in __cxa_throw () from /lib/x86_64-linux-gnu/libstdc++.so.6 (gdb) bt 0 0x75547672 in __cxa_throw () from /lib/x86_64-linux-gnu/libstdc++.so.6 1 0x724447c4 in xercesc_4_0::PosixFileMgr::fileRead (this=, f=, byteCount=, buffer=, manager=0x556df730) at xercesc/util/FileManagers/PosixFileMgr.cpp:160 2 0x724e6ec2 in xercesc_4_0::XMLReader::refreshRawBuffer (this=0x557e49f8) at xercesc/internal/XMLReader.cpp:1891 3 0x724e70d4 in xercesc_4_0::XMLReader::XMLReader (this=0x557e49f8, pubId=, sysId=0x55750920 u"/", streamToAdopt=0x5574e838, from=, type=xercesc_4_0::XMLReader::Type_General, source=xercesc_4_0::XMLReader::Source_External, throwAtEnd=false, calculateSrcOfs=false, lowWaterMark=100, version=xercesc_4_0::XMLReader::XMLV1_0, manager=0x556df730) at xercesc/internal/XMLReader.cpp:130 4 0x724ced75 in xercesc_4_0::ReaderMgr::createReader (this=this@entry=0x557896d8, src=..., refFrom=refFrom@entry=xercesc_4_0::XMLReader::RefFrom_NonLiteral, type=type@entry=xercesc_4_0::XMLReader::Type_General, source=source@entry=xercesc_4_0::XMLReader::Source_External, calcSrcOfs=false, lowWaterMark=100) at ./xercesc/sax/InputSource.hpp:314 5 0x724cb0af in xercesc_4_0::IGXMLScanner::scanReset (this=0x55789608, src=...) at xercesc/internal/IGXMLScanner2.cpp:1286 6 0x724c36e9 in xercesc_4_0::IGXMLScanner::scanDocument (this=0x55789608, src=...) at xercesc/internal/IGXMLScanner.cpp:198 7 0x7250abaf in xercesc_4_0::AbstractDOMParser::parse (this=0x7fffc2d0, source=...) at xercesc/parsers/AbstractDOMParser.cpp:545 8 0x724cbdbe in xercesc_4_0::IGXMLScanner::resolveSchemaGrammar (this=0x55792f78, loc=0x557dd694 u"/", uri=0x55737180 u"`", ignoreLoadSchema=) at xercesc/internal/IGXMLScanner2.cpp:1895 0x724cce7c in xercesc_4_0::IGXMLScanner::parseSchemaLocation (this=0x55792f78, schemaLocationStr=, ignoreLoadSchema=false) at ./xercesc/framework/XMLBuffer.hpp:171 10 0x724cd182 in xercesc_4_0::IGXMLScanner::scanRawAttrListforNameSpaces (this=this@entry=0x55792f78, attCount=attCount@entry=9) at xercesc/internal/IGXMLScanner2.cpp:1649 11 0x724c22cb in xercesc_4_0::IGXMLScanner::scanStartTagNS (this=0x55792f78, gotData=@0x7fffc91f: true) at xercesc/internal/IGXMLScanner.cpp:2213 12 0x724c3522 in xercesc_4_0::IGXMLScanner::scanContent (this=0x55792f78) at xercesc/internal/IGXMLScanner.cpp:890 13 0x724c3760 in xercesc_4_0::IGXMLScanner::scanDocument (this=0x55792f78, src=...) at xercesc/internal/IGXMLScanner.cpp:217 14 0x725158e3 in xercesc_4_0::SAX2XMLReaderImpl::parse (this=0x55731828, source=...) at xercesc/parsers/SAX2XMLReaderImpl.cpp:409 ``` --- src/xercesc/internal/ReaderMgr.cpp | 6 + src/xercesc/internal/XMLReader.cpp | 47 +- src/xercesc/internal/XMLReader.hpp | 2 ++ 3 files changed, 49 insertions(+), 6 deletions(-) diff --git a/src/xercesc/internal/ReaderMgr.cpp b/src/xercesc/internal/ReaderMgr.cpp index d14483e..18d8596 100644 --- a/src/xercesc/internal/ReaderMgr.cpp +++ b/src/xercesc/internal/ReaderMgr.cpp @@ -436,6 +436,12 @@ XMLReader* ReaderMgr::createReader( const InputSource& src ); } } +catch(const XMLPlatformUtilsException&) +{ +streamJanitor.release(); + +throw; +} catch(const OutOfMemoryException&) { streamJanitor.release(); diff --git a/src/xercesc/internal/XMLReader.cpp b/src/xercesc/internal/XMLReader.cpp index 405474a..9acfad8 100644 --- a/src/xercesc/internal/XMLReader.cpp +++ b/src/xercesc/internal/XMLReader.cpp @@ -124,8 +124,16 @@ XMLReader::XMLReader(const XMLCh* const pubId { setXMLVersion(version); -// Do an initial load of raw bytes -refreshRawBuffer(); +try +{ +// Do an initial load of raw bytes +re
[xerces-c] branch master updated: XMLReader constructor: fix memory leak when refreshRawBuffer() throws
This is an automated email from the ASF dual-hosted git repository. rleigh pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/xerces-c.git The following commit(s) were added to refs/heads/master by this push: new cf436ab XMLReader constructor: fix memory leak when refreshRawBuffer() throws new caa6515 Merge pull request #30 from rouault/fix_ossfuzz_37529 cf436ab is described below commit cf436abc181ab65824f6f51ae087e166dbdcd249 Author: Even Rouault AuthorDate: Mon Aug 23 21:39:48 2021 +0200 XMLReader constructor: fix memory leak when refreshRawBuffer() throws Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=37529 on GDAL The backtrace of the exception that caused the memory leak was: ``` Catchpoint 1 (exception thrown), 0x75547672 in __cxa_throw () from /lib/x86_64-linux-gnu/libstdc++.so.6 (gdb) bt 0 0x75547672 in __cxa_throw () from /lib/x86_64-linux-gnu/libstdc++.so.6 1 0x724447c4 in xercesc_4_0::PosixFileMgr::fileRead (this=, f=, byteCount=, buffer=, manager=0x556df730) at xercesc/util/FileManagers/PosixFileMgr.cpp:160 2 0x724e6ec2 in xercesc_4_0::XMLReader::refreshRawBuffer (this=0x557e49f8) at xercesc/internal/XMLReader.cpp:1891 3 0x724e70d4 in xercesc_4_0::XMLReader::XMLReader (this=0x557e49f8, pubId=, sysId=0x55750920 u"/", streamToAdopt=0x5574e838, from=, type=xercesc_4_0::XMLReader::Type_General, source=xercesc_4_0::XMLReader::Source_External, throwAtEnd=false, calculateSrcOfs=false, lowWaterMark=100, version=xercesc_4_0::XMLReader::XMLV1_0, manager=0x556df730) at xercesc/internal/XMLReader.cpp:130 4 0x724ced75 in xercesc_4_0::ReaderMgr::createReader (this=this@entry=0x557896d8, src=..., refFrom=refFrom@entry=xercesc_4_0::XMLReader::RefFrom_NonLiteral, type=type@entry=xercesc_4_0::XMLReader::Type_General, source=source@entry=xercesc_4_0::XMLReader::Source_External, calcSrcOfs=false, lowWaterMark=100) at ./xercesc/sax/InputSource.hpp:314 5 0x724cb0af in xercesc_4_0::IGXMLScanner::scanReset (this=0x55789608, src=...) at xercesc/internal/IGXMLScanner2.cpp:1286 6 0x724c36e9 in xercesc_4_0::IGXMLScanner::scanDocument (this=0x55789608, src=...) at xercesc/internal/IGXMLScanner.cpp:198 7 0x7250abaf in xercesc_4_0::AbstractDOMParser::parse (this=0x7fffc2d0, source=...) at xercesc/parsers/AbstractDOMParser.cpp:545 8 0x724cbdbe in xercesc_4_0::IGXMLScanner::resolveSchemaGrammar (this=0x55792f78, loc=0x557dd694 u"/", uri=0x55737180 u"`", ignoreLoadSchema=) at xercesc/internal/IGXMLScanner2.cpp:1895 0x724cce7c in xercesc_4_0::IGXMLScanner::parseSchemaLocation (this=0x55792f78, schemaLocationStr=, ignoreLoadSchema=false) at ./xercesc/framework/XMLBuffer.hpp:171 10 0x724cd182 in xercesc_4_0::IGXMLScanner::scanRawAttrListforNameSpaces (this=this@entry=0x55792f78, attCount=attCount@entry=9) at xercesc/internal/IGXMLScanner2.cpp:1649 11 0x724c22cb in xercesc_4_0::IGXMLScanner::scanStartTagNS (this=0x55792f78, gotData=@0x7fffc91f: true) at xercesc/internal/IGXMLScanner.cpp:2213 12 0x724c3522 in xercesc_4_0::IGXMLScanner::scanContent (this=0x55792f78) at xercesc/internal/IGXMLScanner.cpp:890 13 0x724c3760 in xercesc_4_0::IGXMLScanner::scanDocument (this=0x55792f78, src=...) at xercesc/internal/IGXMLScanner.cpp:217 14 0x725158e3 in xercesc_4_0::SAX2XMLReaderImpl::parse (this=0x55731828, source=...) at xercesc/parsers/SAX2XMLReaderImpl.cpp:409 ``` --- src/xercesc/internal/ReaderMgr.cpp | 6 + src/xercesc/internal/XMLReader.cpp | 47 +- src/xercesc/internal/XMLReader.hpp | 2 ++ 3 files changed, 49 insertions(+), 6 deletions(-) diff --git a/src/xercesc/internal/ReaderMgr.cpp b/src/xercesc/internal/ReaderMgr.cpp index 0d92fc9..4e59a4a 100644 --- a/src/xercesc/internal/ReaderMgr.cpp +++ b/src/xercesc/internal/ReaderMgr.cpp @@ -436,6 +436,12 @@ XMLReader* ReaderMgr::createReader( const InputSource& src ); } } +catch(const XMLPlatformUtilsException&) +{ +streamJanitor.release(); + +throw; +} catch(const OutOfMemoryException&) { streamJanitor.release(); diff --git a/src/xercesc/internal/XMLReader.cpp b/src/xercesc/internal/XMLReader.cpp index 1facb53..bf43886 100644 --- a/src/xercesc/internal/XMLReader.cpp +++ b/src/xercesc/internal/XMLReader.cpp @@ -124,8 +124,16 @@ XMLReader::XMLReader(const XMLCh* const pubId { setXMLVersion(version); -// Do an initial load of raw bytes -refreshRawBuffer(); +try +{ +// Do an initial load of raw bytes +refreshRawBuffer(); +} +
[xerces-c] branch xerces-3.2 updated: CurlURLInputStream constructor: avoid memory leak
This is an automated email from the ASF dual-hosted git repository. rleigh pushed a commit to branch xerces-3.2 in repository https://gitbox.apache.org/repos/asf/xerces-c.git The following commit(s) were added to refs/heads/xerces-3.2 by this push: new b8f2b83 CurlURLInputStream constructor: avoid memory leak new 9ac2a9c Merge pull request #29 from rouault/backport_3_2_curl_memleak_fix b8f2b83 is described below commit b8f2b836358bb9e338c677eb71ec7fdfbd13643b Author: Even Rouault AuthorDate: Wed Aug 18 18:15:45 2021 +0200 CurlURLInputStream constructor: avoid memory leak CurlURLInputStream constructor calls the readMore() method, which can throw exceptions. In that situation, the destructor is not called, which results in resource/memory leaks. To fix that, catch the exceptions, manually do the cleanup and rethrow the exceptions. Found by ossfuzz (locally) --- .../util/NetAccessors/Curl/CurlURLInputStream.cpp | 28 +- .../util/NetAccessors/Curl/CurlURLInputStream.hpp | 2 ++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/xercesc/util/NetAccessors/Curl/CurlURLInputStream.cpp b/src/xercesc/util/NetAccessors/Curl/CurlURLInputStream.cpp index 5ed6593..2980dc2 100644 --- a/src/xercesc/util/NetAccessors/Curl/CurlURLInputStream.cpp +++ b/src/xercesc/util/NetAccessors/Curl/CurlURLInputStream.cpp @@ -160,7 +160,20 @@ CurlURLInputStream::CurlURLInputStream(const XMLURL& urlSource, const XMLNetHTTP while(fBufferHeadPtr == fBuffer) { int runningHandles = 0; -readMore(); +try +{ +readMore(); +} +catch(const MalformedURLException&) +{ +cleanup(); +throw; +} +catch(const NetAccessorException&) +{ +cleanup(); +throw; +} if(runningHandles == 0) break; } @@ -174,18 +187,31 @@ CurlURLInputStream::CurlURLInputStream(const XMLURL& urlSource, const XMLNetHTTP CurlURLInputStream::~CurlURLInputStream() { +cleanup(); +} + + +void CurlURLInputStream::cleanup() +{ +if (!fMulti ) +return; + // Remove the easy handle from the multi stack curl_multi_remove_handle(fMulti, fEasy); // Cleanup the easy handle curl_easy_cleanup(fEasy); +fEasy = NULL; // Cleanup the multi handle curl_multi_cleanup(fMulti); +fMulti = NULL; if(fContentType) fMemoryManager->deallocate(fContentType); +fContentType = NULL; if(fHeadersList) curl_slist_free_all(fHeadersList); +fHeadersList = NULL; } diff --git a/src/xercesc/util/NetAccessors/Curl/CurlURLInputStream.hpp b/src/xercesc/util/NetAccessors/Curl/CurlURLInputStream.hpp index f75857b..3900d4d 100644 --- a/src/xercesc/util/NetAccessors/Curl/CurlURLInputStream.hpp +++ b/src/xercesc/util/NetAccessors/Curl/CurlURLInputStream.hpp @@ -61,6 +61,8 @@ private : CurlURLInputStream(const CurlURLInputStream&); CurlURLInputStream& operator=(const CurlURLInputStream&); +void cleanup(); + static size_t staticWriteCallback(char *buffer, size_t size, size_t nitems, - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[xerces-c] branch master updated: CurlURLInputStream constructor: avoid memory leak
This is an automated email from the ASF dual-hosted git repository. rleigh pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/xerces-c.git The following commit(s) were added to refs/heads/master by this push: new 327abd3 CurlURLInputStream constructor: avoid memory leak new a313987 Merge pull request #28 from rouault/curl_memleak_fix 327abd3 is described below commit 327abd3551bdbca808b7fc22019c51210358b645 Author: Even Rouault AuthorDate: Wed Aug 18 18:15:45 2021 +0200 CurlURLInputStream constructor: avoid memory leak CurlURLInputStream constructor calls the readMore() method, which can throw exceptions. In that situation, the destructor is not called, which results in resource/memory leaks. To fix that, catch the exceptions, manually do the cleanup and rethrow the exceptions. Found by ossfuzz (locally) --- .../util/NetAccessors/Curl/CurlURLInputStream.cpp | 28 +- .../util/NetAccessors/Curl/CurlURLInputStream.hpp | 2 ++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/xercesc/util/NetAccessors/Curl/CurlURLInputStream.cpp b/src/xercesc/util/NetAccessors/Curl/CurlURLInputStream.cpp index a7b125d..8c79ceb 100644 --- a/src/xercesc/util/NetAccessors/Curl/CurlURLInputStream.cpp +++ b/src/xercesc/util/NetAccessors/Curl/CurlURLInputStream.cpp @@ -160,7 +160,20 @@ CurlURLInputStream::CurlURLInputStream(const XMLURL& urlSource, const XMLNetHTTP while(fBufferHeadPtr == fBuffer) { int runningHandles = 0; -readMore(); +try +{ +readMore(); +} +catch(const MalformedURLException&) +{ +cleanup(); +throw; +} +catch(const NetAccessorException&) +{ +cleanup(); +throw; +} if(runningHandles == 0) break; } @@ -174,18 +187,31 @@ CurlURLInputStream::CurlURLInputStream(const XMLURL& urlSource, const XMLNetHTTP CurlURLInputStream::~CurlURLInputStream() { +cleanup(); +} + + +void CurlURLInputStream::cleanup() +{ +if (!fMulti ) +return; + // Remove the easy handle from the multi stack curl_multi_remove_handle(fMulti, fEasy); // Cleanup the easy handle curl_easy_cleanup(fEasy); +fEasy = NULL; // Cleanup the multi handle curl_multi_cleanup(fMulti); +fMulti = NULL; if(fContentType) fMemoryManager->deallocate(fContentType); +fContentType = NULL; if(fHeadersList) curl_slist_free_all(fHeadersList); +fHeadersList = NULL; } diff --git a/src/xercesc/util/NetAccessors/Curl/CurlURLInputStream.hpp b/src/xercesc/util/NetAccessors/Curl/CurlURLInputStream.hpp index 1ff2abf..06fa994 100644 --- a/src/xercesc/util/NetAccessors/Curl/CurlURLInputStream.hpp +++ b/src/xercesc/util/NetAccessors/Curl/CurlURLInputStream.hpp @@ -61,6 +61,8 @@ private : CurlURLInputStream(const CurlURLInputStream&); CurlURLInputStream& operator=(const CurlURLInputStream&); +void cleanup(); + static size_t staticWriteCallback(char *buffer, size_t size, size_t nitems, - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[xerces-c] branch xerces-3.2 updated: ICUTranscoder::transcodeFrom(): fix read heap-buffer-overflow
This is an automated email from the ASF dual-hosted git repository. rleigh pushed a commit to branch xerces-3.2 in repository https://gitbox.apache.org/repos/asf/xerces-c.git The following commit(s) were added to refs/heads/xerces-3.2 by this push: new 4d35954 ICUTranscoder::transcodeFrom(): fix read heap-buffer-overflow new 19428fb Merge pull request #25 from rouault/fix_gdal_ossfuzz_35373_backport_3_2 4d35954 is described below commit 4d359541505a5554c2cc6353290593dc7db7a925 Author: Even Rouault AuthorDate: Tue Aug 10 12:20:35 2021 +0200 ICUTranscoder::transcodeFrom(): fix read heap-buffer-overflow Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=35373 When charsDecoded == 0, the line ``for (index = 0; index < charsDecoded - 1; index++)`` will cause to read out of bounds of fSrcOffsets, due to unsigned integer underflow rules. --- src/xercesc/util/Transcoders/ICU/ICUTransService.cpp | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/xercesc/util/Transcoders/ICU/ICUTransService.cpp b/src/xercesc/util/Transcoders/ICU/ICUTransService.cpp index 0ebcd37..ed7fb91 100644 --- a/src/xercesc/util/Transcoders/ICU/ICUTransService.cpp +++ b/src/xercesc/util/Transcoders/ICU/ICUTransService.cpp @@ -563,7 +563,7 @@ ICUTranscoder::transcodeFrom(const XMLByte* const srcData { charSizes[0] = (unsigned char)bytesEaten; } -else +else if( charsDecoded > 0 ) { // ICU does not return an extra element to allow us to figure // out the last char size, so we have to compute it from the @@ -574,10 +574,9 @@ ICUTranscoder::transcodeFrom(const XMLByte* const srcData charSizes[index] = (unsigned char)(fSrcOffsets[index + 1] - fSrcOffsets[index]); } -if( charsDecoded > 0 ) { -charSizes[charsDecoded - 1] = (unsigned char)(bytesEaten - - fSrcOffsets[charsDecoded - 1]); -} + +charSizes[charsDecoded - 1] = (unsigned char)(bytesEaten + - fSrcOffsets[charsDecoded - 1]); } } - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[xerces-c] branch master updated: ICUTranscoder::transcodeFrom(): fix read heap-buffer-overflow
This is an automated email from the ASF dual-hosted git repository. rleigh pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/xerces-c.git The following commit(s) were added to refs/heads/master by this push: new e335da5 ICUTranscoder::transcodeFrom(): fix read heap-buffer-overflow new b0e7b3c Merge pull request #24 from rouault/fix_gdal_ossfuzz_35373 e335da5 is described below commit e335da54127cd29091f6be97da97b24c9fd7c7e7 Author: Even Rouault AuthorDate: Tue Aug 10 12:20:35 2021 +0200 ICUTranscoder::transcodeFrom(): fix read heap-buffer-overflow Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=35373 When charsDecoded == 0, the line ``for (index = 0; index < charsDecoded - 1; index++)`` will cause to read out of bounds of fSrcOffsets, due to unsigned integer underflow rules. --- src/xercesc/util/Transcoders/ICU/ICUTransService.cpp | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/xercesc/util/Transcoders/ICU/ICUTransService.cpp b/src/xercesc/util/Transcoders/ICU/ICUTransService.cpp index 7660fca..a7bff4e 100644 --- a/src/xercesc/util/Transcoders/ICU/ICUTransService.cpp +++ b/src/xercesc/util/Transcoders/ICU/ICUTransService.cpp @@ -563,7 +563,7 @@ ICUTranscoder::transcodeFrom(const XMLByte* const srcData { charSizes[0] = (unsigned char)bytesEaten; } -else +else if( charsDecoded > 0 ) { // ICU does not return an extra element to allow us to figure // out the last char size, so we have to compute it from the @@ -574,10 +574,9 @@ ICUTranscoder::transcodeFrom(const XMLByte* const srcData charSizes[index] = (unsigned char)(fSrcOffsets[index + 1] - fSrcOffsets[index]); } -if( charsDecoded > 0 ) { -charSizes[charsDecoded - 1] = (unsigned char)(bytesEaten - - fSrcOffsets[charsDecoded - 1]); -} + +charSizes[charsDecoded - 1] = (unsigned char)(bytesEaten + - fSrcOffsets[charsDecoded - 1]); } } - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[xerces-c] branch xerces-3.2 updated: ci: Travis uses XCode 12.5
This is an automated email from the ASF dual-hosted git repository. rleigh pushed a commit to branch xerces-3.2 in repository https://gitbox.apache.org/repos/asf/xerces-c.git The following commit(s) were added to refs/heads/xerces-3.2 by this push: new 95b0808 ci: Travis uses XCode 12.5 new 2a4594c Merge pull request #27 from rleigh-codelibre/fix-travis-ci-osx-3.2 95b0808 is described below commit 95b0808682f5d4c15bda303fd6b30391749491ce Author: Roger Leigh AuthorDate: Tue Aug 10 15:08:16 2021 +0100 ci: Travis uses XCode 12.5 --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 78e3e72..78ca2f3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,6 +29,8 @@ os: - linux - osx +osx_image: xcode12.5 + env: matrix: - BUILD=autoconf TYPE=Release MUTEXMGR=posix NETWORK=ON NETACCESSOR=curl MSGLOADER=inmemory TRANSCODER=iconv XMLCH=char16_t - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[xerces-c] branch master updated: ci: Travis uses XCode 12.5
This is an automated email from the ASF dual-hosted git repository. rleigh pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/xerces-c.git The following commit(s) were added to refs/heads/master by this push: new 307b646 ci: Travis uses XCode 12.5 new a5cfe26 Merge pull request #26 from rleigh-codelibre/fix-travis-ci-osx 307b646 is described below commit 307b646019e1a2f1dc5c571f3ab1212e09b55597 Author: Roger Leigh AuthorDate: Tue Aug 10 15:08:16 2021 +0100 ci: Travis uses XCode 12.5 --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 6b166f7..34925c8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,6 +41,8 @@ os: - linux - osx +osx_image: xcode12.5 + env: matrix: - BUILD=autoconf TYPE=Release MUTEXMGR=posix NETWORK=ON NETACCESSOR=curl MSGLOADER=inmemory TRANSCODER=iconv XMLCH=char16_t - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[xerces-c] branch master updated (15b086b -> 4bac3c5)
This is an automated email from the ASF dual-hosted git repository. rleigh pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/xerces-c.git. from 15b086b Merge pull request #20 from rleigh-codelibre/XERCESC-2209_Remove_LSTRING new c5d4bfc Update version to 4.0.0 new c8d0c46 Update documentation to add 4.0.0 in place of 3.3.0 new 4bac3c5 Merge pull request #22 from rleigh-codelibre/version-4.0.0 The 6418 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: configure.ac | 4 ++-- doc/releases_plan.xml| 3 ++- doc/source-repository.xml| 2 +- src/xercesc/util/MsgLoaders/ICU/ICUMsgLoader.cpp | 4 ++-- xerces-c.spec| 5 - 5 files changed, 11 insertions(+), 7 deletions(-) - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[xerces-c] branch master updated: XERCESC-2209: Remove unused LSTRING feature test
This is an automated email from the ASF dual-hosted git repository. rleigh pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/xerces-c.git The following commit(s) were added to refs/heads/master by this push: new f6c5dab XERCESC-2209: Remove unused LSTRING feature test new 15b086b Merge pull request #20 from rleigh-codelibre/XERCESC-2209_Remove_LSTRING f6c5dab is described below commit f6c5dab017f92f746026dc3c6ebc485c9558cb2e Author: Roger Leigh AuthorDate: Wed Jun 10 20:26:12 2020 +0100 XERCESC-2209: Remove unused LSTRING feature test --- CMakeLists.txt| 1 - cmake/XercesLString.cmake | 31 --- config.h.cmake.in | 3 --- configure.ac | 2 -- m4/cxx_have_lstring.m4| 25 - 5 files changed, 62 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a8e304d..7ecd6e1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -125,7 +125,6 @@ include(XercesMsgLoaderSelection) include(XercesTranscoderSelection) include(XercesFileMgrSelection) include(XercesXMLCh) -include(XercesLString) include(XercesMFC) include(XercesSSE2) include(XercesPathMax) diff --git a/cmake/XercesLString.cmake b/cmake/XercesLString.cmake deleted file mode 100644 index 81975cb..000 --- a/cmake/XercesLString.cmake +++ /dev/null @@ -1,31 +0,0 @@ -# CMake build for xerces-c -# -# Written by Roger Leigh -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Wide string literals - -include(CheckCXXSourceCompiles) - -check_cxx_source_compiles(" -int main() { - const wchar_t* s=L\"wide string\"; - return 0; -}" - HAVE_LSTRING) - -set(XERCES_LSTRSUPPORT ${HAVE_LSTRING}) diff --git a/config.h.cmake.in b/config.h.cmake.in index 3f7066d..d8ce9cf 100644 --- a/config.h.cmake.in +++ b/config.h.cmake.in @@ -114,9 +114,6 @@ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_LOCALE_H 1 -/* define if the compiler implements L"widestring" */ -#cmakedefine HAVE_LSTRING 1 - /* Define to 1 if you have the header file. */ #cmakedefine HAVE_MACHINE_ENDIAN_H 1 diff --git a/configure.ac b/configure.ac index ccf4f66..b8dd7cb 100644 --- a/configure.ac +++ b/configure.ac @@ -157,8 +157,6 @@ AC_TYPE_SIZE_T XERCES_INT_TYPES -AC_CXX_HAVE_LSTRING - ACX_PTHREAD # Checks for library functions. diff --git a/m4/cxx_have_lstring.m4 b/m4/cxx_have_lstring.m4 deleted file mode 100644 index 3d35f70..000 --- a/m4/cxx_have_lstring.m4 +++ /dev/null @@ -1,25 +0,0 @@ -dnl @synopsis AC_CXX_HAVE_LSTRING -dnl -dnl If the compiler can prevent names clashes using namespaces, define -dnl HAVE_LSTRING. -dnl -dnl @category Cxx -dnl @author James Berry -dnl @version 2005-02-21 -dnl @license AllPermissive - -AC_DEFUN([AC_CXX_HAVE_LSTRING], -[AC_CACHE_CHECK([whether the compiler implements L"widestring"], -ac_cv_cxx_have_lstring, -[AC_LANG_SAVE - AC_LANG_CPLUSPLUS - AC_COMPILE_IFELSE( - [AC_LANG_SOURCE( - [[const wchar_t* s=L"wide string";]])], - ac_cv_cxx_have_lstring=yes, ac_cv_cxx_have_lstring=no) - AC_LANG_RESTORE -]) -if test "$ac_cv_cxx_have_lstring" = yes; then - AC_DEFINE(HAVE_LSTRING,,[define if the compiler implements L"widestring"]) -fi -]) - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[xerces-c] branch master updated: XERCESC-2110: Remove XERCES_NO_MATCHING_DELETE_OPERATOR for old Borland compiler
This is an automated email from the ASF dual-hosted git repository. rleigh pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/xerces-c.git The following commit(s) were added to refs/heads/master by this push: new 5a721ad XERCESC-2110: Remove XERCES_NO_MATCHING_DELETE_OPERATOR for old Borland compiler new 8db2383 Merge pull request #19 from rleigh-codelibre/XERCESC-2210_Remove_XERCES_NO_MATCHING_DELETE_OPERATOR 5a721ad is described below commit 5a721ad3f513005ec4dda63de84b7143121e746e Author: Roger Leigh AuthorDate: Wed Jun 10 20:21:00 2020 +0100 XERCESC-2110: Remove XERCES_NO_MATCHING_DELETE_OPERATOR for old Borland compiler --- CMakeLists.txt | 1 - cmake/XercesOperatorDelete.cmake | 43 -- config.h.cmake.in | 4 -- configure.ac | 21 --- src/xercesc/dom/impl/DOMDocumentImpl.hpp | 7 src/xercesc/util/XMemory.cpp | 5 --- src/xercesc/util/XMemory.hpp | 3 -- .../util/Xerces_autoconf_config.hpp.cmake.in | 2 - src/xercesc/util/Xerces_autoconf_config.hpp.in | 2 - 9 files changed, 88 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e5df166..a8e304d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -125,7 +125,6 @@ include(XercesMsgLoaderSelection) include(XercesTranscoderSelection) include(XercesFileMgrSelection) include(XercesXMLCh) -include(XercesOperatorDelete) include(XercesLString) include(XercesMFC) include(XercesSSE2) diff --git a/cmake/XercesOperatorDelete.cmake b/cmake/XercesOperatorDelete.cmake deleted file mode 100644 index ff942ab..000 --- a/cmake/XercesOperatorDelete.cmake +++ /dev/null @@ -1,43 +0,0 @@ -# CMake build for xerces-c -# -# Written by Roger Leigh -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Check whether the compiler chokes on a placement operator delete - -include(CheckCXXSourceCompiles) - -check_cxx_source_compiles(" -#include - -class XMemory { -public: - void* operator new(size_t s) { return 0; } - void* operator new(size_t s, void* ptr) { return 0; } - void operator delete(void* p) {} - void operator delete(void* p, void* ptr) {} -}; - -int main() { - return 0; -}" - CXX_matching-delete-operator) - -set(XERCES_NO_MATCHING_DELETE_OPERATOR 0) -if(NOT CXX_matching-delete-operator) - set(XERCES_NO_MATCHING_DELETE_OPERATOR 1) -endif() diff --git a/config.h.cmake.in b/config.h.cmake.in index 64edf47..3f7066d 100644 --- a/config.h.cmake.in +++ b/config.h.cmake.in @@ -348,10 +348,6 @@ /* Define if there is support for L"widestring" */ #cmakedefine XERCES_LSTRSUPPORT 1 -/* Define to have XMemory.hpp avoid declaring a matching operator delete for - the placement operator new */ -#cmakedefine XERCES_NO_MATCHING_DELETE_OPERATOR 1 - /* Define to use backslash as an extra path delimiter character */ #cmakedefine XERCES_PATH_DELIMITER_BACKSLASH 1 diff --git a/configure.ac b/configure.ac index 9df6bc9..ccf4f66 100644 --- a/configure.ac +++ b/configure.ac @@ -366,27 +366,6 @@ AC_DEFINE_UNQUOTED([XERCES_TEMPLATE_EXTERN], [$template_extern], [Define as the XERCES_XMLCH_SELECTION -AC_MSG_CHECKING([whether the compiler chokes on a placement operator delete]) -AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include - -class XMemory -{ -public : -void* operator new(size_t s) { return 0; } -void* operator new(size_t s, void* ptr) { return 0; } -void operator delete(void* p) {} -void operator delete(void* p, void* ptr) {} -};]], - [[ ]])], -[ - AC_MSG_RESULT([no]) -], -[ - AC_MSG_RESULT([yes]) -
[xerces-c] branch xerces-3.2 updated (89fe151 -> 7173fa7)
This is an automated email from the ASF dual-hosted git repository. rleigh pushed a change to branch xerces-3.2 in repository https://gitbox.apache.org/repos/asf/xerces-c.git. from 89fe151 Some site updates for future builds. new b465b3c XERCESC-2200: AppVeyor image now includes ninja new 160b6e5 XERCESC-2200: AppVeyor uses new ICU GitHub download URL for 67.1 release new 7173fa7 Merge pull request #18 from rleigh-codelibre/XERCESC-2200_appveyor_bugfix-3.2 The 6385 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: scripts/ci-appveyor-setup | 19 +++ 1 file changed, 3 insertions(+), 16 deletions(-) - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[xerces-c] branch master updated (e345919 -> eddc7b6)
This is an automated email from the ASF dual-hosted git repository. rleigh pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/xerces-c.git. from e345919 Merge pull request #15 from rleigh-codelibre/XERCESC-2201_travis_ci_upgrade new 86554bc XERCESC-2200: AppVeyor image now includes ninja new b3c61b8 XERCESC-2200: AppVeyor uses new ICU GitHub download URL for 67.1 release new eddc7b6 Merge pull request #17 from rleigh-codelibre/XERCESC-2200_appveyor_bugfix The 6411 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: scripts/ci-appveyor-setup | 19 +++ 1 file changed, 3 insertions(+), 16 deletions(-) - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[xerces-c] branch master updated (26db0a1 -> e345919)
This is an automated email from the ASF dual-hosted git repository. rleigh pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/xerces-c.git. from 26db0a1 Merge pull request #14 from rleigh-codelibre/XERCESC-2141_build_support_for_c++11_onwards new e67e2a2 XERCESC-2201: Update Travis-CI configuration new 10e5024 XERCESC-2201: travis-ci updates homebrew packages new e345919 Merge pull request #15 from rleigh-codelibre/XERCESC-2201_travis_ci_upgrade The 6408 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .travis.yml | 14 +- scripts/ci-travis | 52 2 files changed, 13 insertions(+), 53 deletions(-) - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[xerces-c] branch master updated (26db0a1 -> e345919)
This is an automated email from the ASF dual-hosted git repository. rleigh pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/xerces-c.git. from 26db0a1 Merge pull request #14 from rleigh-codelibre/XERCESC-2141_build_support_for_c++11_onwards new e67e2a2 XERCESC-2201: Update Travis-CI configuration new 10e5024 XERCESC-2201: travis-ci updates homebrew packages new e345919 Merge pull request #15 from rleigh-codelibre/XERCESC-2201_travis_ci_upgrade The 6408 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .travis.yml | 14 +- scripts/ci-travis | 52 2 files changed, 13 insertions(+), 53 deletions(-) - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[xerces-c] branch master updated: XERCESC-2141: Enable C++17, C++14 or C++11 when available
This is an automated email from the ASF dual-hosted git repository. rleigh pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/xerces-c.git The following commit(s) were added to refs/heads/master by this push: new 6883e34 XERCESC-2141: Enable C++17, C++14 or C++11 when available new 26db0a1 Merge pull request #14 from rleigh-codelibre/XERCESC-2141_build_support_for_c++11_onwards 6883e34 is described below commit 6883e346fa88f48022edf84328a09a4653b8c2fe Author: Roger Leigh AuthorDate: Sat Mar 10 21:27:27 2018 + XERCESC-2141: Enable C++17, C++14 or C++11 when available --- CMakeLists.txt | 4 +- configure.ac| 9 + m4/ax_cxx_compile_stdcxx.m4 | 982 3 files changed, 993 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4254f89..f5cdb55 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,9 +32,9 @@ if (POLICY CMP0067) cmake_policy(SET CMP0067 NEW) endif(POLICY CMP0067) -# Try C++14, then fall back to C++11 and C++98. Used for feature tests +# Try C++17, then fall back to C++14, C++11 then C++98. Used for feature tests # for optional features. -set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD 17) # Use folders (for IDE project grouping) set_property(GLOBAL PROPERTY USE_FOLDERS ON) diff --git a/configure.ac b/configure.ac index 1a38ec8..8768993 100644 --- a/configure.ac +++ b/configure.ac @@ -79,6 +79,15 @@ AM_SILENT_RULES([yes]) AM_INIT_AUTOMAKE([foreign subdir-objects dist-bzip2 tar-ustar]) AM_MAINTAINER_MODE +# Checks for C++ standard version +AX_CXX_COMPILE_STDCXX([17], [ext], [optional]) +if test "$HAVE_CXX17" = "0"; then + AX_CXX_COMPILE_STDCXX([14], [ext], [optional]) + if test "$HAVE_CXX14" = "0"; then +AX_CXX_COMPILE_STDCXX([11], [ext], [optional]) + fi +fi + # Check if rpath is disabled AC_MSG_CHECKING(whether to use rpath) AC_ARG_ENABLE(rpath, diff --git a/m4/ax_cxx_compile_stdcxx.m4 b/m4/ax_cxx_compile_stdcxx.m4 new file mode 100644 index 000..5032bba --- /dev/null +++ b/m4/ax_cxx_compile_stdcxx.m4 @@ -0,0 +1,982 @@ +# === +# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html +# === +# +# SYNOPSIS +# +# AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional]) +# +# DESCRIPTION +# +# Check for baseline language coverage in the compiler for the specified +# version of the C++ standard. If necessary, add switches to CXX and +# CXXCPP to enable support. VERSION may be '11' (for the C++11 standard) +# or '14' (for the C++14 standard). +# +# The second argument, if specified, indicates whether you insist on an +# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. +# -std=c++11). If neither is specified, you get whatever works, with +# preference for an extended mode. +# +# The third argument, if specified 'mandatory' or if left unspecified, +# indicates that baseline support for the specified C++ standard is +# required and that the macro should error out if no mode with that +# support is found. If specified 'optional', then configuration proceeds +# regardless, after defining HAVE_CXX${VERSION} if and only if a +# supporting mode is found. +# +# LICENSE +# +# Copyright (c) 2008 Benjamin Kosnik +# Copyright (c) 2012 Zack Weinberg +# Copyright (c) 2013 Roy Stogner +# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov +# Copyright (c) 2015 Paul Norman +# Copyright (c) 2015 Moritz Klammler +# Copyright (c) 2016 Krzesimir Nowak +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 7 + +dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro +dnl (serial version number 13). + +AX_REQUIRE_DEFINED([AC_MSG_WARN]) +AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl + m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"], +[$1], [14], [ax_cxx_compile_alternatives="14 1y"], +[$1], [17], [ax_cxx_compile_alternatives="17 1z"], +[m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl + m4_if([$2], [], [], +[$2], [ext], [], +[$2], [noext], [], +[m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl + m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true], +[$3], [mandatory], [ax_cxx_compile_cxx$1_required=true], +[$3], [optional], [ax_cxx_compile_cxx$1_required=false], +[m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])]) + AC_LANG_PUSH([C++])dnl +
[xerces-c] branch master updated (f342e68 -> b73d4a9)
This is an automated email from the ASF dual-hosted git repository. rleigh pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/xerces-c.git. from f342e68 Merge pull request #13 from rleigh-codelibre/XERCESC-2202_update_version_to_3.3.0 new ff73bac XERCESC-2138: Make XSConstants a namespace new 7389761 XERCESC-2138: Drop XERCES_HAS_CPP_NAMESPACE check new 34e3bbe XERCESC-2138: Drop XERCES_STD_NAMESPACE check new 58d86ec XERCESC-2138: Drop XERCES_NO_NATIVE_BOOL check new b5da80c XERCESC-2138: Drop XERCES_NEW_IOSTREAMS check new 41169c3 XERCESC-2138: Use in place of new 08db811 XERCESC-2138: Use in place of new edb558c XERCESC-2138: Use in place of new aa56118 XERCESC-2138: Remove use of strings.h new d9cfba1 XERCESC-2138: Use std:: in place of XERCES_STD_QUALIFIER new 7beee16 XERCESC-2138: Drop const workarounds new 294088c XERCESC-2138: Drop inline workarounds new 1a2c113 XERCESC-2138: Drop unused volatile workarounds new 6d41875 XERCESC-2138: Replace XERCES_CPP_NAMESPACE macros with real namespace use new 7f9e993 XERCESC-2138: Drop last remaining Autoconf AC_CXX_HAVE_NAMESPACES check new b73d4a9 Merge pull request #12 from rleigh-codelibre/XERCESC-2138_c++98_standard The 6403 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: CMakeLists.txt | 7 - cmake/XercesBool.cmake | 38 --- cmake/XercesConst.cmake| 29 -- cmake/XercesIncludes.cmake | 3 - cmake/XercesInline.cmake | 48 --- cmake/XercesNamespaces.cmake | 37 --- cmake/XercesOperatorDelete.cmake | 2 +- cmake/XercesStdLibs.cmake | 45 --- cmake/XercesStdNamespace.cmake | 33 --- cmake/XercesTranscoderSelection.cmake | 7 +- cmake/XercesVolatile.cmake | 29 -- config.h.cmake.in | 59 configure.ac | 29 +- doc/program-others.xml | 21 +- m4/cxx_have_bool.m4| 30 -- m4/cxx_have_namespaces.m4 | 25 -- m4/cxx_have_std_libs.m4| 32 -- m4/cxx_have_std_namespace.m4 | 26 -- m4/cxx_have_std_thread.m4 | 3 +- m4/xerces_transcoder_selection.m4 | 2 +- .../src/CreateDOMDocument/CreateDOMDocument.cpp| 24 +- samples/src/DOMCount/DOMCount.cpp | 72 +++-- samples/src/DOMCount/DOMCount.hpp | 8 +- samples/src/DOMPrint/DOMPrint.cpp | 70 ++--- samples/src/DOMPrint/DOMPrintErrorHandler.cpp | 12 +- samples/src/DOMPrint/DOMPrintErrorHandler.hpp | 2 +- samples/src/DOMPrint/DOMPrintFilter.hpp| 2 +- samples/src/DOMPrint/DOMTreeErrorReporter.cpp | 16 +- samples/src/DOMPrint/DOMTreeErrorReporter.hpp | 8 +- samples/src/EnumVal/EnumVal.cpp| 58 ++-- samples/src/MemParse/MemParse.cpp | 24 +- samples/src/MemParse/MemParse.hpp | 10 +- samples/src/MemParse/MemParseHandlers.cpp | 14 +- samples/src/MemParse/MemParseHandlers.hpp | 6 +- samples/src/PParse/PParse.cpp | 26 +- samples/src/PParse/PParse.hpp | 10 +- samples/src/PParse/PParseHandlers.cpp | 12 +- samples/src/PParse/PParseHandlers.hpp | 2 +- samples/src/PSVIWriter/PSVIWriter.cpp | 34 +-- samples/src/PSVIWriter/PSVIWriter.hpp | 10 +- samples/src/PSVIWriter/PSVIWriterHandlers.cpp | 8 +- samples/src/PSVIWriter/PSVIWriterHandlers.hpp | 6 +- samples/src/Redirect/Redirect.cpp | 18 +- samples/src/Redirect/Redirect.hpp | 10 +- samples/src/Redirect/RedirectHandlers.cpp | 14 +- samples/src/Redirect/RedirectHandlers.hpp | 6 +- samples/src/SAX2Count/SAX2Count.cpp| 36 +-- samples/src/SAX2Count/SAX2Count.hpp| 10 +- samples/src/SAX2Count/SAX2CountHandlers.cpp| 12 +- samples/src/SAX2Count/SAX2CountHandlers.hpp| 2 +- samples/src/SAX2Print/SAX2FilterHandlers.hpp | 2 +- samples/src/SAX2Print/SAX2Print.cpp| 22 +- samples/src/SAX2Print/SAX2Print.hpp| 10 +- samples/src/SAX2Print/SAX2PrintHandlers.cpp| 16 +- samples/src/SAX2Print/SAX2PrintHandlers.hpp| 2 +- samples/src/S
[xerces-c] branch master updated (76d2c5b -> f342e68)
This is an automated email from the ASF dual-hosted git repository. rleigh pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/xerces-c.git. from 76d2c5b Ignore built site. new e4e3351 XERCEC-2202: Update version to 3.3.0 new 11fae34 XERCEC-2202: Update spec file new 137fa58 XERCESC-2202: Update ICU message filename new f342e68 Merge pull request #13 from rleigh-codelibre/XERCESC-2202_update_version_to_3.3.0 The 6387 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: configure.ac | 4 ++-- src/xercesc/util/MsgLoaders/ICU/ICUMsgLoader.cpp | 4 ++-- xerces-c.spec| 5 - 3 files changed, 8 insertions(+), 5 deletions(-) - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[xerces-c] branch ci-test updated (03fee10 -> 575717d)
This is an automated email from the ASF dual-hosted git repository. rleigh pushed a change to branch ci-test in repository https://gitbox.apache.org/repos/asf/xerces-c.git. omit 03fee10 Merge pull request #9 from rleigh-codelibre/cmake-libname-fixes omit 84395e5 cmake: Correct shared library name and symlink creation omit d8881d6 XERCESC-1963 - Custom HTTP headers missing with CURL NetAccessor omit d00c6a5 XERCESC-2187 / others - DOM tests crashing on unsupported platforms omit a91b38c XERCESC-2189 - XMLChar with NEED_TO_GEN_TABLE has 2 buffer out of bounds reads omit aacdef3 XERCESC-2194 - Windows/cmake fails due to undefined ssize_t add 5266241 XERCESC-2194 - Windows/cmake fails due to undefined ssize_t add c9c5f42 XERCESC-2189 - XMLChar with NEED_TO_GEN_TABLE has 2 buffer out of bounds reads add 0d3989f XERCESC-2187 / others - DOM tests crashing on unsupported platforms add d38587f XERCESC-1963 - Custom HTTP headers missing with CURL NetAccessor add 44a039f cmake: Correct shared library name and symlink creation add 575717d Merge pull request #10 from rleigh-codelibre/cmake-libname-fixes-3.2 This update added new revisions after undoing existing revisions. That is to say, some revisions that were in the old version of the branch are not in the new version. This situation occurs when a user --force pushes a change and generates a repository containing something like this: * -- * -- B -- O -- O -- O (03fee10) \ N -- N -- N refs/heads/ci-test (575717d) You should already have received notification emails for all of the O revisions, and so the following emails describe only the N revisions from the common base, B. Any revisions marked "omit" are not gone; other references still refer to them. Any revisions marked "discard" are gone forever. No new revisions were added by this update. Summary of changes: - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[xerces-c] branch ci-test created (now 03fee10)
This is an automated email from the ASF dual-hosted git repository. rleigh pushed a change to branch ci-test in repository https://gitbox.apache.org/repos/asf/xerces-c.git. at 03fee10 Merge pull request #9 from rleigh-codelibre/cmake-libname-fixes No new revisions were added by this update. - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[xerces-c] branch master updated: cmake: Correct shared library name and symlink creation
This is an automated email from the ASF dual-hosted git repository. rleigh pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/xerces-c.git The following commit(s) were added to refs/heads/master by this push: new 84395e5 cmake: Correct shared library name and symlink creation new 03fee10 Merge pull request #9 from rleigh-codelibre/cmake-libname-fixes 84395e5 is described below commit 84395e5a61188ed05efb668661f5e2aad17c3a7b Author: Roger Leigh AuthorDate: Thu Apr 2 13:21:06 2020 +0100 cmake: Correct shared library name and symlink creation --- src/CMakeLists.txt | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c29aa25..344851f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1289,11 +1289,13 @@ elseif(UNIX) # set the version in the filename, and create the symlink at install # time. Note: could be dropped when the SONAME is updated and # libtool compatibility is no longer required. - set_target_properties(xerces-c PROPERTIES OUTPUT_NAME "xerces-c-${INTERFACE_VERSION_D}") - file(GENERATE -OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/InstallLibrarySymlink.cmake" -CONTENT "execute_process(COMMAND ln -sf \"$\" \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_LIBDIR}/libxerces-c.so\")") - install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/InstallLibrarySymlink.cmake") + if(BUILD_SHARED_LIBS) +set_target_properties(xerces-c PROPERTIES OUTPUT_NAME "xerces-c-${INTERFACE_VERSION_D}") +file(GENERATE + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/InstallLibrarySymlink.cmake" + CONTENT "execute_process(COMMAND ln -sf \"$\" \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_LIBDIR}/libxerces-c${CMAKE_SHARED_LIBRARY_SUFFIX}\")") +install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/InstallLibrarySymlink.cmake") + endif() else() # Not used for the common cases, though this would be the default if # not for libtool compatibility. - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[xerces-c] branch xerces-3.2 updated: cmake: Correct shared library name and symlink creation
This is an automated email from the ASF dual-hosted git repository. rleigh pushed a commit to branch xerces-3.2 in repository https://gitbox.apache.org/repos/asf/xerces-c.git The following commit(s) were added to refs/heads/xerces-3.2 by this push: new 44a039f cmake: Correct shared library name and symlink creation new 575717d Merge pull request #10 from rleigh-codelibre/cmake-libname-fixes-3.2 44a039f is described below commit 44a039f61e1a27ecd5bfb45007fc9cbb0c2acfc9 Author: Roger Leigh AuthorDate: Thu Apr 2 13:21:06 2020 +0100 cmake: Correct shared library name and symlink creation --- src/CMakeLists.txt | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c29aa25..344851f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1289,11 +1289,13 @@ elseif(UNIX) # set the version in the filename, and create the symlink at install # time. Note: could be dropped when the SONAME is updated and # libtool compatibility is no longer required. - set_target_properties(xerces-c PROPERTIES OUTPUT_NAME "xerces-c-${INTERFACE_VERSION_D}") - file(GENERATE -OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/InstallLibrarySymlink.cmake" -CONTENT "execute_process(COMMAND ln -sf \"$\" \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_LIBDIR}/libxerces-c.so\")") - install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/InstallLibrarySymlink.cmake") + if(BUILD_SHARED_LIBS) +set_target_properties(xerces-c PROPERTIES OUTPUT_NAME "xerces-c-${INTERFACE_VERSION_D}") +file(GENERATE + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/InstallLibrarySymlink.cmake" + CONTENT "execute_process(COMMAND ln -sf \"$\" \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_LIBDIR}/libxerces-c${CMAKE_SHARED_LIBRARY_SUFFIX}\")") +install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/InstallLibrarySymlink.cmake") + endif() else() # Not used for the common cases, though this would be the default if # not for libtool compatibility. - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[xerces-c] branch master updated (56299aa -> 3ba7410)
This is an automated email from the ASF dual-hosted git repository. rleigh pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/xerces-c.git. from 56299aa Update source repository info to GitBox. new 51fe4ed gitignore: Add Autotools generated files new 229bffb gitignore: Ignore Visual Studio and NMake project files and build products new d367430 gitattributes: Add line ending conventions and renormalise new 3ba7410 Merge pull request #1 from rleigh-codelibre/gitignore The 6374 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .gitattributes | 10 + .gitignore | 107 + doc/charter.xml| 914 +-- doc/xinclude.xml | 82 +- .../XSTSHarness/regression/AnnotatedTSSchema.xsd | 1188 ++-- .../XSTSHarness/regression/XERCESC-1051/schema.xsd | 18 +- .../XSTSHarness/regression/XERCESC-1051/test.xml | 10 +- .../regression/XERCESC-1051/test_valid.xml | 126 +- .../XSTSHarness/regression/XERCESC-1237/test.xml | 20 +- .../XSTSHarness/regression/XERCESC-1237/unique.xsd | 50 +- .../XSTSHarness/regression/XERCESC-1239/Test.xsd | 48 +- .../XSTSHarness/regression/XERCESC-1239/test.xml | 10 +- .../src/XSTSHarness/regression/XERCESC-1281/rT.xml | 40 +- .../regression/XERCESC-1281/restrictionTest.xsd| 178 +- .../regression/XERCESC-1393/invalid.xml|6 +- .../XSTSHarness/regression/XERCESC-1393/schema.xsd | 38 +- .../XSTSHarness/regression/XERCESC-1393/valid.xml |6 +- .../regression/XERCESC-1419/pattern1.xml |2 +- .../regression/XERCESC-1419/pattern1.xsd | 16 +- .../XSTSHarness/regression/XERCESC-1512/schema.xsd | 42 +- .../XSTSHarness/regression/XERCESC-1546/test.xml |8 +- .../XSTSHarness/regression/XERCESC-1546/test.xsd | 38 +- .../regression/XERCESC-1583/keyref-imported.xsd| 46 +- .../regression/XERCESC-1583/keyref-main.xsd| 38 +- .../XSTSHarness/regression/XERCESC-1591/schema.xsd | 96 +- .../regression/XERCESC-1592/MainSchema.xsd | 32 +- .../regression/XERCESC-1592/Schema1.xsd| 18 +- .../regression/XERCESC-1623/need-import-t.xml | 14 +- .../regression/XERCESC-1623/need-import-t.xsd | 22 +- .../XERCESC-1623/very-simple-2-ns-ppl-nons-t.xsd | 18 +- .../regression/XERCESC-1633/instance.xml | 26 +- .../regression/XERCESC-1633/schema_test.xsd| 66 +- .../XSTSHarness/regression/XERCESC-1707/test.xml | 24 +- .../XSTSHarness/regression/XERCESC-1707/test.xsd | 46 +- .../XSTSHarness/regression/XERCESC-1714/schema.xsd | 64 +- .../XSTSHarness/regression/XERCESC-1718/test.xsd | 42 +- .../regression/XERCESC-1776/gargamel.xsd | 26 +- .../XSTSHarness/regression/XERCESC-1776/smerf.xml | 14 +- .../XSTSHarness/regression/XERCESC-1776/smerf.xsd | 20 +- .../XSTSHarness/regression/XERCESC-1787/schema.xsd | 38 +- .../XSTSHarness/regression/XERCESC-1817/test2.xml | 48 +- .../XSTSHarness/regression/XERCESC-1817/test2.xsd | 94 +- .../regression/XERCESC-1822/m3_10v39.xml | 40 +- .../regression/XERCESC-1822/m3_10v39.xsd | 152 +- .../regression/XERCESC-1822/m3_10v44.xml | 42 +- .../regression/XERCESC-1822/m3_10v44.xsd | 110 +- .../XSTSHarness/regression/XERCESC-1825/test.xsd | 40 +- .../XSTSHarness/regression/XERCESC-1831/ack.xml|8 +- .../XSTSHarness/regression/XERCESC-1831/ack.xsd| 16 +- .../regression/XERCESC-1832/schema11.xsd | 66 +- .../regression/XERCESC-1878/invalid.xml|8 +- .../XSTSHarness/regression/XERCESC-1878/schema.xsd | 42 +- .../XSTSHarness/regression/XERCESC-1878/valid.xml | 6004 ++-- .../regression/XERCESC-1893/included.xsd | 18 +- .../XSTSHarness/regression/XERCESC-1893/main.xsd | 26 +- .../XSTSHarness/regression/XERCESC-1937/test.xml | 14 +- .../XSTSHarness/regression/XERCESC-1937/test.xsd | 18 +- .../XSTSHarness/regression/XERCESC-1945/test.xml | 14 +- .../XSTSHarness/regression/XERCESC-1945/test.xsd | 18 +- .../XSTSHarness/regression/XERCESC-2017/test.xml | 46 +- .../XSTSHarness/regression/XERCESC-2017/test.xsd | 150 +- .../XSTSHarness/regression/XERCESC-2017/test2.xml | 46 +- .../XSTSHarness/regression/XERCESC-394/test.xsd| 28 +- .../XSTSHarness/regression/XERCESC-423/dummy.xml | 24 +- .../XSTSHarness/regression/XERCESC-423/dummy.xsd | 124 +- .../XSTSHarness/regression/XERCESC-474/myDoc.xml |2 +- .../XSTSHarness/regression/XERCESC-538/test.xml|2 +- .../XS
Re: Building Xerces-3.2.1 with cmake on Windows
On 2018-03-16 15:32, Cantor, Scott wrote: > Why has this been removed? That would be a bug. It doesn't appear to be a distribution building regression, rather the file isn't in svn on trunk that I can see unless it's been renamed. I suspect it's a regression in the change that builds more of the version-specific files, since this would have been one to do that with. It was removed in https://github.com/apache/xerces-c/commit/66023ed75fd2587d80fb7cb3ed4101b5ec88dc89 Version.rc was part of the Win32MsgLoader implementation, and it provided the string translations. It was dropped with the Win32MsgLoader removal. If the rc metadata is important to retain, we could provide a message loader-independent rc file with just the version/vendor metadata? Regards, Roger - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
Re: Xerces-C 3.2.1rc2 posted
On 2018-02-18 23:19, Roger Leigh wrote: On 16/02/18 22:18, Cantor, Scott wrote: Signed distributions available here: https://dist.apache.org/repos/dist/dev/xerces/c/3/sources/ Release notes: https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=10510=12341423 Will call for a vote next week if nothing else pops up. I added a couple of commits to address a couple of problems: 1) A header variable substitution was wrong for MSVC, leading to a xerces-c_.lib missing the major version. 2) Moving the version numbers out of XercesVersion.hpp to a generated header broke tools which relied on parsing the version number out of the header such as FindXercesC (CMake). Generating XercesVersion.hpp directly avoids such breakage. I'm resting with these two patches, and I'll let you know if I find anything else tomorrow. Nothing else showed up today. If it would be possible to do an rc3 with the fixes I committed rolled in, I'll do another round of testing to double-check the changes. Thanks, Roger - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
RE: CMake / Windows preproc defines
On 2017-08-30 13:40, Cantor, Scott wrote: I'm afraid not. With my testing, I simply ran cmake -G "Visual Studio 15 2017 Win64" [options] /path/to/xerces and opened the solution file. Did you use any additional options on the command line? If you could let me know exactly what you ran, I can try to reproduce and investigate. We're using this command: cmake -G "Visual Studio 15 2017" -DCMAKE_CXX_FLAGS=/MP -DCMAKE_INSTALL_PREFIX=%ROOT_DIR%%XERCES_DIR%\install32\%MsVCVersion% ..\.. And now that I look at it, I bet it's the CMAKE_CXX_FLAGS override. It must fully replace a default value that it uses internally that's getting WIN32 defined. I'd bet a few beers that's it. Sorry for the noise. We'll look into the right way to supplement but not replace the macros. It does sound like the override is at fault. If you set with -D they go into the cache, and they won't be modified later on. Could you possibly try set "CXXFLAGS=/MP" in the shell before running CMake to see if this picks up and appends the options, rather than overriding? Regards, Roger - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
RE: Xerces 3.2 RC2 released, call for vote
On 2017-08-28 17:04, Cantor, Scott wrote: Roger, did you happen to test Visual Studio 2017 (VC15)? I got a report from my colleague that it's missing a WIN32 define that's preventing one of my changes to the DateTime class from building there without adding it by hand. Looks like a false alarm or something environmental with the solution file it generated on his box, seems to work for me as expected. I've just tried manual testing with VS2017 (latest update) and CMake (3.9.1) with three combinations: - "Ninja" from command prompt (x64 Debug) - "Visual Studio 15 2017 Win64" (x64 Debug and Release in visual studio) - "Visual Studio 15 2017" from command prompt (x86 Debug) and all three built and passed the tests without any problems. Regards, Roger - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
RE: Turn on parallel compilation in cmake builds?
On 2017-08-21 15:47, Cantor, Scott wrote: What type of change is your colleague proposing to turn it on? He was proposing something like this: if(WIN32) set(CMAKE_CXX_FLAGS "\MP") endif() But neither of us know cmake, he's just trying to make it work the way the original builds did. I think this is too general. WIN32 is set for all builds on Windows platforms, so would break GCC or clang builds. MSVC is set when using cl, but for all generators so would break with Ninja or nmake etc. I think you probably want this: if(CMAKE_GENERATOR MATCHES "Visual Studio") string(APPEND CMAKE_CXX_FLAGS "\\MP") endif() so that it's specific to MSVC with the msbuild project/solution file generator for Visual Studio. And it also appends to the flags already set so it won't wipe them out. You can equally set CXXFLAGS when running cmake for the same effect, i.e. cmake -G "Visual Studio..." -DCMAKE_CXX_FLAGS=\MP ... Regards, Roger - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
Re: Turn on parallel compilation in cmake builds?
On 2017-08-21 14:55, Cantor, Scott wrote: Primarily a Windows thing, my colleague doing testing says he doesn't think the default build currently spawns muiltiple threads inside the VS builds unless he turns that on. Is there a reason not to turn it on by default in the CMakeFile.txt file? What type of change is your colleague proposing to turn it on? Have they read https://blog.kitware.com/cmake-building-with-all-your-cores/ ? There are some caveats there which are worth noting (relating to /MP) which make adding it by default potentially bad since in combination with target-level parallelism it can greatly exceed the resources of the machine and break the build. It's also quite possible that xerces is already being built in parallel with other projects [we do this] so enabling parallelisation at the lowest level can break the parallelisation already in place at a much higher level. There are also multiple ways to parallelise builds on Windows, so any change should not compromise building with any of the other methods. If there's a way of safely enabling it, that would be great, but it appears the current recommendations are to configure this when running cmake rather than hardcoding the behaviour. Kind regards, Roger - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
Remaining Xerces 3.2.0 issues and Xalan
Are there any known remaining issues for the 3.2.0 release? I've tested with various Visual Studio versions and also tested on CentOS 6, CentOS 7, Ubuntu 16.04, Ubuntu 17.10, MacOS X 10.11 and 10.12 and FreeBSD 11.1 and it's worked on all of them. I've also built with Xalan-C on all of these platforms, and it works across the board. Xalan does require patching if using a C++11 compiler; I've filed a JIRA ticket with a patch for this: https://issues.apache.org/jira/browse/XALANC-773 . I've asked about this and cmake on the Xalan list a few times, but I've yet to have any response at all on the list or on a JIRA ticket. Does anyone know the current maintenance status of Xalan-C? There are a number of outstanding patches which various Linux and other distributions are carrying in order to be able to compile which could really do with folding into a new release. If the project is abandoned and without a maintainer, is there any process to go through to join the project to apply these outstanding patches? Thanks all, Roger - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
RC1 testing on Windows
I have now had success building with Xerces 3.2.0rc1 and with Xalan on top of that, with both VS2015 and VS2013. I did need to apply this patch: https://issues.apache.org/jira/browse/XALANC-773 for VS2015 to correct some assumptions about the XalanDOMChar type, which is assumed to be wchar_t in a handful of places, which is not correct when using char16_t. Hopefully we can get the Xalan patch applied and released so it will continue to work with 3.2.0. Regards, Roger - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
RE: Upporting status
On 2017-07-03 14:32, Cantor, Scott wrote: You might find https://issues.apache.org/jira/browse/XERCESC-2104 of interest. This replaces sanityTest.pl with separate automake checks. You can still run "make check", but it now shows you each individual test being run and stores the logs in separate files. This makes it much clearer what's breaking. I don't know what XFAIL means but the tests all pass for me on Windows and Linux at the moment. XFAIL is "expected fail". Some of the tests expect a nonzero exit status; mainly just tests which display usage information when run with no options. It's treated the same as PASS in that it's not counted as an error. If they ever pass unexpectedly then you'll get an XPASS which is treated as an error. These are XFAIL_TESTS in Makefile.am, and EXPECT_FAIL in CMakeLists.txt. Regards, Roger - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
RE: Upporting status
On 2017-07-03 14:55, Cantor, Scott wrote: Roger, is that separate fork updated with the master copy? It looks like maybe it's missing the bug fixes I checked in Friday after you let me know they were failing. That would certainly explain it. The link issue was just a dangling reference to 3_1 in the ICU build from the version change, which I probably should see if we can get indirected into a macro. I'm not familiar with Travis yet but I interpreted the output here [1] as successful (the #9 link). Yes, thanks. After that fix went in, everything passed across the board. - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
Re: Integrating CMake support for xerces
On 2017-05-17 17:30, Cantor, Scott wrote: On 5/17/17, 12:21 PM, "rle...@codelibre.net"wrote: I spoke too soon; it's not working for the VS generators on Windows when using multiple configurations. I'll fix this up tomorrow. FWIW, the names currently are the same for 32 and 64 builds. That probably is as much because of the timing of them being added, but it does also relate to the cross-platform point you had, people on Windows doing dual arch builds don't tend to use different names for the files (at least not that I've seen) since they tend to just copy their old makefiles and projects to 64-bit. The issue was more related to the debug/release DLL names in the .rc file than 32/64-bit names. I've fixed this detail up, and updated the patch is in JIRA. It should now work across to board. https://issues.apache.org/jira/secure/attachment/12868727/0002-cmake-Align-versioning-with-Autotools-and-Visual-Stu.patch Regards, Roger - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
Re: Integrating CMake support for xerces
On 2017-05-17 16:35, rle...@codelibre.net wrote: On 2017-05-17 16:26, Cantor, Scott wrote: On 5/17/17, 11:11 AM, "rle...@codelibre.net"wrote: I've attached a followup patch, also on my cmake-trunk github branch, which does this. With this patch applied, you should get identical versioning to Autoconf and Visual Studio. Great, I'm WfH today but I'll see what it does on OS X today and re-test Windows tomorrow at the office. Maybe we could look at doing the svn merge next week? That sounds great. I'm in the process of re-running all the 256 CI builds again; no failures so far. I spoke too soon; it's not working for the VS generators on Windows when using multiple configurations. I'll fix this up tomorrow. - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
Re: Integrating CMake support for xerces
On 2017-05-17 16:26, Cantor, Scott wrote: On 5/17/17, 11:11 AM, "rle...@codelibre.net"wrote: I've attached a followup patch, also on my cmake-trunk github branch, which does this. With this patch applied, you should get identical versioning to Autoconf and Visual Studio. Great, I'm WfH today but I'll see what it does on OS X today and re-test Windows tomorrow at the office. Maybe we could look at doing the svn merge next week? That sounds great. I'm in the process of re-running all the 256 CI builds again; no failures so far. Regards, Roger - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
RE: Integrating CMake support for xerces
On 2017-05-16 21:47, Cantor, Scott wrote: OK. I'll look into copying the existing Windows and Libtool semantics exactly. If there's a possibility for aligning them with the next major release, we could revisit it then, but I'll revert to the status quo for now. Thx. I hope that explains things, but I'm happy to go into more detail for any aspects which are unclear. Thanks, I'll review further while you make the filename adjustments but I think if others don't have concerns we can plan for merging it back to trunk. I've attached a followup patch, also on my cmake-trunk github branch, which does this. With this patch applied, you should get identical versioning to Autoconf and Visual Studio. Regards, Roger - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
Re: Xerces-C 3.1.4 released
On 2016-06-29 14:44, Cantor, Scott wrote: A patch release of the Xerces-C XML parser is now available and is propagating to the mirrors. It includes a small number of important bug fixes, including a fix for CVE-2016-4463. https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=10510=12336069 Of special note, applications that don't make use of DTDs should strongly consider setting the XERCES_ DISABLE_DTD environment variable to "1" to insulate themselves from the likelihood of future vulnerabilities in that code. When I have a free moment I will make that a parser feature in the trunk since it requires an ABI change. FYI, the downloads on http://apache.org/dist/xerces/c/3/sources/ are missing the signatures and checksums for xerces-c-3.1.4.tar.xz. Would it be possible to add them? Thanks, Roger - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
Re: CMake support
While the xerces-c project provides an autotools-based build and several different visual studio solution files, I was wondering if you had considered the use of a tool such as CMake, which can generate solution files for all visual studio versions (including 2015), Makefiles, and project files for a number of IDEs, including Eclipse? This allows all the platforms to be supported well from a common set of build rules, and means you don't need to maintain separate solutions for each visual studio release. I didn't see any response to this unless I missed it. In the interim, I've been trying to use the provided VC solution/project files, and I've run into some problems. The ICU Debug and ICU Release configurations are broken for all the VC versions I've looked at (10, 11 and 12), likely applicable to all versions. They don't link against the libicuuc[d].lib libraries for any of the x64 platform variants. And they don't link against the debug library for the debug configuration variants. The following patch demonstrates a possible fix for VC12, which should apply to all previous versions as well. Regarding CMake support, this discrepancy could have been easily avoided by having a simple feature test and option for ICU support, rather than a combinatorial explosion of configurations, platforms and VC versions. My offer to add such support still stands, should you wish to take advantage of it. Kind regards, Roger $ diff -urN xerces-c-3.1.2.orig xerces-c-3.1.2 diff -urN xerces-c-3.1.2.orig/projects/Win32/VC12/xerces-all/XercesLib/XercesLib.vcxproj xerces-c-3.1.2/projects/Win32/VC12/xerces-all/XercesLib/XercesLib.vcxproj --- xerces-c-3.1.2.orig/projects/Win32/VC12/xerces-all/XercesLib/XercesLib.vcxproj 2015-03-09 22:45:53.0 + +++ xerces-c-3.1.2/projects/Win32/VC12/xerces-all/XercesLib/XercesLib.vcxproj 2015-07-08 09:34:52.888900100 + @@ -1,4 +1,4 @@ -#65279;?xml version=1.0 encoding=utf-8? +?xml version=1.0 encoding=utf-8? Project DefaultTargets=Build ToolsVersion=12.0 xmlns=http://schemas.microsoft.com/developer/msbuild/2003; ItemGroup Label=ProjectConfigurations ProjectConfiguration Include=Debug|Win32 @@ -538,7 +538,7 @@ /ResourceCompile Link AdditionalOptions%(AdditionalOptions)/AdditionalOptions - AdditionalDependenciesws2_32.lib;advapi32.lib;icuuc.lib;%(AdditionalDependencies)/AdditionalDependencies + AdditionalDependenciesws2_32.lib;advapi32.lib;icuucd.lib;%(AdditionalDependencies)/AdditionalDependencies OutputFile$(TargetPath)/OutputFile AdditionalLibraryDirectories%(AdditionalLibraryDirectories)/AdditionalLibraryDirectories GenerateDebugInformationtrue/GenerateDebugInformation @@ -578,7 +578,7 @@ Culture0x0409/Culture /ResourceCompile Link - AdditionalDependenciesws2_32.lib;advapi32.lib;%(AdditionalDependencies)/AdditionalDependencies + AdditionalDependenciesws2_32.lib;advapi32.lib;icuucd.lib;%(AdditionalDependencies)/AdditionalDependencies OutputFile$(TargetPath)/OutputFile AdditionalLibraryDirectories%(AdditionalLibraryDirectories)/AdditionalLibraryDirectories GenerateDebugInformationtrue/GenerateDebugInformation @@ -669,7 +669,7 @@ Culture0x0409/Culture /ResourceCompile Link - AdditionalDependenciesws2_32.lib;advapi32.lib;%(AdditionalDependencies)/AdditionalDependencies + AdditionalDependenciesws2_32.lib;advapi32.lib;icuuc.lib;%(AdditionalDependencies)/AdditionalDependencies OutputFile$(TargetPath)/OutputFile AdditionalLibraryDirectories%(AdditionalLibraryDirectories)/AdditionalLibraryDirectories GenerateDebugInformationtrue/GenerateDebugInformation -- Dr Roger Leigh -- Open Microscopy Environment Wellcome Trust Centre for Gene Regulation and Expression, College of Life Sciences, University of Dundee, Dow Street, Dundee DD1 5EH Scotland UK Tel: (01382) 386364 - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org