The stack trace of the crash is as follows: (gdb) where #0 0x00007ffff74b9d52 in zorba::simplestore::XmlTree::getCollectionId (this=0x201) at /home/mbrantner/zorba/sandbox/src/store/naive/node_items.cpp:137 #1 0x00007ffff752850f in zorba::simplestore::XmlNode::getCollectionId (this=0x7c3da0) at /home/mbrantner/zorba/sandbox/src/store/naive/node_items.h:507 #2 0x00007ffff75285c4 in zorba::simplestore::XmlNode::compare2 (this=0x7c3da0, other=0x750d20) at /home/mbrantner/zorba/sandbox/src/store/naive/node_items.h:1598 #3 0x00007ffff75298d2 in zorba::simplestore::StoreNodeSortIterator::ComparisonFunction::operator() (this=0x7fffffffce6f, n1=0x7c3da0, n2=0x750d20) at /home/mbrantner/zorba/sandbox/src/store/naive/node_iterators.h:452 #4 0x00007ffff752afb2 in std::__insertion_sort<__gnu_cxx::__normal_iterator > >, zorba::simplestore::StoreNodeSortIterator::ComparisonFunction> (__first=..., __last=..., __comp=...) at /usr/include/c++/4.6/bits/stl_algo.h:2129 #5 0x00007ffff752a99d in std::__final_insertion_sort<__gnu_cxx::__normal_iterator > >, zorba::simplestore::StoreNodeSortIterator::ComparisonFunction> (__first=..., __last=..., __comp=...) at /usr/include/c++/4.6/bits/stl_algo.h:2201 #6 0x00007ffff752a335 in std::sort<__gnu_cxx::__normal_iterator > >, zorba::simplestore::StoreNodeSortIterator::ComparisonFunction> (__first=..., __last=..., __comp=...) at /usr/include/c++/4.6/bits/stl_algo.h:5447 #7 0x00007ffff752829f in zorba::simplestore::StoreNodeSortOrAtomicIterator::next (this=0x7378b0, result=...) at /home/mbrantner/zorba/sandbox/src/store/naive/node_iterators.cpp:438 #8 0x00007ffff72147d3 in zorba::NodeSortIterator::nextImpl (this=0x761a40, result=..., planState=...) at /home/mbrantner/zorba/sandbox/src/runtime/core/nodeid_iterators.cpp:164 #9 0x00007ffff6fab3a9 in zorba::Batcher::produceNext (this=0x761a40, result=..., planState=...) at /home/mbrantner/zorba/sandbox/src/runtime/base/plan_iterator.h:535 #10 0x00007ffff71a7763 in zorba::PlanIterator::consumeNext (result=..., iter=0x761a40, planState=...) at /home/mbrantner/zorba/sandbox/src/runtime/base/plan_iterator.cpp:109 #11 0x00007ffff71a70f9 in zorba::PlanWrapper::next (this=0x737180, result=...) at /home/mbrantner/zorba/sandbox/src/runtime/api/plan_wrapper.cpp:151 #12 0x00007ffff6a9ee93 in zorba::serializer::serialize (this=0x7fffffffd300, aObject=..., aOStream=..., aHandler=0x0, aEmitAttributes=false) at /home/mbrantner/zorba/sandbox/src/api/serialization/serializer.cpp:2676 #13 0x00007ffff6a9eba9 in zorba::serializer::serialize (this=0x7fffffffd300, aObject=..., aOStream=..., aEmitAttributes=false) at /home/mbrantner/zorba/sandbox/src/api/serialization/serializer.cpp:2625 #14 0x00007ffff6a384ff in zorba::XQueryImpl::serialize (this=0x718710, os=..., aWrapper=..., opt=0x7fffffffd6d0) at /home/mbrantner/zorba/sandbox/src/api/xqueryimpl.cpp:1336 #15 0x00007ffff6a3776a in zorba::XQueryImpl::execute (this=0x718710, os=..., opt=0x7fffffffd6d0) at /home/mbrantner/zorba/sandbox/src/api/xqueryimpl.cpp:1162 #16 0x00000000004164a9 in compileAndExecute (zorbaInstance=0x7ffff7dd1d60, properties=..., staticContext=..., qfilepath=..., qfile=..., outputStream=..., timing=...) at /home/mbrantner/zorba/sandbox/bin/zorbacmd.cpp:853 #17 0x0000000000417ae6 in main (argc=4, argv=0x7fffffffe538) at /home/mbrantner/zorba/sandbox/bin/zorbacmd.cpp:1178