Code review comment for lp:~zorba-coders/zorba/xml-in-json-indices

Revision history for this message
Till Westmann (tillw) wrote :

When running foaf-json-xml-index-point-maintenance.xq I run into a memory problem:

==13041== Invalid read of size 8
==13041== at 0x5ED4C32: zorba::simplestore::CollectionTreeInfo::getCollection() const (collection_tree_info.h:54)
==13041== by 0x5EC3C45: zorba::simplestore::XmlTree::setCollectionTreeInfo(zorba::simplestore::CollectionTreeInfo*) (node_items.cpp:272)
==13041== by 0x5EC5AA2: zorba::simplestore::XmlNode::setCollectionTreeInfo(zorba::simplestore::CollectionTreeInfo*) (node_items.cpp:939)
==13041== by 0x5F81BFB: zorba::simplestore::json::SimpleJSONObject::setCollectionTreeInfo(zorba::simplestore::CollectionTreeInfo*) (json_items.cpp:505)
==13041== by 0x5F802D5: zorba::simplestore::json::JSONItem::detachFromCollection() (json_items.cpp:165)
==13041== by 0x5F18251: zorba::simplestore::SimpleCollection::removeNode(zorba::store::Item*, zorba::IntegerImpl<long long>&) (simple_collection.cpp:271)
==13041== by 0x5F08680: zorba::simplestore::UpdDeleteNodesFromCollection::apply() (pul_primitives.cpp:1280)
==13041== by 0x5F4A797: zorba::simplestore::applyList(std::vector<zorba::simplestore::UpdatePrimitive*, std::allocator<zorba::simplestore::UpdatePrimitive*> >&) (simple_pul.cpp:73)
==13041== by 0x5F59674: zorba::simplestore::CollectionPul::applyUpdates() (simple_pul.cpp:3528)
==13041== by 0x5F54319: zorba::simplestore::PULImpl::applyUpdates(bool) (simple_pul.cpp:2471)
==13041== by 0x5BAE9C7: zorba::apply_updates(zorba::CompilerCB*, zorba::dynamic_context*, zorba::static_context*, zorba::store::PUL*, zorba::QueryLoc const&) (apply_updates.cpp:203)
==13041== by 0x5BAE34F: zorba::ApplyIterator::nextImpl(zorba::store::ItemHandle<zorba::store::Item>&, zorba::PlanState&) const (apply_updates.cpp:124)
==13041== Address 0xaec5090 is 0 bytes inside a block of size 32 free'd
==13041== at 0x4C2A4BC: operator delete(void*) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==13041== by 0x5F802B7: zorba::simplestore::json::JSONItem::detachFromCollection() (json_items.cpp:164)
==13041== by 0x5F18251: zorba::simplestore::SimpleCollection::removeNode(zorba::store::Item*, zorba::IntegerImpl<long long>&) (simple_collection.cpp:271)
==13041== by 0x5F08680: zorba::simplestore::UpdDeleteNodesFromCollection::apply() (pul_primitives.cpp:1280)
==13041== by 0x5F4A797: zorba::simplestore::applyList(std::vector<zorba::simplestore::UpdatePrimitive*, std::allocator<zorba::simplestore::UpdatePrimitive*> >&) (simple_pul.cpp:73)
==13041== by 0x5F59674: zorba::simplestore::CollectionPul::applyUpdates() (simple_pul.cpp:3528)
==13041== by 0x5F54319: zorba::simplestore::PULImpl::applyUpdates(bool) (simple_pul.cpp:2471)
==13041== by 0x5BAE9C7: zorba::apply_updates(zorba::CompilerCB*, zorba::dynamic_context*, zorba::static_context*, zorba::store::PUL*, zorba::QueryLoc const&) (apply_updates.cpp:203)
==13041== by 0x5BAE34F: zorba::ApplyIterator::nextImpl(zorba::store::ItemHandle<zorba::store::Item>&, zorba::PlanState&) const (apply_updates.cpp:124)
==13041== by 0x5BB16D0: zorba::Batcher<zorba::ApplyIterator>::produceNext(zorba::store::ItemHandle<zorba::store::Item>&, zorba::PlanState&) const (plan_iterator.h:535)
==13041== by 0x5B993EA: zorba::PlanIterator::consumeNext(zorba::store::ItemHandle<zorba::store::Item>&, zorba::PlanIterator const*, zorba::PlanState&) (plan_iterator.cpp:109)
==13041== by 0x5CE9D72: zorba::SequentialIterator::nextImpl(zorba::store::ItemHandle<zorba::store::Item>&, zorba::PlanState&) const (scripting.cpp:96)
==13041==
==13041== Invalid read of size 8
==13041== at 0x5ED4C7C: zorba::simplestore::CollectionTreeInfo::getRoot() const (collection_tree_info.h:74)
==13041== by 0x5EC3C5A: zorba::simplestore::XmlTree::setCollectionTreeInfo(zorba::simplestore::CollectionTreeInfo*) (node_items.cpp:273)
==13041== by 0x5EC5AA2: zorba::simplestore::XmlNode::setCollectionTreeInfo(zorba::simplestore::CollectionTreeInfo*) (node_items.cpp:939)
==13041== by 0x5F81BFB: zorba::simplestore::json::SimpleJSONObject::setCollectionTreeInfo(zorba::simplestore::CollectionTreeInfo*) (json_items.cpp:505)
==13041== by 0x5F802D5: zorba::simplestore::json::JSONItem::detachFromCollection() (json_items.cpp:165)
==13041== by 0x5F18251: zorba::simplestore::SimpleCollection::removeNode(zorba::store::Item*, zorba::IntegerImpl<long long>&) (simple_collection.cpp:271)
==13041== by 0x5F08680: zorba::simplestore::UpdDeleteNodesFromCollection::apply() (pul_primitives.cpp:1280)
==13041== by 0x5F4A797: zorba::simplestore::applyList(std::vector<zorba::simplestore::UpdatePrimitive*, std::allocator<zorba::simplestore::UpdatePrimitive*> >&) (simple_pul.cpp:73)
==13041== by 0x5F59674: zorba::simplestore::CollectionPul::applyUpdates() (simple_pul.cpp:3528)
==13041== by 0x5F54319: zorba::simplestore::PULImpl::applyUpdates(bool) (simple_pul.cpp:2471)
==13041== by 0x5BAE9C7: zorba::apply_updates(zorba::CompilerCB*, zorba::dynamic_context*, zorba::static_context*, zorba::store::PUL*, zorba::QueryLoc const&) (apply_updates.cpp:203)
==13041== by 0x5BAE34F: zorba::ApplyIterator::nextImpl(zorba::store::ItemHandle<zorba::store::Item>&, zorba::PlanState&) const (apply_updates.cpp:124)
==13041== Address 0xaec50a8 is 24 bytes inside a block of size 32 free'd
==13041== at 0x4C2A4BC: operator delete(void*) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==13041== by 0x5F802B7: zorba::simplestore::json::JSONItem::detachFromCollection() (json_items.cpp:164)
==13041== by 0x5F18251: zorba::simplestore::SimpleCollection::removeNode(zorba::store::Item*, zorba::IntegerImpl<long long>&) (simple_collection.cpp:271)
==13041== by 0x5F08680: zorba::simplestore::UpdDeleteNodesFromCollection::apply() (pul_primitives.cpp:1280)
==13041== by 0x5F4A797: zorba::simplestore::applyList(std::vector<zorba::simplestore::UpdatePrimitive*, std::allocator<zorba::simplestore::UpdatePrimitive*> >&) (simple_pul.cpp:73)
==13041== by 0x5F59674: zorba::simplestore::CollectionPul::applyUpdates() (simple_pul.cpp:3528)
==13041== by 0x5F54319: zorba::simplestore::PULImpl::applyUpdates(bool) (simple_pul.cpp:2471)
==13041== by 0x5BAE9C7: zorba::apply_updates(zorba::CompilerCB*, zorba::dynamic_context*, zorba::static_context*, zorba::store::PUL*, zorba::QueryLoc const&) (apply_updates.cpp:203)
==13041== by 0x5BAE34F: zorba::ApplyIterator::nextImpl(zorba::store::ItemHandle<zorba::store::Item>&, zorba::PlanState&) const (apply_updates.cpp:124)
==13041== by 0x5BB16D0: zorba::Batcher<zorba::ApplyIterator>::produceNext(zorba::store::ItemHandle<zorba::store::Item>&, zorba::PlanState&) const (plan_iterator.h:535)
==13041== by 0x5B993EA: zorba::PlanIterator::consumeNext(zorba::store::ItemHandle<zorba::store::Item>&, zorba::PlanIterator const*, zorba::PlanState&) (plan_iterator.cpp:109)
==13041== by 0x5CE9D72: zorba::SequentialIterator::nextImpl(zorba::store::ItemHandle<zorba::store::Item>&, zorba::PlanState&) const (scripting.cpp:96)
==13041==

review: Needs Fixing

« Back to merge proposal