CWinApp Assertion failure/ Access violation in odbc32.dll
- From: "j.a. harriman" <jeffrey_no_spam_alias@xxxxxxxxxxxxx>
- Date: Wed, 17 Aug 2005 08:58:26 -0700
Visual Studio 6.0 Visual C++ SP6
Operating System: Windows Server 2003 Enterprise SP1
Issue as to why debugging: Access violations in odbc32.dll (version
3.526.1830.0) when executing SQLFetchScroll in a MFC EXE (Using MVF in a
Shared DLL).
What I’m seeing in the debugger: Before the .EXE reaches the main()
function I am seeing ASSERTION failures on the instantiation of a CWinApp
object.
Background: All of the code referenced below is written with Visual Studio
6.0 Visual C++ SP6.
We have several “utility” DLLs that we’ve created. They are MVFC Extension
DLLs that are linked implicitly to our .EXE modules. The DLLs are also
linked implicitly to each other.
I’ve simplified things by using the app wizard to create the same type of
EXE that is having the issue.
I’m only using 2 of our 5 DLLs, FileUtil & GenUtil. FileUtil is implicitly
linked to GenUtil and FileUtil is implicitly linked to GenUtil. Both are
implicitly linked to my EXE.
In the GenUtil class an instance of FileUtil is created.
In the Genutil.h file – please note there is more to the class than listed
below:
#ifdef EXPORT_GENUTIL
#define IMPORT_OR_EXPORT_GENUTIL __declspec(dllexport)
#else
#define IMPORT_OR_EXPORT_GENUTIL __declspec(dllimport)
#endif
class IMPORT_OR_EXPORT_GENUTIL GenUtil : public CWinApp
{
public:
FileUtil file_name;
}
The stack when the ASSERTION failure occurs:
MFC42D.DLL!CWinApp::CWinApp(const char * lpszAppName=0x00000000) Line 85 +
0x19 C++
FileUtil.dll!FileUtil::FileUtil() Line 27 + 0x2f C++
GenUtil.dll!GenUtil::GenUtil() Line 29 + 0xa9 C++
FileUtil.dll!$E291() Line 21 + 0x11 C++
FileUtil.dll!$E294() + 0x8 C++
MSVCRTD.DLL!_initterm(void (void)* * pfbegin=0x10008008, void (void)* *
pfend=0x1000800c) Line 525 C
FileUtil.dll!_CRT_INIT(void * hDllHandle=0x10000000, unsigned long
dwReason=0x00000001, void * lpreserved=0x0012fd28) Line 184 + 0xf C
FileUtil.dll!_DllMainCRTStartup(void * hDllHandle=0x10000000, unsigned long
dwReason=0x00000001, void * lpreserved=0x0012fd28) Line 267 + 0x11 C
ntdll.dll!_LdrpCallInitRoutine@16() + 0x14
ntdll.dll!_LdrpRunInitializeRoutines@4() - 0xa4
ntdll.dll!_LdrpInitializeProcess@8() - 0x185
ntdll.dll!__LdrpInitialize@12() - 0xc7cc
ntdll.dll!_KiUserApcDispatcher@16() + 0x25
The ASSERTION failure seems to occur when the FileUtil Constructor is called
– I assume when the GenUtil class is instantiated.
- this 0x10009010 {CWinApp <Bad Ptr>} CWinApp * const
If I choose to ABORT the first ASSERTION failure, I get the following dump:
'Jeff_Test4.exe': Loaded 'E:\Jeff_Test4\Debug\Jeff_Test4.exe', Symbols loaded.
'Jeff_Test4.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', Symbols loaded.
'Jeff_Test4.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', Symbols loaded.
'Jeff_Test4.exe': Loaded 'E:\Jeff_Test4\Debug\FileUtil.dll', Symbols loaded.
'Jeff_Test4.exe': Loaded 'E:\Jeff_Test4\Debug\GenUtil.dll', Symbols loaded.
'Jeff_Test4.exe': Loaded 'C:\WINDOWS\system32\MFC42D.DLL', Symbols loaded.
'Jeff_Test4.exe': Loaded 'C:\WINDOWS\system32\MSVCRTD.DLL', Symbols loaded.
'Jeff_Test4.exe': Loaded 'C:\WINDOWS\system32\gdi32.dll', Symbols loaded.
'Jeff_Test4.exe': Loaded 'C:\WINDOWS\system32\advapi32.dll', Symbols loaded.
'Jeff_Test4.exe': Loaded 'C:\WINDOWS\system32\rpcrt4.dll', Symbols loaded.
'Jeff_Test4.exe': Loaded 'C:\WINDOWS\system32\user32.dll', Symbols loaded.
'Jeff_Test4.exe': Loaded 'C:\WINDOWS\system32\winspool.drv', Symbols loaded.
'Jeff_Test4.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll', Symbols loaded.
'Jeff_Test4.exe': Loaded 'C:\WINDOWS\system32\MSVCIRTD.DLL', Symbols loaded.
'Jeff_Test4.exe': Loaded 'C:\WINDOWS\system32\MSVCP60D.DLL', Symbols loaded.
'Jeff_Test4.exe': Loaded 'C:\WINDOWS\system32\uxtheme.dll', Symbols loaded.
'Jeff_Test4.exe': Loaded 'C:\WINDOWS\system32\msctf.dll', Symbols loaded.
'Jeff_Test4.exe': Loaded 'C:\WINDOWS\system32\mslbui.dll', Symbols loaded.
'Jeff_Test4.exe': Loaded 'C:\WINDOWS\system32\oleaut32.dll', Symbols loaded.
'Jeff_Test4.exe': Loaded 'C:\WINDOWS\system32\ole32.dll', Symbols loaded.
Detected memory leaks!
Dumping objects ->
{47} client block at 0x00332440, subtype 0, 64 bytes long.
a CDynLinkLibrary object at $00332440, 64 bytes long
Object dump complete.
The program '[872] Jeff_Test4.exe: Native' has exited with code 3 (0x3).
- this 0x10009010 {CWinApp <Bad Ptr>} CWinApp * const
I am questioning if I am looking in the right place - are these issues
causing memory corruption (showing up in the odbc32.dll calls) or is this
something that can be ignored??
Thanks.
.
- Follow-Ups:
- RE: CWinApp Assertion failure/ Access violation in odbc32.dll
- From: "Gary Chang[MSFT]"
- RE: CWinApp Assertion failure/ Access violation in odbc32.dll
- Prev by Date: Re: Dynamically Set Menu Item Text
- Next by Date: Re: Reflection problem when changing parent window
- Previous by thread: APDOI: Text atop CFileDialog
- Next by thread: RE: CWinApp Assertion failure/ Access violation in odbc32.dll
- Index(es):
Relevant Pages
|