Hardware/Software
. existing HP notebook with Win7 32bit


Symptoms
. while debugging a 32bit program, using INT3h's in my MASM program instead of
using WinDbg, every single run would crash, including losing data in an output file;
if I ran under WinDbg, it would NOT crash, and my output file had data.
This falsely led me to believe that I was at fault as the WER .mdmp points to my INT3:

BUCKET_ID: APPLICATION_FAULT_STATUS_BREAKPOINT_dsntoday!mainC RTStartup+95d

INVOKE ExitThread,EAX
eax=00000000 ebx=000000f4 ecx=0012ff60 edx=77006344 esi=00000000 edi=00000000
eip=004026d0 esp=0012ff8c ebp=0012ff94 iopl=0 nv up ei pl nz na po nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000202
DSNTODAY!mainCRTStartup+0x16d0:
004026d0 50 push eax

t/p 9999999 ends up here:
ntdll!ZwTerminateProcess+0xa:
77005b7a ff12 call dword ptr [edx] ds:0023:7ffe0300={ntdll!KiFastSystemCall (77006340)}
eax=00000172 ebx=00000000 ecx=77023afc edx=7ffe0300 esi=77098380 edi=77098340
eip=77006340 esp=0012ff50 ebp=0012ff6c 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!KiFastSystemCall:
77006340 8bd4 mov edx,esp
eax=00000172 ebx=00000000 ecx=77023afc edx=0012ff50 esi=77098380 edi=77098340
eip=77006342 esp=0012ff50 ebp=0012ff6c 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!KiFastSystemCall+0x2:
77006342 0f34 sysenter
eax=00000172 ebx=00000000 ecx=77023afc edx=0012ff50 esi=77098380 edi=77098340
eip=77006344 esp=0012ff50 ebp=0012ff6c 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:
77006344 c3 ret
0:000> t
^ No runnable debuggees error in 't'
0:000> !analyze -v
Last event: 8ec.1544: Exit process 0:8ec, code 0

0:000> !uniqstack -v
Processing 1 threads, please wait

. 0 Id: 8ec.1544 Suspend: 0 Teb: 7ffdf000 Unfrozen
Start: DSNTODAY!mainCRTStartup (00401000)
Priority: 0 Priority class: 32 Affinity: 3
ChildEBP RetAddr Args to Child
0012ff4c 77005b7c 770237f6 ffffffff 00000000 ntdll!KiFastSystemCallRet (FPO: [0,0,0])
0012ff50 770237f6 ffffffff 00000000 00000000 ntdll!ZwTerminateProcess+0xc (FPO: [2,0,0])
0012ff6c 76ff06ca 00000000 00000000 00000001 ntdll!RtlExitUserProcess+0x85 (FPO: [Non-Fpo])
0012ff80 004026d6 00000000 76ee1114 7ffde000 ntdll!RtlExitUserThread+0x41 (FPO: [Non-Fpo])
0012ff94 7701b429 7ffde000 76283a8f 00000000 DSNTODAY!mainCRTStartup+0x16d6 [DSNTODAY.ASM @ 3302]
0012ffd4 7701b3fc 00401000 7ffde000 00000000 ntdll!__RtlUserThreadStart+0x70 (FPO: [Non-Fpo])
0012ffec 00000000 00401000 7ffde000 00000000 ntdll!_RtlUserThreadStart+0x1b (FPO: [Non-Fpo])

Total threads: 1

0:000> !address -f:image /c:"s -a %1 %2 \"WORKING STORAGE\""
Failed to map Heaps (error 80004005)
...
00404009 57 4f 52 4b 49 4e 47 20-53 54 4f 52 41 47 45 1c WORKING STORAGE.

00404000 53 54 41 52 54 20 4f 46 20 57 4f 52 4b 49 4e 47 20 53 54 4f START OF WORKING STO
00404014 52 41 47 45 1c 00 00 00 1c 00 00 00 01 00 00 00 28 01 00 00 RAGE............(...


Attempts to address
. many!

Circumvention

FINALLY hit on it !!!!!! When I commented out all my INT3h's in my program,
the crashes stopped. I now control issuing these via an options file. In my case,
if I tell it to set an INT3, everything works until I try to exit, when it crashes.
I never had any problems using these in 16bit for debugging.


I'd like to hear any solutions anyone else found for this problem...