[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&nbsp;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&nbsp;libodb-sqlite-vc11 does compile &nbsp;/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&lt; ::CIndividualFactMainData, id_sqlite &gt;::</p><p dir="ltr">erase_query (database&amp;, const query_base_type&amp; q)</p><p dir="ltr">&nbsp; {</p><p dir="ltr">&nbsp; &nbsp; using namespace sqlite;</p><p dir="ltr"><br></p><p dir="ltr">&nbsp; &nbsp; sqlite::connection&amp; conn (</p><p dir="ltr">&nbsp; &nbsp; &nbsp; sqlite::transaction::current ().connection ());</p><p dir="ltr"><br></p><p dir="ltr">&nbsp; &nbsp; std::string text (erase_query_statement);</p><p dir="ltr">&nbsp; &nbsp; if (!q.empty ())</p><p dir="ltr">&nbsp; &nbsp; {</p><p dir="ltr">&nbsp; &nbsp; &nbsp; text += ' ';</p><p dir="ltr">&nbsp; &nbsp; &nbsp; text += q.clause (); <b>&lt;-------------------problem happens here</b></p><p dir="ltr">&nbsp; &nbsp; }</p><p dir="ltr"><br></p><p dir="ltr">&nbsp; &nbsp; q.init_parameters ();</p><p dir="ltr">&nbsp; &nbsp; delete_statement st (</p><p dir="ltr">&nbsp; &nbsp; &nbsp; conn,</p><p dir="ltr">&nbsp; &nbsp; &nbsp; text,</p><p dir="ltr">&nbsp; &nbsp; &nbsp; q.parameters_binding ());</p><p dir="ltr"><br></p><p dir="ltr">&nbsp; &nbsp; return st.execute ();</p><p dir="ltr">&nbsp; }</p><p dir="ltr"><br></p><p dir="ltr"><b>Stack Calls :</b></p><p dir="ltr"><br></p><p dir="ltr">&gt;<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">&nbsp;<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">&nbsp;<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">&nbsp;<span class="Apple-tab-span" style="white-space:pre">	</span>SQLite_Test_1.exe!std::allocator&lt;std::_Container_proxy&gt;::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">&nbsp;<span class="Apple-tab-span" style="white-space:pre">	</span>SQLite_Test_1.exe!std::_String_alloc&lt;0,std::_String_base_types&lt;char,std::allocator&lt;char&gt; &gt; &gt;::_Free_proxy() Line 683<span class="Apple-tab-span" style="white-space:pre">	</span>C++</p><p dir="ltr">&nbsp;<span class="Apple-tab-span" style="white-space:pre">	</span>SQLite_Test_1.exe!std::_String_alloc&lt;0,std::_String_base_types&lt;char,std::allocator&lt;char&gt; &gt; &gt;::~_String_alloc&lt;0,std::_String_base_types&lt;char,std::allocator&lt;char&gt; &gt; &gt;() Line 656<span class="Apple-tab-span" style="white-space:pre">	</span>C++</p><p dir="ltr">&nbsp;<span class="Apple-tab-span" style="white-space:pre">	</span>SQLite_Test_1.exe!std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt;::~basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt;() Line 965<span class="Apple-tab-span" style="white-space:pre">	</span>C++</p><p dir="ltr">&nbsp;<span class="Apple-tab-span" style="white-space:pre">	</span>SQLite_Test_1.exe!odb::access::object_traits_impl&lt;CIndividualFactMainData,1&gt;::erase_query(odb::database &amp; __formal, const odb::sqlite::query_base &amp; q) Line 1348<span class="Apple-tab-span" style="white-space:pre">	</span>C++</p><p dir="ltr">&nbsp;<span class="Apple-tab-span" style="white-space:pre">	</span>SQLite_Test_1.exe!odb::database::erase_query&lt;CIndividualFactMainData&gt;(const odb::query&lt;CIndividualFactMainData,odb::sqlite::query_base&gt; &amp; q) Line 470<span class="Apple-tab-span" style="white-space:pre">	</span>C++</p><p dir="ltr">&nbsp;<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">&nbsp;<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">&nbsp;<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">&nbsp;<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">&nbsp;<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">&nbsp;<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">&nbsp;<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">&nbsp;<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