Memory Heap error on Windows

Bug #1015618 reported by Rodolfo Ochoa
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zorba
New
High
Markos Zaharioudakis

Bug Description

When I run a query with a namespace added from StaticContext and used in the query, like in this example:

#include <zorba/zorba.h>

int main(int argc, char* argv[])
{
  void* lStore = zorba::StoreManager::getStore();
  zorba::Zorba* lZorba = zorba::Zorba::getInstance(lStore);

  zorba::StaticContext_t lContext = lZorba->createStaticContext();
  lContext->addNamespace("foo", "http://www.foo.com");

  zorba::XQuery_t lQuery = lZorba->compileQuery("<foo:e/>", lContext);
  lQuery->execute(std::cout);

  lQuery->free();
  lContext->free();

  lZorba->shutdown();
  zorba::StoreManager::shutdownStore(lStore);
 return 0;
}

When the program finishes in debug mode I get the error:
Debug error:
HEAP CORRUPTION DETECTED: before Normal block (#103257) at 0x0275D170
CRT detected that the application wrote to memory before start of heap buffer.

This is the call stack:
> msvcr100d.dll!_free_dbg_nolock(void * pUserData, int nBlockUse) Line 1353 + 0x3b bytes C++
  msvcr100d.dll!_free_dbg(void * pUserData, int nBlockUse) Line 1265 + 0xd bytes C++
  msvcr100d.dll!operator delete(void * pUserData) Line 54 + 0x10 bytes C++
  zorba_simplestore.dll!std::allocator<std::_Container_proxy>::deallocate(std::_Container_proxy * _Ptr, unsigned int __formal) Line 182 + 0x9 bytes C++
  zorba_simplestore.dll!std::_String_val<char,std::allocator<char> >::~_String_val<char,std::allocator<char> >() Line 481 C++
  zorba_simplestore.dll!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >() Line 754 + 0xf bytes C++
  zorba_simplestore.dll!zorba::serialization::Archiver::SIMPLE_HASHOUT_FIELD::~SIMPLE_HASHOUT_FIELD() + 0x16 bytes C++
  zorba_simplestore.dll!zorba::HashEntry<zorba::serialization::Archiver::SIMPLE_HASHOUT_FIELD,zorba::serialization::archive_field *>::~HashEntry<zorba::serialization::Archiver::SIMPLE_HASHOUT_FIELD,zorba::serialization::archive_field *>() Line 85 + 0xb bytes C++
  zorba_simplestore.dll!zorba::HashEntry<zorba::serialization::Archiver::SIMPLE_HASHOUT_FIELD,zorba::serialization::archive_field *>::`scalar deleting destructor'() + 0x16 bytes C++
  zorba_simplestore.dll!std::_Destroy<zorba::HashEntry<zorba::serialization::Archiver::SIMPLE_HASHOUT_FIELD,zorba::serialization::archive_field *> >(zorba::HashEntry<zorba::serialization::Archiver::SIMPLE_HASHOUT_FIELD,zorba::serialization::archive_field *> * _Ptr) Line 64 C++
  zorba_simplestore.dll!std::allocator<zorba::HashEntry<zorba::serialization::Archiver::SIMPLE_HASHOUT_FIELD,zorba::serialization::archive_field *> >::destroy(zorba::HashEntry<zorba::serialization::Archiver::SIMPLE_HASHOUT_FIELD,zorba::serialization::archive_field *> * _Ptr) Line 213 + 0x9 bytes C++
  zorba_simplestore.dll!std::_Dest_val<std::allocator<zorba::HashEntry<zorba::serialization::Archiver::SIMPLE_HASHOUT_FIELD,zorba::serialization::archive_field *> >,zorba::HashEntry<zorba::serialization::Archiver::SIMPLE_HASHOUT_FIELD,zorba::serialization::archive_field *> >(std::allocator<zorba::HashEntry<zorba::serialization::Archiver::SIMPLE_HASHOUT_FIELD,zorba::serialization::archive_field *> > & _Alval, zorba::HashEntry<zorba::serialization::Archiver::SIMPLE_HASHOUT_FIELD,zorba::serialization::archive_field *> * _Pdest) Line 288 C++
  zorba_simplestore.dll!std::_Destroy_range<std::allocator<zorba::HashEntry<zorba::serialization::Archiver::SIMPLE_HASHOUT_FIELD,zorba::serialization::archive_field *> > >(zorba::HashEntry<zorba::serialization::Archiver::SIMPLE_HASHOUT_FIELD,zorba::serialization::archive_field *> * _First, zorba::HashEntry<zorba::serialization::Archiver::SIMPLE_HASHOUT_FIELD,zorba::serialization::archive_field *> * _Last, std::allocator<zorba::HashEntry<zorba::serialization::Archiver::SIMPLE_HASHOUT_FIELD,zorba::serialization::archive_field *> > & _Al, std::_Nonscalar_ptr_iterator_tag __formal) Line 97 + 0xd bytes C++
  zorba_simplestore.dll!std::_Destroy_range<std::allocator<zorba::HashEntry<zorba::serialization::Archiver::SIMPLE_HASHOUT_FIELD,zorba::serialization::archive_field *> > >(zorba::HashEntry<zorba::serialization::Archiver::SIMPLE_HASHOUT_FIELD,zorba::serialization::archive_field *> * _First, zorba::HashEntry<zorba::serialization::Archiver::SIMPLE_HASHOUT_FIELD,zorba::serialization::archive_field *> * _Last, std::allocator<zorba::HashEntry<zorba::serialization::Archiver::SIMPLE_HASHOUT_FIELD,zorba::serialization::archive_field *> > & _Al) Line 88 + 0x29 bytes C++
  zorba_simplestore.dll!std::vector<zorba::HashEntry<zorba::serialization::Archiver::SIMPLE_HASHOUT_FIELD,zorba::serialization::archive_field *>,std::allocator<zorba::HashEntry<zorba::serialization::Archiver::SIMPLE_HASHOUT_FIELD,zorba::serialization::archive_field *> > >::_Destroy(zorba::HashEntry<zorba::serialization::Archiver::SIMPLE_HASHOUT_FIELD,zorba::serialization::archive_field *> * _First, zorba::HashEntry<zorba::serialization::Archiver::SIMPLE_HASHOUT_FIELD,zorba::serialization::archive_field *> * _Last) Line 1270 + 0x14 bytes C++
  zorba_simplestore.dll!std::vector<zorba::HashEntry<zorba::serialization::Archiver::SIMPLE_HASHOUT_FIELD,zorba::serialization::archive_field *>,std::allocator<zorba::HashEntry<zorba::serialization::Archiver::SIMPLE_HASHOUT_FIELD,zorba::serialization::archive_field *> > >::_Tidy() Line 1307 C++
  zorba_simplestore.dll!std::vector<zorba::HashEntry<zorba::serialization::Archiver::SIMPLE_HASHOUT_FIELD,zorba::serialization::archive_field *>,std::allocator<zorba::HashEntry<zorba::serialization::Archiver::SIMPLE_HASHOUT_FIELD,zorba::serialization::archive_field *> > >::~vector<zorba::HashEntry<zorba::serialization::Archiver::SIMPLE_HASHOUT_FIELD,zorba::serialization::archive_field *>,std::allocator<zorba::HashEntry<zorba::serialization::Archiver::SIMPLE_HASHOUT_FIELD,zorba::serialization::archive_field *> > >() Line 706 C++
  zorba_simplestore.dll!zorba::checked_vector<zorba::HashEntry<zorba::serialization::Archiver::SIMPLE_HASHOUT_FIELD,zorba::serialization::archive_field *> >::~checked_vector<zorba::HashEntry<zorba::serialization::Archiver::SIMPLE_HASHOUT_FIELD,zorba::serialization::archive_field *> >() + 0x16 bytes C++
  zorba_simplestore.dll!zorba::HashMap<zorba::serialization::Archiver::SIMPLE_HASHOUT_FIELD,zorba::serialization::archive_field *,zorba::serialization::Archiver::SimpleHashoutFieldCompare>::~HashMap<zorba::serialization::Archiver::SIMPLE_HASHOUT_FIELD,zorba::serialization::archive_field *,zorba::serialization::Archiver::SimpleHashoutFieldCompare>() Line 412 + 0x1d bytes C++
  zorba_simplestore.dll!zorba::HashMap<zorba::serialization::Archiver::SIMPLE_HASHOUT_FIELD,zorba::serialization::archive_field *,zorba::serialization::Archiver::SimpleHashoutFieldCompare>::`scalar deleting destructor'() + 0x16 bytes C++
  zorba_simplestore.dll!zorba::serialization::Archiver::~Archiver() Line 173 + 0x25 bytes C++
  zorba_simplestore.dll!zorba::serialization::MemArchiver::~MemArchiver() + 0x51 bytes C++
  zorba_simplestore.dll!zorba::serialization::MemArchiver::`scalar deleting destructor'() + 0x16 bytes C++
  zorba_simplestore.dll!zorba::serialization::ClassSerializer::~ClassSerializer() Line 96 + 0x25 bytes C++
  zorba_simplestore.dll!`zorba::serialization::ClassSerializer::getInstance'::`2'::`dynamic atexit destructor for 'theInstance''() + 0xd bytes C++
  zorba_simplestore.dll!_CRT_INIT(void * hDllHandle, unsigned long dwReason, void * lpreserved) Line 415 C
  zorba_simplestore.dll!__DllMainCRTStartup(void * hDllHandle, unsigned long dwReason, void * lpreserved) Line 526 + 0x11 bytes C
  zorba_simplestore.dll!_DllMainCRTStartup(void * hDllHandle, unsigned long dwReason, void * lpreserved) Line 476 + 0x11 bytes C

Changed in zorba:
assignee: nobody → Markos Zaharioudakis (markos-za)
Changed in zorba:
importance: Undecided → High
tags: added: memory-problems windows
tags: added: store
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.