[odb-users] Compiling ODB with /MTd
Erez GB
erezgb at walla.com
Thu Mar 13 11:59:47 EDT 2014
<div dir='rtl'><p dir="ltr"><br>Hi Boris,</p><p dir="ltr"><br></p><p dir="ltr">The libodb-sqlite-vc11 project you provide is compiling /MDd in debug (linking to DLL), however our program is compiling /MTd (statically linked).</p><p dir="ltr"><br></p><p dir="ltr">Although the libodb-sqlite-vc11 does compile /MTd, when executing an erase query on our program we get debug heap corruption assert, this seems to be related to the std::string destructor.</p><p dir="ltr"><br></p><p dir="ltr">We tried several compilations options and the problem seems to be exclusively related to libodb-sqlite-vc11, meaning regardless of the compiling options to ODB and SQLite, when the libodb-sqlite-vc11 setting change to /MTd the problem happens.</p><p dir="ltr"><br></p><p dir="ltr">When both the app and the libodb-sqlite-vc11 are compiled /MDd, everything works fine, the erase query is executed and the recordes are erased.</p><p dir="ltr"><br></p><p dir="ltr">Can you please take a look ?</p><p dir="ltr"><br></p><p dir="ltr">Thank you,</p><p dir="ltr">Erez.</p><p dir="ltr"><br></p><p dir="ltr"><br></p><p dir="ltr"><b>Sample code :</b></p><p dir="ltr"><br></p><p dir="ltr">unsigned long long access::object_traits_impl< ::CIndividualFactMainData, id_sqlite >::</p><p dir="ltr">erase_query (database&, const query_base_type& q)</p><p dir="ltr"> {</p><p dir="ltr"> using namespace sqlite;</p><p dir="ltr"><br></p><p dir="ltr"> sqlite::connection& conn (</p><p dir="ltr"> sqlite::transaction::current ().connection ());</p><p dir="ltr"><br></p><p dir="ltr"> std::string text (erase_query_statement);</p><p dir="ltr"> if (!q.empty ())</p><p dir="ltr"> {</p><p dir="ltr"> text += ' ';</p><p dir="ltr"> text += q.clause (); <b><-------------------problem happens here</b></p><p dir="ltr"> }</p><p dir="ltr"><br></p><p dir="ltr"> q.init_parameters ();</p><p dir="ltr"> delete_statement st (</p><p dir="ltr"> conn,</p><p dir="ltr"> text,</p><p dir="ltr"> q.parameters_binding ());</p><p dir="ltr"><br></p><p dir="ltr"> return st.execute ();</p><p dir="ltr"> }</p><p dir="ltr"><br></p><p dir="ltr"><b>Stack Calls :</b></p><p dir="ltr"><br></p><p dir="ltr">><span class="Apple-tab-span" style="white-space:pre"> </span>SQLite_Test_1.exe!_free_dbg_nolock(void * pUserData, int nBlockUse) Line 1424<span class="Apple-tab-span" style="white-space:pre"> </span>C++</p><p dir="ltr"> <span class="Apple-tab-span" style="white-space:pre"> </span>SQLite_Test_1.exe!_free_dbg(void * pUserData, int nBlockUse) Line 1265<span class="Apple-tab-span" style="white-space:pre"> </span>C++</p><p dir="ltr"> <span class="Apple-tab-span" style="white-space:pre"> </span>SQLite_Test_1.exe!operator delete(void * pUserData) Line 54<span class="Apple-tab-span" style="white-space:pre"> </span>C++</p><p dir="ltr"> <span class="Apple-tab-span" style="white-space:pre"> </span>SQLite_Test_1.exe!std::allocator<std::_Container_proxy>::deallocate(std::_Container_proxy * _Ptr, unsigned int __formal) Line 586<span class="Apple-tab-span" style="white-space:pre"> </span>C++</p><p dir="ltr"> <span class="Apple-tab-span" style="white-space:pre"> </span>SQLite_Test_1.exe!std::_String_alloc<0,std::_String_base_types<char,std::allocator<char> > >::_Free_proxy() Line 683<span class="Apple-tab-span" style="white-space:pre"> </span>C++</p><p dir="ltr"> <span class="Apple-tab-span" style="white-space:pre"> </span>SQLite_Test_1.exe!std::_String_alloc<0,std::_String_base_types<char,std::allocator<char> > >::~_String_alloc<0,std::_String_base_types<char,std::allocator<char> > >() Line 656<span class="Apple-tab-span" style="white-space:pre"> </span>C++</p><p dir="ltr"> <span class="Apple-tab-span" style="white-space:pre"> </span>SQLite_Test_1.exe!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >() Line 965<span class="Apple-tab-span" style="white-space:pre"> </span>C++</p><p dir="ltr"> <span class="Apple-tab-span" style="white-space:pre"> </span>SQLite_Test_1.exe!odb::access::object_traits_impl<CIndividualFactMainData,1>::erase_query(odb::database & __formal, const odb::sqlite::query_base & q) Line 1348<span class="Apple-tab-span" style="white-space:pre"> </span>C++</p><p dir="ltr"> <span class="Apple-tab-span" style="white-space:pre"> </span>SQLite_Test_1.exe!odb::database::erase_query<CIndividualFactMainData>(const odb::query<CIndividualFactMainData,odb::sqlite::query_base> & q) Line 470<span class="Apple-tab-span" style="white-space:pre"> </span>C++</p><p dir="ltr"> <span class="Apple-tab-span" style="white-space:pre"> </span>SQLite_Test_1.exe!CIndividualFactsMgr::RemoveFacts(long individualId, const char * factToken, const char * type) Line 179<span class="Apple-tab-span" style="white-space:pre"> </span>C++</p><p dir="ltr"> <span class="Apple-tab-span" style="white-space:pre"> </span>SQLite_Test_1.exe!main(int argc, char * * argv) Line 189<span class="Apple-tab-span" style="white-space:pre"> </span>C++</p><p dir="ltr"> <span class="Apple-tab-span" style="white-space:pre"> </span>SQLite_Test_1.exe!__tmainCRTStartup() Line 240<span class="Apple-tab-span" style="white-space:pre"> </span>C</p><p dir="ltr"> <span class="Apple-tab-span" style="white-space:pre"> </span>SQLite_Test_1.exe!mainCRTStartup() Line 164<span class="Apple-tab-span" style="white-space:pre"> </span>C</p><p dir="ltr"> <span class="Apple-tab-span" style="white-space:pre"> </span>kernel32.dll!7614495d()<span class="Apple-tab-span" style="white-space:pre"> </span>Unknown</p><p dir="ltr"> <span class="Apple-tab-span" style="white-space:pre"> </span>[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]<span class="Apple-tab-span" style="white-space:pre"> </span></p><p dir="ltr"> <span class="Apple-tab-span" style="white-space:pre"> </span>ntdll.dll!770298ee()<span class="Apple-tab-span" style="white-space:pre"> </span>Unknown</p><p dir="ltr"> <span class="Apple-tab-span" style="white-space:pre"> </span>ntdll.dll!770298c4()<span class="Apple-tab-span" style="white-space:pre"> </span>Unknown</p><div><br></div></div><hr><div style="background-color:white;color:black;">Walla! Mail - <a href="http://www.walla.com" style="color:blue">Get your free unlimited mail today</a></div>
More information about the odb-users
mailing list