FAQ
Greetings,
I have a problem using mysql++(2.0.6) with vs.net 2003 on windows xp, if
I'm starting my program (or an example like resetdb.cpp) in the integrated
debugger of vs.net 2003, I get an assertion at the scope-end of an
mysqlpp::Query object.

You can see the callstack here:
---
test.exe!_CrtIsValidHeapPointer(const void * pUserData=0x004958d8) Zeile
1807 C
test.exe!_free_dbg_lk(void * pUserData=0x004958d8, int nBlockUse=1) Zeile
1132 + 0x9 C
test.exe!_free_dbg(void * pUserData=0x004958d8, int nBlockUse=1) Zeile
1070 + 0xd C
test.exe!free(void * pUserData=0x004958d8) Zeile 1025 + 0xb C
test.exe!std::_DebugHeapDelete<std::locale>(std::locale *
_Ptr=0x004958d8) Zeile 63 + 0x9 C++
test.exe!std::basic_streambuf<char,std::char_traits<char>
::~basic_streambuf<char,std::char_traits<char> >() Zeile 39 + 0xc C++
test.exe!std::basic_stringbuf<char,std::char_traits<char>,std::allocator<char>
::~basic_stringbuf<char,std::char_traits<char>,std::allocator<char> >()
Zeile 40 + 0xf C++
test.exe!mysqlpp::Query::~Query() + 0x4a C++
test.exe!mysqlpp::Query::`vbase destructor'() + 0x2b C++
test.exe!main(int argc=1, char * * argv=0x004a34b0) Zeile 35 + 0x28 C++
test.exe!mainCRTStartup() Zeile 259 + 0x19 C
---
(test.exe is the compiled sample1.cpp in debug mode)

compiler flags:
---
/Od /I "C:\mysql\include" /I "C:\mysql++\include" /D "WIN32" /D "_DEBUG"
/D "_CONSOLE" /D "_MBCS" /Gm /EHsc /RTC1 /MTd /GS /Fo"Debug/"
/Fd"Debug/vc70.pdb" /W3 /nologo /c /Wp64 /ZI /TP
---

linker flags:
---
/OUT:"Debug/test.exe" /INCREMENTAL /NOLOGO /LIBPATH:"C:\mysql\lib\debug"
/LIBPATH:"C:\mysql++\debug" /DEBUG /PDB:"Debug/test.pdb"
/SUBSYSTEM:CONSOLE /MACHINE:X86 libmysql.lib mysqlpp.lib wsock32.lib
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib
shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
"\mysql++\debug\mysqlpp.lib"
---
MySQL version: 4.1.14

Some hints where this problem could come from?

Thanks in advance,
Alexander

Search Discussions

  • Warren Young at Sep 30, 2005 at 9:32 pm

    Alexander Stock wrote:
    I have a problem using mysql++(2.0.6) with vs.net 2003 on windows xp,
    ...and I didn't search the mailing list before asking a question. There
    have been half a dozen threads on this topic in recent months.
    test.exe!_CrtIsValidHeapPointer(const void * pUserData=0x004958d8)
    You're almost certainly linking a debug version of your program to the
    release version of MySQL++. If you do this, VC++'s heap debugging
    routines become confused.
  • Alexander Stock at Sep 30, 2005 at 10:07 pm

    ...and I didn't search the mailing list before asking a question. There
    have been half a dozen threads on this topic in recent months.
    Your right, sorry about that. But unfortunately the other threads
    contained no solution for my problem.
    You're almost certainly linking a debug version of your program to the
    release version of MySQL++. If you do this, VC++'s heap debugging
    routines become confused.
    No, I'm not doing so (you can see it in my linker-flags also):
    ---
    /OUT:"Debug/test.exe" /INCREMENTAL /NOLOGO /LIBPATH:"C:\mysql\lib\debug" /
    LIBPATH:"C:\mysql++\debug" /DEBUG /PDB:"Debug/test.pdb" /SUBSYSTEM:CONSOLE
    /
    MACHINE:X86 libmysql.lib mysqlpp.lib wsock32.lib kernel32.lib user32.lib
    gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib
    oleaut32.lib uuid.lib odbc32.lib odbccp32.lib "\mysql++\debug\mysqlpp.lib"

    Greetings,
    Alexander
  • Alexander Stock at Sep 30, 2005 at 10:28 pm
    Another small note:
    If I run the release version (with the release version of mysql++) in the
    debugger I get an exception too:

    Output:
    HEAP[test.exe]: Invalid Address specified to RtlFreeHeap( 003A0000,
    003929C8 )

    Callstack:
    ntdll.dll!7c911230()
    ntdll.dll!7c97c943()
    ntdll.dll!7c97cd80()
    ntdll.dll!7c97df66()
    ntdll.dll!7c97e0f0()
    ntdll.dll!7c97e0d4()
    ntdll.dll!7c95a5d0()
    ntdll.dll!7c95a5d0()
    ntdll.dll!7c936abe()
    ntdll.dll!7c9206eb()
    mysqlpp.dll!00335c99()
    ntdll.dll!7c9206eb()
    mysqlpp.dll!00335c94()
    mysqlpp.dll!00335c99()
    ntdll.dll!7c9368ad()
    ntdll.dll!7c9368ad()
    ntdll.dll!7c92056d()
    test.exe!_write(int fh=3801088, const void * buf=0x00000000, unsigned int
    cnt=3746248) Zeile 91 + 0x5 C
    test.exe!free(void * pBlock=0x003929c8) Zeile 103 C
    test.exe!std::basic_streambuf<char,std::char_traits<char>
    ::~basic_streambuf<char,std::char_traits<char> >() Zeile 39 + 0x57 C++
    test.exe!mysqlpp::Query::~Query() + 0x40 C++
    test.exe!main(int argc=1, char * * argv=0x003a3478) Zeile 35 + 0x3c C++
    test.exe!mainCRTStartup() Zeile 259 + 0x12 C
    kernel32.dll!7c816d4f()
    ntdll.dll!7c925b4f()
    kernel32.dll!7c8399f3()

    Greetings,
    Alexander
  • Patrick McMichael at Oct 1, 2005 at 3:15 pm
    Alexander,
    Just a guess, but I'm thinking you're not supposed to run the
    release version in the debugger. If you want to debug, compile and build
    the debug version and use it.

    -Patrick

    -----Original Message-----
    From: Alexander Stock
    Sent: Friday, September 30, 2005 6:29 PM
    To: plusplus@lists.mysql.com
    Subject: Re: MySQL++(2.0.6) debug assertion failure

    Another small note:
    If I run the release version (with the release version of mysql++) in the
    debugger I get an exception too:

    Output:
    HEAP[test.exe]: Invalid Address specified to RtlFreeHeap( 003A0000,
    003929C8 )

    Callstack:
    ntdll.dll!7c911230()
    ntdll.dll!7c97c943()
    ntdll.dll!7c97cd80()
    ntdll.dll!7c97df66()
    ntdll.dll!7c97e0f0()
    ntdll.dll!7c97e0d4()
    ntdll.dll!7c95a5d0()
    ntdll.dll!7c95a5d0()
    ntdll.dll!7c936abe()
    ntdll.dll!7c9206eb()
    mysqlpp.dll!00335c99()
    ntdll.dll!7c9206eb()
    mysqlpp.dll!00335c94()
    mysqlpp.dll!00335c99()
    ntdll.dll!7c9368ad()
    ntdll.dll!7c9368ad()
    ntdll.dll!7c92056d()
    test.exe!_write(int fh=3801088, const void * buf=0x00000000, unsigned int
    cnt=3746248) Zeile 91 + 0x5 C
    test.exe!free(void * pBlock=0x003929c8) Zeile 103 C
    test.exe!std::basic_streambuf<char,std::char_traits<char>
    ::~basic_streambuf<char,std::char_traits<char> >() Zeile 39 + 0x57 C++
    test.exe!mysqlpp::Query::~Query() + 0x40 C++
    test.exe!main(int argc=1, char * * argv=0x003a3478) Zeile 35 + 0x3c C++
    test.exe!mainCRTStartup() Zeile 259 + 0x12 C
    kernel32.dll!7c816d4f()
    ntdll.dll!7c925b4f()
    kernel32.dll!7c8399f3()

    Greetings,
    Alexander
  • Alexander Stock at Oct 1, 2005 at 3:49 pm

    Alexander,
    Just a guess, but I'm thinking you're not supposed to run the
    release version in the debugger. If you want to debug, compile and build
    the debug version and use it.

    -Patrick
    Patrick,
    you know that its possible to run every executable in the debugger? With-
    or without integrated debug symbols, and
    _without_ problems? Thats nonsense. Somewhere is an error, dunno if it's
    in mysqlpp or in the shipped STL of VC.NET2003
    (Can't believe that its a mistake of the latter one because it is much
    more tested than mysqlpp).

    Greets,
    Alexander

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupplusplus @
categoriesmysql
postedSep 30, '05 at 10:44a
activeOct 1, '05 at 3:49p
posts6
users3
websitemysql.com
irc#mysql

People

Translate

site design / logo © 2022 Grokbase