On 21/01/2016 16:17, rle...@codelibre.net wrote:
On 2016-01-21 15:27, rle...@codelibre.net wrote:
My unit test here fails with "invalid document structure". However,
the XML is well-formed UTF-8 with no BOM; it's been working fine for
years.
The difference between the exception being thrown or not thrown is
very simple: whether or not I link Xerces-C (works) or Xerces-C *and*
Xalan-C (fails). I'm not *using* Xalan-C, I'm merely linking my
shared library against it.
It looks like this is now fixed by
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206472
and appears to have been a lack of iconv support in xerces-c.
I've now subsequently hit an odd failed assertion in xalan-c, which is
likely not of interest to the xerces-c readers. The assertion is in
XalanReferenceCountedObject, where it's failing an assert in the
destructor. Are there any known circumstances where this can be
triggered, e.g. particular build configurations? I don't think it's
platform-specific, since it's working for me on FreeBSD with an
ICU-enabled xerces-c and an ICU-disabled xalan-c. This is with ICU
disabled for both using the ports builds of each. The test is passing
on Linux, MacOS X and Windows, so I don't think my code is faulty either.
Any suggestions greatly appreciated.
Thanks,
Roger
gdb test/ome-common/xalan
[...]
(gdb) run
[...]
[==========] Running 91 tests from 10 test cases.
[----------] Global test environment set-up.
[----------] 1 test from XalanSkipTest
[ RUN ] XalanSkipTest.PlatformRefCountSkipInit
[ OK ] XalanSkipTest.PlatformRefCountSkipInit (14 ms)
[----------] 1 test from XalanSkipTest (15 ms total)
[----------] 10 tests from XalanTransformTypes/XalanTest/0, where
TypeParam = TestTypes<boost::filesystem::path, boost::filesystem::path>
[ RUN ] XalanTransformTypes/XalanTest/0.Platform
[ OK ] XalanTransformTypes/XalanTest/0.Platform (20 ms)
[ RUN ] XalanTransformTypes/XalanTest/0.PlatformRefCount
[ OK ] XalanTransformTypes/XalanTest/0.PlatformRefCount (18 ms)
[ RUN ] XalanTransformTypes/XalanTest/0.TransformConstruct
[ OK ] XalanTransformTypes/XalanTest/0.TransformConstruct (18 ms)
[ RUN ] XalanTransformTypes/XalanTest/0.TransformSetEntityResolver
[ OK ] XalanTransformTypes/XalanTest/0.TransformSetEntityResolver
(16 ms)
[ RUN ] XalanTransformTypes/XalanTest/0.TransformApply
Testing transform of path to path using
"/tmp/ome-common-cpp/test/ome-common/data/18x24y5z5t2c8b-text.ome"and
"/tmp/ome-common-cpp/test/ome-common/data/2012-06-to-2013-06.xsl"
Assertion failed: (theInstance->m_referenceCount < UINT_MAX), function
addReference, file
/usr/ports/textproc/xalan-c/work/xalan-c-1.11/c/src/xalanc/PlatformSupport/XalanReferenceCountedObject.cpp,
line 55.
[New Thread 807806400 (LWP 101332/xalan)]
Program received signal SIGABRT, Aborted.
[Switching to Thread 807806400 (LWP 101332/xalan)]
0x000000080420c64a in thr_kill () from /lib/libc.so.7
(gdb) bt
#0 0x000000080420c64a in thr_kill () from /lib/libc.so.7
#1 0x000000080420c636 in raise () from /lib/libc.so.7
#2 0x000000080420c5b9 in abort () from /lib/libc.so.7
#3 0x0000000804272fd1 in __assert () from /lib/libc.so.7
#4 0x00000008027f7985 in
xalanc_1_11::XalanReferenceCountedObject::addReference () from
/usr/local/lib/libxalan-c.so
#5 0x00000008028fbbd4 in xalanc_1_11::XPath::execute () from
/usr/local/lib/libxalan-c.so
#6 0x00000008028fac90 in
xalanc_1_11::ElemForEach::createSelectedAndSortedNodeList () from
/usr/local/lib/libxalan-c.so
#7 0x000000080298cf72 in
xalanc_1_11::ElemApplyTemplates::getFirstChildElemToExecute () from
/usr/local/lib/libxalan-c.so
#8 0x0000000802947615 in xalanc_1_11::ElemTemplateElement::execute ()
from /usr/local/lib/libxalan-c.so
#9 0x000000080296a7f4 in xalanc_1_11::StylesheetRoot::process () from
/usr/local/lib/libxalan-c.so
#10 0x000000080294b2f8 in xalanc_1_11::XSLTEngineImpl::process () from
/usr/local/lib/libxalan-c.so
#11 0x00000008029f2fe0 in xalanc_1_11::XalanTransformer::doTransform ()
from /usr/local/lib/libxalan-c.so
#12 0x00000008029ef3ac in xalanc_1_11::XalanTransformer::transform ()
from /usr/local/lib/libxalan-c.so
#13 0x0000000800970cbd in ome::common::xsl::Transformer::transform ()
from /tmp/b2/ome-common-build/lib/ome/common/libome-common.so.5.2.0
#14 0x0000000800970dc5 in ome::common::xsl::Transformer::transform ()
from /tmp/b2/ome-common-build/lib/ome/common/libome-common.so.5.2.0
#15 0x000000000044503e in XalanTest<TestTypes<boost::filesystem::path,
boost::filesystem::path> >::TestTransform ()
#16 0x0000000000460a9d in
gtest_case_XalanTest_::TransformApply<TestTypes<boost::filesystem::path,
boost::filesystem::path> >::TestBody ()
#17 0x00000008033faad4 in
testing::internal::HandleExceptionsInMethodIfSupported<testing::Test,
void> () from /usr/local/lib/libgtest.so.0
#18 0x00000008033e4372 in testing::Test::Run () from
/usr/local/lib/libgtest.so.0
#19 0x00000008033e53c4 in testing::TestInfo::Run () from
/usr/local/lib/libgtest.so.0
#20 0x00000008033e5c20 in testing::TestCase::Run () from
/usr/local/lib/libgtest.so.0
#21 0x00000008033ed467 in testing::internal::UnitTestImpl::RunAllTests
() from /usr/local/lib/libgtest.so.0
#22 0x00000008033fb784 in
testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl,
bool> ()
from /usr/local/lib/libgtest.so.0
#23 0x00000008033ed0f6 in testing::UnitTest::Run () from
/usr/local/lib/libgtest.so.0
#24 0x0000000000490fd1 in RUN_ALL_TESTS ()
#25 0x0000000000490e15 in main ()