none
Release mode application throws Break instruction exception - code 80000003 when running in WinDbg

    Question

  • Here is the initial output of my program after running it from WinDbg:

    CommandLine: "C:\Documents and Settings\Administrator\My Documents\Work\QMI_Test_Tool\QMI_UT_Source\Release\QMI Validation Tool.exe"
    Symbol search path is: SRV*c:\symbols*http://msdl.microsoft.com/download/symbols
    Executable search path is: 
    ModLoad: 00400000 0048f000  QMI Validation Tool.exe
    ModLoad: 7c900000 7c9b2000  ntdll.dll
    ModLoad: 79000000 7904a000  C:\WINDOWS\system32\mscoree.dll
    ModLoad: 7c800000 7c8f6000  C:\WINDOWS\system32\KERNEL32.dll
    ModLoad: 77dd0000 77e6b000  C:\WINDOWS\system32\advapi32.dll
    ModLoad: 77e70000 77f03000  C:\WINDOWS\system32\RPCRT4.dll
    ModLoad: 77fe0000 77ff1000  C:\WINDOWS\system32\Secur32.dll
    ModLoad: 7c420000 7c4a7000  C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.4053_x-ww_e6967989\MSVCP80.dll
    ModLoad: 78130000 781cb000  C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.4053_x-ww_e6967989\MSVCR80.dll
    ModLoad: 77c10000 77c68000  C:\WINDOWS\system32\msvcrt.dll
    ModLoad: 7c9c0000 7d1d7000  C:\WINDOWS\system32\SHELL32.dll
    ModLoad: 77f10000 77f59000  C:\WINDOWS\system32\GDI32.dll
    ModLoad: 7e410000 7e4a1000  C:\WINDOWS\system32\USER32.dll
    ModLoad: 77f60000 77fd6000  C:\WINDOWS\system32\SHLWAPI.dll
    ModLoad: 7c4c0000 7c53d000  C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.4053_x-ww_e6967989\msvcm80.dll
    ModLoad: 774e0000 7761d000  C:\WINDOWS\system32\ole32.dll
    (8d8.c78): Break instruction exception - code 80000003 (first chance)
    eax=00251eb4 ebx=7ffd4000 ecx=00000006 edx=00000040 esi=00251f48 edi=00251eb4
    eip=7c90120e esp=0012fb20 ebp=0012fc94 iopl=0     nv up ei pl nz na po nc
    cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000       efl=00000202
    ntdll!DbgBreakPoint:
    7c90120e cc       int   3

    I click Go Unhandled Exception from inside WinDbg

    (8d8.c78): Break instruction exception - code 80000003 (first chance)
    eax=0012fc54 ebx=00000000 ecx=0012fca8 edx=7c90e514 esi=80000003 edi=00000000
    eip=7c9666c5 esp=0012fc54 ebp=0012fca4 iopl=0     nv up ei pl zr na pe nc
    cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000       efl=00000246
    ntdll!RtlRaiseStatus+0x25:
    7c9666c5 ffc9      dec   ecx

    After this I click Go Handled exception:

    0:000> gh
    WARNING: Continuing a non-continuable exception
    (8d8.c78): Access violation - code c0000005 (first chance)
    First chance exceptions are reported before any exception handling.
    This exception may be expected and handled.
    eax=0012fc54 ebx=00000000 ecx=0012fca7 edx=7c90e514 esi=80000003 edi=00000000
    eip=80000003 esp=0012fc5c ebp=0012fca4 iopl=0     nv up ei pl nz na po nc
    cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000       efl=00010202
    80000003 ??       ???
    

    The app is launched from the command line but it seems like it fails even during the application load stage. My main function looks like this:

    int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
    {
     try
     {
    	System::Threading::Thread::CurrentThread->ApartmentState = System::Threading::ApartmentState::STA;
    	Form1 *frm = new Form1();
    	Application::Run(frm);
    	return 0;
     }
     catch (Exception *e)
     {
    	MessageBox::Show(e->ToString(), "Validation Tool");
    	return -1;
     }
    }
    Is there a way to debug such a problem? I need some help urgently on this issue. Thank you all in advance.

     

    • Moved by Edwer Fang Monday, September 27, 2010 4:59 AM (From:.NET Framework Setup)
    Wednesday, September 22, 2010 6:08 PM

All replies

  • I tried to run this application again - it hung up - shows up in the Task Manager as an .exe with 20 threads running. I am not getting any response. However, I tried the following from WinDbg

    1. After application failed to respond, used WinDbg to attach itself to the process

    Microsoft (R) Windows Debugger Version 6.12.0002.633 X86
    Copyright (c) Microsoft Corporation. All rights reserved.

    *** wait with pending attach
    Symbol search path is: SRV*c:\symbols*http://msdl.microsoft.com/download/symbols
    Executable search path is:
    ModLoad: 00400000 0048f000   C:\Documents and Settings\Administrator\My Documents\Test_Tool\Sample Scenarios\demo\Validation Tool.exe
    ModLoad: 7c900000 7c9b2000   C:\WINDOWS\system32\ntdll.dll
    ModLoad: 79000000 7904a000   C:\WINDOWS\system32\mscoree.dll
    ModLoad: 7c800000 7c8f6000   C:\WINDOWS\system32\KERNEL32.dll
    ModLoad: 77dd0000 77e6b000   C:\WINDOWS\system32\advapi32.dll
    ModLoad: 77e70000 77f03000   C:\WINDOWS\system32\RPCRT4.dll
    ModLoad: 77fe0000 77ff1000   C:\WINDOWS\system32\Secur32.dll
    ModLoad: 7c420000 7c4a7000   C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.4053_x-ww_e6967989\MSVCP80.dll
    ModLoad: 78130000 781cb000   C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.4053_x-ww_e6967989\MSVCR80.dll
    ModLoad: 77c10000 77c68000   C:\WINDOWS\system32\msvcrt.dll
    ModLoad: 7c9c0000 7d1d7000   C:\WINDOWS\system32\SHELL32.dll
    ModLoad: 77f10000 77f59000   C:\WINDOWS\system32\GDI32.dll
    ModLoad: 7e410000 7e4a1000   C:\WINDOWS\system32\USER32.dll
    ModLoad: 77f60000 77fd6000   C:\WINDOWS\system32\SHLWAPI.dll
    ModLoad: 7c4c0000 7c53d000   C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.4053_x-ww_e6967989\msvcm80.dll
    ModLoad: 774e0000 7761d000   C:\WINDOWS\system32\ole32.dll
    ModLoad: 76390000 763ad000   C:\WINDOWS\system32\IMM32.DLL
    ModLoad: 773d0000 774d3000   C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.5512_x-ww_35d4ce83\comctl32.dll
    ModLoad: 5d090000 5d12a000   C:\WINDOWS\system32\comctl32.dll
    ModLoad: 603b0000 60416000   C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\mscoreei.dll
    ModLoad: 79e70000 7a400000   C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
    ModLoad: 790c0000 79bb8000   C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\mscorlib\7bffd7ff2009f421fe5d229927588496\mscorlib.ni.dll
    ModLoad: 79060000 790bb000   C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorjit.dll
    ModLoad: 68000000 68036000   C:\WINDOWS\system32\rsaenh.dll
    ModLoad: 7a440000 7abd8000   C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\System\08ffa4d388d5f007869aa7651c458e7c\System.ni.dll
    ModLoad: 7ade0000 7af68000   C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\System.Drawing\dcc0244092fe52e6885b50be25ef3b31\System.Drawing.ni.dll
    ModLoad: 7afd0000 7bbae000   C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\System.Windows.Forms\439c466b60614915587c5273eaf0ca7f\System.Windows.Forms.ni.dll
    ModLoad: 637a0000 63cd6000   C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\System.Xml\a6dbe24cbfe3ab6b318ed3095cc572d8\System.Xml.ni.dll
    ModLoad: 00df0000 00dfe000   C:\Documents and Settings\Administrator\My Documents\Test_Tool\Sample Scenarios\demo\AdapterEnumerator.dll
    ModLoad: 5ad70000 5ada8000   C:\WINDOWS\system32\uxtheme.dll
    ModLoad: 74720000 7476c000   C:\WINDOWS\system32\MSCTF.dll
    ModLoad: 4ec50000 4edfb000   C:\WINDOWS\WinSxS\x86_Microsoft.Windows.GdiPlus_6595b64144ccf1df_1.0.6001.22319_x-ww_f0b4c2df\gdiplus.dll
    ModLoad: 755c0000 755ee000   C:\WINDOWS\system32\msctfime.ime
    ModLoad: 77920000 77a13000   C:\WINDOWS\system32\setupapi.dll
    (920.934): Break instruction exception - code 80000003 (first chance)
    eax=7ffda000 ebx=00000001 ecx=00000002 edx=00000003 esi=00000004 edi=00000005
    eip=7c90120e esp=00bdffcc ebp=00bdfff4 iopl=0         nv up ei pl zr na pe nc
    cs=001b  ss=0023  ds=0023  es=0023  fs=0038  gs=0000             efl=00000246
    ntdll!DbgBreakPoint:
    7c90120e cc              int     3

    2. Issued ~* at the command to see all currently running threads

    0:019> ~*
       0  Id: 920.ea0 Suspend: 1 Teb: 7ffdf000 Unfrozen
          Start: mscoree!_CorExeMain_Exported (79004ddb)
          Priority: 0  Priority class: 32  Affinity: 3
       1  Id: 920.f70 Suspend: 1 Teb: 7ffde000 Unfrozen
          Start: KERNEL32!BaseThreadStartThunk (7c8106f9)
          Priority: 0  Priority class: 32  Affinity: 3
       2  Id: 920.8ac Suspend: 1 Teb: 7ffdd000 Unfrozen
          Start: KERNEL32!BaseThreadStartThunk (7c8106f9)
          Priority: 2  Priority class: 32  Affinity: 3
       3  Id: 920.a4 Suspend: 1 Teb: 7ffdb000 Unfrozen
          Start: KERNEL32!BaseThreadStartThunk (7c8106f9)
          Priority: 0  Priority class: 32  Affinity: 3
       4  Id: 920.7c4 Suspend: 1 Teb: 7ffd9000 Unfrozen
          Start: KERNEL32!BaseThreadStartThunk (7c8106f9)
          Priority: 0  Priority class: 32  Affinity: 3
       5  Id: 920.91c Suspend: 1 Teb: 7ffd8000 Unfrozen
          Start: KERNEL32!BaseThreadStartThunk (7c8106f9)
          Priority: 0  Priority class: 32  Affinity: 3
       6  Id: 920.9c Suspend: 1 Teb: 7ffd7000 Unfrozen
          Start: KERNEL32!BaseThreadStartThunk (7c8106f9)
          Priority: 0  Priority class: 32  Affinity: 3
       7  Id: 920.29c Suspend: 1 Teb: 7ffd6000 Unfrozen
          Start: KERNEL32!BaseThreadStartThunk (7c8106f9)
          Priority: 0  Priority class: 32  Affinity: 3
       8  Id: 920.b38 Suspend: 1 Teb: 7ffd5000 Unfrozen
          Start: KERNEL32!BaseThreadStartThunk (7c8106f9)
          Priority: 0  Priority class: 32  Affinity: 3
       9  Id: 920.f68 Suspend: 1 Teb: 7ffd4000 Unfrozen
          Start: KERNEL32!BaseThreadStartThunk (7c8106f9)
          Priority: 0  Priority class: 32  Affinity: 3
      10  Id: 920.c38 Suspend: 1 Teb: 7ffaf000 Unfrozen
          Start: KERNEL32!BaseThreadStartThunk (7c8106f9)
          Priority: 0  Priority class: 32  Affinity: 3
      11  Id: 920.c68 Suspend: 1 Teb: 7ffae000 Unfrozen
          Start: KERNEL32!BaseThreadStartThunk (7c8106f9)
          Priority: 0  Priority class: 32  Affinity: 3
      12  Id: 920.a28 Suspend: 1 Teb: 7ffad000 Unfrozen
          Start: KERNEL32!BaseThreadStartThunk (7c8106f9)
          Priority: 0  Priority class: 32  Affinity: 3
      13  Id: 920.338 Suspend: 1 Teb: 7ffac000 Unfrozen
          Start: KERNEL32!BaseThreadStartThunk (7c8106f9)
          Priority: 0  Priority class: 32  Affinity: 3
      14  Id: 920.64c Suspend: 1 Teb: 7ffab000 Unfrozen
          Start: KERNEL32!BaseThreadStartThunk (7c8106f9)
          Priority: 0  Priority class: 32  Affinity: 3
      15  Id: 920.850 Suspend: 1 Teb: 7ffaa000 Unfrozen
          Start: KERNEL32!BaseThreadStartThunk (7c8106f9)
          Priority: 0  Priority class: 32  Affinity: 3
      16  Id: 920.d2c Suspend: 1 Teb: 7ffa9000 Unfrozen
          Start: KERNEL32!BaseThreadStartThunk (7c8106f9)
          Priority: 0  Priority class: 32  Affinity: 3
      17  Id: 920.f50 Suspend: 1 Teb: 7ffa8000 Unfrozen
          Start: KERNEL32!BaseThreadStartThunk (7c8106f9)
          Priority: 0  Priority class: 32  Affinity: 3
      18  Id: 920.8d4 Suspend: 1 Teb: 7ffa7000 Unfrozen
          Start: KERNEL32!BaseThreadStartThunk (7c8106f9)
          Priority: 0  Priority class: 32  Affinity: 3
    . 19  Id: 920.934 Suspend: 1 Teb: 7ffdc000 Unfrozen
          Start: ntdll!DbgUiRemoteBreakin (7c951e13)
          Priority: 0  Priority class: 32  Affinity: 3

    3. Switched to the main Form thread (Thread 0) which was stuck with the following exception

    0:019> ~0s
    eax=00001561 ebx=0012e678 ecx=011a3d00 edx=00000005 esi=00000000 edi=7ffda000
    eip=7c90e514 esp=0012e650 ebp=0012e6ec iopl=0         nv up ei pl zr na pe nc
    cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00000246
    ntdll!KiFastSystemCallRet:
    7c90e514 c3              ret

    4. After this I issued a 'k' command to see the call stack and try to find out how it got to the exception

    0:000> k
    ChildEBP RetAddr 
    0012e64c 7c90df4a ntdll!KiFastSystemCallRet
    0012e650 7c809590 ntdll!ZwWaitForMultipleObjects+0xc
    0012e6ec 79f6471a KERNEL32!WaitForMultipleObjectsEx+0x12c
    0012e754 79f6434b mscorwks!WaitForMultipleObjectsEx_SO_TOLERANT+0x6f
    0012e774 79f64454 mscorwks!Thread::DoAppropriateAptStateWait+0x3c
    0012e7f8 79f644e9 mscorwks!Thread::DoAppropriateWaitWorker+0x13c
    0012e848 79f64669 mscorwks!Thread::DoAppropriateWait+0x40
    0012e8a4 79e8c58e mscorwks!CLREvent::WaitEx+0xf7
    0012e8b8 79f93f1a mscorwks!CLREvent::Wait+0x17
    0012e944 79eae40c mscorwks!AwareLock::EnterEpilog+0x8c
    0012e960 79eae390 mscorwks!AwareLock::Enter+0x61
    *** WARNING: Unable to verify checksum for C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\System.Windows.Forms\439c466b60614915587c5273eaf0ca7f\System.Windows.Forms.ni.dll
    0012ea00 7b1c708d mscorwks!JIT_MonEnterWorker_Portable+0xb3
    0012ea7c 7b1c6eb5 System_Windows_Forms_ni+0x1f708d
    0012eadc 7b781cde System_Windows_Forms_ni+0x1f6eb5
    0012eb0c 7b1dc5f6 System_Windows_Forms_ni+0x7b1cde
    0012eb70 7b6f3d26 System_Windows_Forms_ni+0x20c5f6
    0012eb8c 7b1dc653 System_Windows_Forms_ni+0x723d26
    0012ebf4 7b6f3d26 System_Windows_Forms_ni+0x20c653
    0012ec10 7b1dc653 System_Windows_Forms_ni+0x723d26
    0012ec78 7b6f3d26 System_Windows_Forms_ni+0x20c653
    0012ec94 7b1dc653 System_Windows_Forms_ni+0x723d26
    0012ecfc 7b8eef4b System_Windows_Forms_ni+0x20c653
    0012ed2c 7b6f3d26 System_Windows_Forms_ni+0x91ef4b
    0012ed48 7b8ed233 System_Windows_Forms_ni+0x723d26
    0012ed74 7b1dc653 System_Windows_Forms_ni+0x91d233
    0012eddc 7b72601d System_Windows_Forms_ni+0x20c653
    0012ee60 7ba1f569 System_Windows_Forms_ni+0x75601d
    0012ee88 7b1d46c5 System_Windows_Forms_ni+0xa4f569
    0012eea8 7b1d46c5 System_Windows_Forms_ni+0x2046c5
    0012eee0 7b1d4165 System_Windows_Forms_ni+0x2046c5
    0012eeec 7b1c6d71 System_Windows_Forms_ni+0x204165
    0012ef28 7b1c6b74 System_Windows_Forms_ni+0x1f6d71
    0012ef40 7b1d3028 System_Windows_Forms_ni+0x1f6b74
    0012ef7c 7b1c8966 System_Windows_Forms_ni+0x203028
    0012efd4 7b1d1dca System_Windows_Forms_ni+0x1f8966
    0012efe0 7b1d1d80 System_Windows_Forms_ni+0x201dca
    0012efe8 7b1d2f71 System_Windows_Forms_ni+0x201d80
    0012eff8 7b1d1b54 System_Windows_Forms_ni+0x202f71
    0012f00c 7b1c86a0 System_Windows_Forms_ni+0x201b54
    0012f014 7b1c8621 System_Windows_Forms_ni+0x1f86a0
    0012f028 7b1c84fa System_Windows_Forms_ni+0x1f8621
    0012f08c 7e418734 System_Windows_Forms_ni+0x1f84fa
    0012f0b8 7e418816 USER32!InternalCallWinProc+0x28
    0012f120 7e428ea0 USER32!UserCallWinProcCheckWow+0x150
    0012f174 7e428eec USER32!DispatchClientMessage+0xa3
    0012f19c 7c90e473 USER32!__fnDWORD+0x24
    0012f1c0 7e42af62 ntdll!KiUserCallbackDispatcher+0x13
    0012f1e4 7b1c5ee3 USER32!NtUserShowWindow+0xc
    0012f278 7b1d13f7 System_Windows_Forms_ni+0x1f5ee3
    0012f2ac 7b1c4451 System_Windows_Forms_ni+0x2013f7
    0012f2b4 7b1d8908 System_Windows_Forms_ni+0x1f4451
    0012f304 7b1d87e1 System_Windows_Forms_ni+0x208908
    0012f334 7b195931 System_Windows_Forms_ni+0x2087e1
    0012f398 00426c38 System_Windows_Forms_ni+0x1c5931
    0012f440 79e71b4c _Validation_Tool!__tmainCRTStartup+0x140 [f:\rtm\vctools\crt_bld\self_x86\crt\src\crtexe.c @ 578] - This seems like the main function call
    0012f470 79e821f9 mscorwks!CallDescrWorker+0x33
    0012f4f0 79e96571 mscorwks!CallDescrWorkerWithHandler+0xa3
    0012f634 79e965a4 mscorwks!MethodDesc::CallDescr+0x19c
    0012f650 79e965c2 mscorwks!MethodDesc::CallTargetWorker+0x1f
    0012f668 79f3f1f4 mscorwks!MethodDescCallSite::Call+0x1a
    0012f7cc 79f077ad mscorwks!ClassLoader::RunMain+0x20d
    0012fa34 79f07cfd mscorwks!Assembly::ExecuteMainMethod+0xa6
    0012ff04 79f07ee7 mscorwks!SystemDomain::ExecuteMainMethod+0x456
    0012ff54 79f07e17 mscorwks!ExecuteEXE+0x59
    0012ff9c 603b55ab mscorwks!_CorExeMain+0x15c
    0012ffa8 79007f16 mscoreei!_CorExeMain+0x38
    0012ffb8 79004de3 mscoree!ShellShim__CorExeMain+0x99
    0012ffc0 7c817077 mscoree!_CorExeMain_Exported+0x8
    0012fff0 00000000 KERNEL32!BaseProcessStart+0x23

    Let me tell you guys that this is a .NET application with a main Form that is started from the WinMain routine. The Form in turns spawns other read threads. Thanks!

    Wednesday, September 22, 2010 6:58 PM
  • Hello,

    I am moving this post to Visual Studio Debugger Forum so you can get better and quicker response as there are more experts on this kind of issues.

    Thanks for your understanding.


    Edwer Fang [MSFT]
    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg @ microsoft.com

    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    Friday, September 24, 2010 5:08 AM