[jira] [Commented] (XERCESC-2154) "terminate called after throwing an instance of 'xercesc_3_2::XMLErrs::Codes'" crash on Solaris x86 with invalid xml input (c++11)
[ https://issues.apache.org/jira/browse/XERCESC-2154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16638288#comment-16638288 ] Roger Leigh commented on XERCESC-2154: -- Is the problem specific to C++11 or does the problem also occur with C++98? I don't think that the standard version should affect exception handling, but it might be worth checking. While your LD_LIBRARY_PATH and ldd output show it to be using the libgcc_s and libstdc++ from _/opt/developerstudio12.6_ I'm still a bit suspicious that somehow there might be a version mismatch here. It might be worth asking Oracle developer studio support, or on the GCC mailing list, since this is likely to be somewhat subtle and I don't personally have any recent Solaris expertise to draw upon. Given it looks like a low level problem in the C++/C runtime itself, I don't think there's a fault in Xerces-C++ here, unless there's something we can add to the Autoconf logic for Solaris. > "terminate called after throwing an instance of > 'xercesc_3_2::XMLErrs::Codes'" crash on Solaris x86 with invalid xml input > (c++11) > -- > > Key: XERCESC-2154 > URL: https://issues.apache.org/jira/browse/XERCESC-2154 > Project: Xerces-C++ > Issue Type: Bug > Components: DOM >Affects Versions: 3.2.1, 3.2.2 > Environment: Oracle compiler version (supports c++11): > [hostname]/: /opt/developerstudio12.6/bin/CC -V > CC: Studio 12.6 Sun C++ 5.15 SunOS_i386 2017/05/30 > OS version: > [hostname]/: uname -a > SunOS hostname 5.10 Generic_150401-61 i86pc i386 i86pc >Reporter: Grzegorz Majka >Priority: Major > Attachments: xml_broken.xml, xml_ok.xml > > > Hi, > I have a problem running xerces on Solaris x86 platform compiled with > '-std=c++11' flag using Oracle developer studio 12.6. The compilation is fine > and the library works fine in all positive scenarios, but it fails with Abort > signal (core dumped) when an XML content to process is broken ending with the > error message: > "terminate called after throwing an instance of 'xercesc_3_2::XMLErrs::Codes'" > I was able to isolate the problem by using DOMPrint example run with a file > with an invalid xml content. > The positive scenario: > [hostname]/rome/homes/cit/gmajka/xerces_tests/solaris_322/xerces-c-3.2.2: > export > LD_LIBRARY_PATH=/rome/homes/cit/gmajka/xerces_tests/solaris_322/xerces-c-3.2.2/src/.libs:/opt/developerstudio12.6/lib/compilers/CC-gcc/lib > [hostname]/rome/homes/cit/gmajka/xerces_tests/solaris_322/xerces-c-3.2.2/samples: > ./.libs/DOMPrint xml_ok.xml > > > > > > > > The negative scenario: > [hostname]/rome/homes/cit/gmajka/xerces_tests/solaris_322/xerces-c-3.2.2/samples: > ./.libs/DOMPrint xml_broken.xml > Fatal Error at file > "/rome/homes/cit/gmajka/xerces_tests/solaris_322/xerces-c-3.2.2/samples/xml_broken.xml", > line 5, column 1 > Message: input ended before all started tags were ended; last tag started > is 'Hardware' > terminate called after throwing an instance of 'xercesc_3_2::XMLErrs::Codes' > Abort (core dumped) > I attach both xml_ok.xml and xml_broken.xml files for your reference. > Details: > 1) > Xerces version 3.2.1 (I also tried with 3.2.2 with the same behavior) > 2) > Oracle compiler version (supports c++11): > [hostname]/rome/homes/cit/gmajka/xerces_tests/solaris_322/xerces-c-3.2.2: > /opt/developerstudio12.6/bin/CC -V > CC: Studio 12.6 Sun C++ 5.15 SunOS_i386 2017/05/30 > OS version: > [hostname]/rome/homes/cit/gmajka/xerces_tests/solaris_322/xerces-c-3.2.2: > uname -a > SunOS hostname 5.10 Generic_150401-61 i86pc i386 i86pc > 3) > Configure options: > [hostname]/rome/homes/cit/gmajka/xerces_tests/solaris_322/xerces-c-3.2.2: > chmod +x ./configure.solaris; chmod +x config/install-sh; ./configure.solaris > CXX="/opt/developerstudio12.6/bin/CC" CC="/opt/developerstudio12.6/bin/cc" > LD="/opt/developerstudio12.6/bin/CC" LDFLAGS="-std=c++11 > -L/opt/developerstudio12.6/lib/compilers/CC-gcc/lib -lstdc++ -lgcc_s -lCrunG3 > -s" CFLAGS="-xO2 -D_XOPEN_SOURCE_EXTENDED=1 -D__EXTENSIONS__ -Kpic -mt" > CXXFLAGS="-xO2 -D_XOPEN_SOURCE_EXTENDED=1 -D__EXTENSIONS__ -Kpic -mt > -std=c++11" --disable-static --enable-xmlch-uint16_t > AR="/opt/developerstudio12.6/bin/CC -xar" ARFLAGS=-o --enable-transcoder-iconv > ... > ... > configure.solaris: Report: > configure.solaris: File Manager: POSIX > configure.solaris: Mutex Manager: standard > configure.solaris: Transcoder: iconv > configure.solaris: NetAccessor: socket > configure.solaris: Message Loader: inmemory > configure.solaris: XMLCh Type: uint16_t > 4) > "ldd" outputs: > Initially I had issues with "terminate called after throwing
[jira] [Commented] (XERCESC-2154) "terminate called after throwing an instance of 'xercesc_3_2::XMLErrs::Codes'" crash on Solaris x86 with invalid xml input (c++11)
[ https://issues.apache.org/jira/browse/XERCESC-2154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16638274#comment-16638274 ] Grzegorz Majka commented on XERCESC-2154: - Hi Roger, Thanks for answering. I used configure script and then "make all" to compile xerces - I provided the list of configure options I used. I cannot do CMake, because it's not configured on the machine. I tried to compile cmake, but the machine was missing some required tools. Indeed as you noted, it looks like a problem with exception handling, but I don't know what's going on. Today I tried a simple test program with a dynamic .so library which exported a function throwing an exception, which I called from a main program that was linked against this .so library, but all worked fine - the exception thrown from the function was caught in catch(...) block. I included all the switches I used during xerces compilation. I will do some more tests and a different combination of linker options, but no luck so far. > "terminate called after throwing an instance of > 'xercesc_3_2::XMLErrs::Codes'" crash on Solaris x86 with invalid xml input > (c++11) > -- > > Key: XERCESC-2154 > URL: https://issues.apache.org/jira/browse/XERCESC-2154 > Project: Xerces-C++ > Issue Type: Bug > Components: DOM >Affects Versions: 3.2.1, 3.2.2 > Environment: Oracle compiler version (supports c++11): > [hostname]/: /opt/developerstudio12.6/bin/CC -V > CC: Studio 12.6 Sun C++ 5.15 SunOS_i386 2017/05/30 > OS version: > [hostname]/: uname -a > SunOS hostname 5.10 Generic_150401-61 i86pc i386 i86pc >Reporter: Grzegorz Majka >Priority: Major > Attachments: xml_broken.xml, xml_ok.xml > > > Hi, > I have a problem running xerces on Solaris x86 platform compiled with > '-std=c++11' flag using Oracle developer studio 12.6. The compilation is fine > and the library works fine in all positive scenarios, but it fails with Abort > signal (core dumped) when an XML content to process is broken ending with the > error message: > "terminate called after throwing an instance of 'xercesc_3_2::XMLErrs::Codes'" > I was able to isolate the problem by using DOMPrint example run with a file > with an invalid xml content. > The positive scenario: > [hostname]/rome/homes/cit/gmajka/xerces_tests/solaris_322/xerces-c-3.2.2: > export > LD_LIBRARY_PATH=/rome/homes/cit/gmajka/xerces_tests/solaris_322/xerces-c-3.2.2/src/.libs:/opt/developerstudio12.6/lib/compilers/CC-gcc/lib > [hostname]/rome/homes/cit/gmajka/xerces_tests/solaris_322/xerces-c-3.2.2/samples: > ./.libs/DOMPrint xml_ok.xml > > > > > > > > The negative scenario: > [hostname]/rome/homes/cit/gmajka/xerces_tests/solaris_322/xerces-c-3.2.2/samples: > ./.libs/DOMPrint xml_broken.xml > Fatal Error at file > "/rome/homes/cit/gmajka/xerces_tests/solaris_322/xerces-c-3.2.2/samples/xml_broken.xml", > line 5, column 1 > Message: input ended before all started tags were ended; last tag started > is 'Hardware' > terminate called after throwing an instance of 'xercesc_3_2::XMLErrs::Codes' > Abort (core dumped) > I attach both xml_ok.xml and xml_broken.xml files for your reference. > Details: > 1) > Xerces version 3.2.1 (I also tried with 3.2.2 with the same behavior) > 2) > Oracle compiler version (supports c++11): > [hostname]/rome/homes/cit/gmajka/xerces_tests/solaris_322/xerces-c-3.2.2: > /opt/developerstudio12.6/bin/CC -V > CC: Studio 12.6 Sun C++ 5.15 SunOS_i386 2017/05/30 > OS version: > [hostname]/rome/homes/cit/gmajka/xerces_tests/solaris_322/xerces-c-3.2.2: > uname -a > SunOS hostname 5.10 Generic_150401-61 i86pc i386 i86pc > 3) > Configure options: > [hostname]/rome/homes/cit/gmajka/xerces_tests/solaris_322/xerces-c-3.2.2: > chmod +x ./configure.solaris; chmod +x config/install-sh; ./configure.solaris > CXX="/opt/developerstudio12.6/bin/CC" CC="/opt/developerstudio12.6/bin/cc" > LD="/opt/developerstudio12.6/bin/CC" LDFLAGS="-std=c++11 > -L/opt/developerstudio12.6/lib/compilers/CC-gcc/lib -lstdc++ -lgcc_s -lCrunG3 > -s" CFLAGS="-xO2 -D_XOPEN_SOURCE_EXTENDED=1 -D__EXTENSIONS__ -Kpic -mt" > CXXFLAGS="-xO2 -D_XOPEN_SOURCE_EXTENDED=1 -D__EXTENSIONS__ -Kpic -mt > -std=c++11" --disable-static --enable-xmlch-uint16_t > AR="/opt/developerstudio12.6/bin/CC -xar" ARFLAGS=-o --enable-transcoder-iconv > ... > ... > configure.solaris: Report: > configure.solaris: File Manager: POSIX > configure.solaris: Mutex Manager: standard > configure.solaris: Transcoder: iconv > configure.solaris: NetAccessor: socket > configure.solaris: Message Loader: inmemory > configure.solaris: XMLCh Type: uint16_t > 4) > "ldd"