** Changed in: zorba
     Assignee: (unassigned) => Markos Zaharioudakis (markos-za)

-- 
You received this bug notification because you are a member of Zorba
Coders, which is the registrant for Zorba.
https://bugs.launchpad.net/bugs/1015618

Title:
  Memory Heap error on Windows

Status in Zorba - The XQuery Processor:
  New

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/zorba/+bug/1015618/+subscriptions

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to     : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp

Reply via email to