#include "comdll.h"
IID lib_id = __uuidof( Analysis );
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
HRESULT hr = CoInitialize( NULL );
if( hr != S_OK ) throw exception( "error occurred." );
CComQIPtr< IAnalysis > pEngine;
hr = pEngine.CoCreateInstance( lib_id );
if( hr != S_OK ) throw exception( "error occurred." );
printf( "Test" );
return 0;
}
The debug output looks as follows:
'engine_harness_2.exe': Loaded 'C:\chh\projects
\engine_harness_2\x64\Debug\engine_harness_2.exe', Symbols loaded.
'engine_harness_2.exe': Loaded 'D:\WINDOWS\system32\ntdll.dll', No
symbols loaded.
'engine_harness_2.exe': Loaded 'D:\WINDOWS\system32\kernel32.dll', No
symbols loaded.
'engine_harness_2.exe': Loaded 'D:\WINDOWS\WinSxS
\amd64_Microsoft.VC80.DebugMFC_1fc8b3b9a1e18e3b_8.0.50727.4053_x-
ww_d305190d\mfc80d.dll', Symbols loaded.
'engine_harness_2.exe': Loaded 'D:\WINDOWS\WinSxS
\amd64_Microsoft.VC80.DebugCRT_1fc8b3b9a1e18e3b_8.0.50727.4053_x-
ww_021ea608\msvcr80d.dll', Symbols loaded.
'engine_harness_2.exe': Loaded 'D:\WINDOWS\system32\msvcrt.dll', No
symbols loaded.
'engine_harness_2.exe': Loaded 'D:\WINDOWS\system32\gdi32.dll', No
symbols loaded.
'engine_harness_2.exe': Loaded 'D:\WINDOWS\system32\user32.dll', No
symbols loaded.
'engine_harness_2.exe': Loaded 'D:\WINDOWS\system32\shlwapi.dll', No
symbols loaded.
'engine_harness_2.exe': Loaded 'D:\WINDOWS\system32\advapi32.dll', No
symbols loaded.
'engine_harness_2.exe': Loaded 'D:\WINDOWS\system32\rpcrt4.dll', No
symbols loaded.
'engine_harness_2.exe': Loaded 'D:\WINDOWS\system32\secur32.dll', No
symbols loaded.
'engine_harness_2.exe': Loaded 'D:\WINDOWS\system32\ole32.dll', No
symbols loaded.
'engine_harness_2.exe': Loaded 'D:\WINDOWS\system32\oleaut32.dll', No
symbols loaded.
'engine_harness_2.exe': Loaded 'D:\WINDOWS\system32\imm32.dll', No
symbols loaded.
'engine_harness_2.exe': Loaded 'D:\WINDOWS\WinSxS
\amd64_Microsoft.VC80.MFCLOC_1fc8b3b9a1e18e3b_8.0.50727.4053_x-
ww_3ed5eb6c\mfc80ENU.dll', Binary was not built with debug
information.
'engine_harness_2.exe': Loaded 'D:\WINDOWS\system32\uxtheme.dll', No
symbols loaded.
'engine_harness_2.exe': Loaded 'D:\WINDOWS\system32\msctf.dll', No
symbols loaded.
'engine_harness_2.exe': Loaded 'D:\WINDOWS\system32\clbcatq.dll', No
symbols loaded.
'engine_harness_2.exe': Loaded 'D:\WINDOWS\system32\comres.dll', No
symbols loaded.
'engine_harness_2.exe': Loaded 'D:\WINDOWS\system32\version.dll', No
symbols loaded.
'engine_harness_2.exe': Loaded 'C:\work\Tools32\Bin
\x64\Air.CL2.LossEngineD_x64.dll', Symbols loaded.
'engine_harness_2.exe': Loaded 'D:\WINDOWS\system32\psapi.dll', No
symbols loaded.
'engine_harness_2.exe': Loaded 'C:\work\Tools32\Bin
\x64\AFC_CLD_x64.dll', Symbols loaded.
'engine_harness_2.exe': Loaded 'C:\work\Tools32\Bin
\x64\NSViewsD_x64.dll', Symbols loaded.
'engine_harness_2.exe': Loaded 'C:\work\Tools32\Bin\x64\zlib1.dll',
Binary was not built with debug information.
'engine_harness_2.exe': Loaded 'D:\WINDOWS\WinSxS
\amd64_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.4053_x-
ww_18a05f69\msvcr80.dll', Symbols loaded.
'engine_harness_2.exe': Loaded 'D:\WINDOWS\WinSxS
\amd64_Microsoft.Windows.Common-
Controls_6595b64144ccf1df_5.82.3790.3959_x-ww_AB06DEB0\comctl32.dll',
No symbols loaded.
'engine_harness_2.exe': Loaded 'D:\WINDOWS\WinSxS
\amd64_Microsoft.VC80.DebugCRT_1fc8b3b9a1e18e3b_8.0.50727.4053_x-
ww_021ea608\msvcp80d.dll', Symbols loaded.
'engine_harness_2.exe': Loaded 'D:\WINDOWS\system32\netapi32.dll', No
symbols loaded.
'engine_harness_2.exe': Loaded 'D:\WINDOWS\system32\mpr.dll', No
symbols loaded.
'engine_harness_2.exe': Loaded 'C:\work\Tools32\Bin
\x64\AirDbClasicD_x64.dll', Symbols loaded.
NSVIEWS.DLL Initializing!
AFCD.DLL Initializing!
AIRDBCLASIC.DLL Initializing!
First-chance exception at 0x8018c480 in engine_harness_2.exe:
0xC0000005: Access violation at location 0x000000008018c480.
First-chance exception at 0x8018c480 in engine_harness_2.exe:
0xC0000005: Access violation at location 0x000000008018c480.
First-chance exception at 0x8018c480 in engine_harness_2.exe:
0xC0000005: Access violation at location 0x000000008018c480.
[snip]
The above first-chance exception is repeated endlessly and only
killing the process will stop it.
The next step is to attach WinDbg to the process to hopefully shine
some light on it. Here is what the output looks like:
CommandLine: C:\chh\projects\engine_harness_2\x64\Debug
\engine_harness_2.exe
Symbol search path is: srv*c:\mysymbols*http://msdl.microsoft.com/
download/symbols;C:\WINDOWS\symbols\dll
Executable search path is:
ModLoad: 00000001`40000000 00000001`40021000 engine_harness_2.exe
ModLoad: 00000000`77ec0000 00000000`77ffb000 ntdll.dll
ModLoad: 00000000`77d40000 00000000`77eb3000 D:\WINDOWS
\system32\kernel32.dll
ModLoad: 00000000`781d0000 00000000`784ea000 D:\WINDOWS\WinSxS
\amd64_Microsoft.VC80.DebugMFC_1fc8b3b9a1e18e3b_8.0.50727.4053_x-
ww_D305190D\MFC80D.DLL
ModLoad: 00000000`10200000 00000000`1034e000 D:\WINDOWS\WinSxS
\amd64_Microsoft.VC80.DebugCRT_1fc8b3b9a1e18e3b_8.0.50727.4053_x-
ww_021EA608\MSVCR80D.dll
ModLoad: 000007ff`7fc00000 000007ff`7fc86000 D:\WINDOWS
\system32\msvcrt.dll
ModLoad: 000007ff`7fc90000 000007ff`7fd2c000 D:\WINDOWS
\system32\GDI32.dll
ModLoad: 00000000`77c20000 00000000`77d2c000 D:\WINDOWS
\system32\USER32.dll
ModLoad: 000007ff`7ef60000 000007ff`7effb000 D:\WINDOWS
\system32\SHLWAPI.dll
ModLoad: 000007ff`7fee0000 000007ff`7ffe6000 D:\WINDOWS
\system32\ADVAPI32.dll
ModLoad: 000007ff`7fd30000 000007ff`7fec9000 D:\WINDOWS
\system32\RPCRT4.dll
ModLoad: 000007ff`7e9c0000 000007ff`7e9e2000 D:\WINDOWS
\system32\Secur32.dll
ModLoad: 000007ff`57140000 000007ff`573c5000 D:\WINDOWS
\system32\ole32.dll
ModLoad: 000007ff`7ebc0000 000007ff`7ecd6000 D:\WINDOWS
\system32\OLEAUT32.dll
(78c.1548): Break instruction exception - code 80000003 (first chance)
ntdll!DbgBreakPoint:
00000000`77ef2ab0 cc int 3
0:000> kb
RetAddr : Args to
Child : Call
Site
00000000`77f1bc1c : 00000001`40000000 000007ff`fffde000
00000000`00000000 00000000`00000003 : ntdll!DbgBreakPoint
00000000`77ed585f : 00000000`00000000 00000000`00000000
00000000`00000000 00000000`00000000 : ntdll!LdrpInitializeProcess
+0x18c6
00000000`77ef30b5 : 00000000`00000000 00000000`00000000
00000000`00000000 00000000`00000000 : ntdll!LdrpInitialize+0x18f
00000000`77d59680 : 00000000`00000000 00000000`00000000
00000000`00000000 00000000`00000000 : ntdll!KiUserApcDispatch+0x15
00000000`00000000 : 00000000`00000000 00000000`00000000
00000000`00000000 00000000`00000000 : kernel32!BaseProcessStart
I'm running a x64 process which is build with Debug settings. I do not
have a problem when running in Release mode. My question is, what
would be the next logical step to investigate this problem?
I have to admit I'm fairly new to WinDbg and therefore seeking help.
Thanks in advance,
Christian
For the second problem:
You have just hit the process-initial-breakpoint,
that is expected if you start the process under a user-mode debugger.
You can enter the 'g' command to continue.
--
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"chhenning" <chhe...@gmail.com> wrote in message
news:807dbe35-42b1-4677...@c28g2000vbc.googlegroups.com...
0:000> g
ModLoad: 000007ff`7d500000 000007ff`7d539000 D:\WINDOWS
\system32\IMM32.DLL
ModLoad: 00000000`5d360000 00000000`5d36d000 D:\WINDOWS\WinSxS
\amd64_Microsoft.VC80.MFCLOC_1fc8b3b9a1e18e3b_8.0.50727.4053_x-
ww_3ED5EB6C\MFC80ENU.DLL
ModLoad: 000007ff`77230000 000007ff`772af000 D:\WINDOWS
\system32\uxtheme.dll
ModLoad: 000007ff`7a410000 000007ff`7a4af000 D:\WINDOWS
\system32\MSCTF.dll
ModLoad: 000007ff`7ea10000 000007ff`7eaee000 D:\WINDOWS
\system32\CLBCatQ.DLL
ModLoad: 000007ff`7eaf0000 000007ff`7ebb6000 D:\WINDOWS
\system32\COMRes.dll
ModLoad: 000007ff`7fbf0000 000007ff`7fbfb000 D:\WINDOWS
\system32\VERSION.dll
ModLoad: 00000001`80000000 00000001`8084e000 C:\work\Tools32\Bin
\x64\Air.CL2.LossEngineD_x64.dll
ModLoad: 000007ff`7e380000 000007ff`7e390000 D:\WINDOWS
\system32\PSAPI.DLL
ModLoad: 00000000`02490000 00000000`03766000 C:\work\Tools32\Bin
\x64\AFC_CLD_x64.dll
ModLoad: 00000000`03780000 00000000`037a4000 C:\work\Tools32\Bin
\x64\NSViewsD_x64.dll
ModLoad: 00000000`037c0000 00000000`037d6000 C:\work\Tools32\Bin
\x64\zlib1.dll
ModLoad: 00000000`037f0000 00000000`038b9000 D:\WINDOWS\WinSxS
\amd64_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.4053_x-
ww_18A05F69\MSVCR80.dll
ModLoad: 000007ff`76200000 000007ff`762ef000 D:\WINDOWS\WinSxS
\amd64_Microsoft.Windows.Common-
Controls_6595b64144ccf1df_5.82.3790.3959_x-ww_AB06DEB0\COMCTL32.dll
ModLoad: 00000000`10480000 00000000`105dc000 D:\WINDOWS\WinSxS
\amd64_Microsoft.VC80.DebugCRT_1fc8b3b9a1e18e3b_8.0.50727.4053_x-
ww_021EA608\MSVCP80D.dll
ModLoad: 000007ff`77370000 000007ff`77409000 D:\WINDOWS
\system32\NETAPI32.dll
ModLoad: 000007ff`772d0000 000007ff`772f1000 D:\WINDOWS
\system32\MPR.dll
ModLoad: 00000000`038c0000 00000000`04159000 C:\work\Tools32\Bin
\x64\AirDbClasicD_x64.dll
NSVIEWS.DLL Initializing!
AFCD.DLL Initializing!
AIRDBCLASIC.DLL Initializing!
(1338.6f4): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
00000000`8018c480 ?? ???
0:000> kb
RetAddr : Args to
Child : Call
Site
00000000`10266de5 : 00000000`00000280 000007ff`5719a21a
00000000`00000000 000007ff`57375c80 : 0x8018c480
00000000`10262a04 : 00000001`4001c300 00000001`40013ce0
00000000`00000017 00000000`00000000 : MSVCR80D!DebuggerProbe+0x35
00000000`1023678a : 00000000`00000001 00000000`0012fda0
00000000`00000000 00000000`10230d72 : MSVCR80D!_isatty+0xd4 [f:\dd
\vctools\crt_bld\self_64_amd64\crt\src\isatty.c @ 49]
00000000`10245a76 : 00000000`1033e110 00000000`1033e110
00000000`00000000 00000001`40001622 : MSVCR80D!_stbuf+0x5a [f:\dd
\vctools\crt_bld\self_64_amd64\crt\src\_sftbuf.c @ 69]
*** WARNING: Unable to verify checksum for engine_harness_2.exe
00000001`40001348 : 00000001`40018ad0 00000000`00000001
00000000`0012fda0 00000000`00000000 : MSVCR80D!printf+0xe6 [f:\dd
\vctools\crt_bld\self_64_amd64\crt\src\printf.c @ 61]
00000001`4000544c : 00000001`00000001 00000000`0049aad0
00000000`00000000 00000001`4000666e : engine_harness_2!main+0xe8 [c:
\chh\projects\engine_harness_2\engine_harness_2.cpp @ 23]
00000001`4000529e : 00000000`00000000 00000000`00000000
00000000`00000000 00000000`00000000 : engine_harness_2!
__tmainCRTStartup+0x19c [f:\dd\vctools\crt_bld\self_64_amd64\crt\src
\crtexe.c @ 597]
00000000`77d596ac : 00000000`77d59680 00000000`00000000
00000000`00000000 00000000`0012ffa8 : engine_harness_2!mainCRTStartup
+0xe [f:\dd\vctools\crt_bld\self_64_amd64\crt\src\crtexe.c @ 414]
00000000`00000000 : 00000001`40005290 00000000`00000000
00000000`00000000 00000000`00000000 : kernel32!BaseProcessStart+0x29
I apologize for the bad formating. Please let me know if there is a
better way to post these outputs.
In any event the problem seems to be at MSVCR80D!DebuggerProbe+0x35.
Taking this information I found this on MS, which comes very close to
the problem I have.
The solution pointed out in this bug report is of no help to me since
I don't see what I'm doing wrong. What would you do as the next step?
My next step would be to convince my boss for MS support.
Thanks again for your help,
Christian
Can you post the output of `uf MSVCR80D!DebuggerProbe`
when you experience the problem below ?
I expect that some deteour or code-interception mechanism
has replaces the call to kernel32!RaiseException
with something else.
Because the implementation of `DebuggerProbe`
executes the code within a __try/__except,
if you ignore first chance exceptions the code flow should continue
more or less unmodified.
--
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"chhenning" <chhe...@gmail.com> wrote in message
news:9d0838b4-495c-4fdf...@s17g2000vbs.googlegroups.com...