locked
debug access violation RRS feed

  • Question

  • Whats the recommended approach to debug access violation that affect different part of the application each time?

     

    Application in question is mix-mode; C++ and C# [.NET 1.1].

     

    Using Windbg to debug. Tried gflags with no luck.

     

    Here is some debugging data;

     

    Code Snippet

    (e84.e88): Access violation - code c0000005 (first chance)
    First chance exceptions are reported before any exception handling.
    This exception may be expected and handled.
    eax=0c3afa80 ebx=00000000 ecx=0bfe8ed0 edx=072810ac esi=00194aa8
    edi=0171c298
    eip=00000040 esp=0012f378 ebp=0012f3a4 iopl=0         nv up ei pl zr
    na pe nc
    cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000
    efl=00010246
    00000040 ??              ???

    0:000> !analyze -v
    ***************************************************************************­****
    *
    *
    *                        Exception
    Analysis                                   *
    *
    *
    ***************************************************************************­****

    FAULTING_IP:
    +40
    00000040 ??              ???

    EXCEPTION_RECORD:  ffffffff -- (.exr 0xffffffffffffffff)
    ExceptionAddress: 00000040
       ExceptionCode: c0000005 (Access violation)
      ExceptionFlags: 00000000
    NumberParameters: 2
       Parameter[0]: 00000000
       Parameter[1]: 00000040
    Attempt to read from address 00000040

    FAULTING_THREAD:  00000e88

    DEFAULT_BUCKET_ID:  BAD_INSTRUCTION_PTR

    PROCESS_NAME:  AimOS.exe

    ERROR_CODE: (NTSTATUS) 0xc0000005 - Instruksjonen i "0x%08lx"
    refererte til adresse "0x%08lx". Minnet kunne ikke v re "%s".

    READ_ADDRESS:  00000040

    FAILED_INSTRUCTION_ADDRESS:
    +40
    00000040 ??              ???

    NTGLOBALFLAG:  0

    APPLICATION_VERIFIER_FLAGS:  0

    MANAGED_STACK: !dumpstack -EE
    Current frame:
    ChildEBP RetAddr  Caller,Callee
    0012f868 7999c1b0 (MethodDesc 0x79ba9b30 +0x20
    System.Collections.Hashtable.GetHash)
    0012f86c 7999c449 (MethodDesc 0x79ba9ba0 +0x159
    System.Collections.Hashtable.Insert)
    0012f8ac 0e0065f1 (MethodDesc 0x999a7d8 +0xe1
    OSK.Basic.StructuredPropertyBag.AddIntegerProperty)
    0012f8c4 799a97a7 (MethodDesc 0x79bc7fc8 +0x4f
    System.Collections.Queue.Enqueue)
    0012f8d4 0e0099a7 (MethodDesc 0x999e520 +0xa7
    OSK.Remoting.Sender.AddMessage)
    0012f900 0e009710 (MethodDesc 0x999d818 +0x2a0
    OSK.Remoting.TcpMessenger.Send)
    0012f958 0e00649c (MethodDesc 0x999d7f8 +0x474
    OSK.Remoting.TcpMessenger.SendText)
    0012f9e4 0e00cc2b (MethodDesc 0x999d060 +0x133
    OSK.TimeSeries.RemoteTimeSeries.RemoteTimeSeriesInterface.StartReadCompress­edData)
    0012fa38 0e00ca80 (MethodDesc 0xba82f18 +0x60
    RemoteTimeSeriesInterface.StartReadCompressedData)
    0012fa60 0e00c9fc (MethodDesc 0xa2cd598 +0x64
    CAimTimeSeriesSignature2.StartReadCompressedData)
    0012fb58 7b81c9b0 (MethodDesc 0x7b9e43b8 +0x8
    System.Windows.Forms.Control.get_DefaultBackColor)
    0012fb5c 7b81c8fc (MethodDesc 0x7b9e4838 +0xc4
    System.Windows.Forms.Control.get_BackColor)
    0012fbb8 7b817776 (MethodDesc 0x7b9ee330 +0x36
    System.Windows.Forms.PropertyStore.GetObject)
    0012fbdc 7b81772b (MethodDesc 0x7b9ee320 +0xb
    System.Windows.Forms.PropertyStore.GetObject)
    0012fbe8 7b8176ee (MethodDesc 0x7b9e3ed8 +0x16
    System.Windows.Forms.Control.get_IsActiveX)
    0012fbec 7b819253 (MethodDesc 0x7b9e4998 +0xb
    System.Windows.Forms.Control.get_CanRaiseEvents)
    0012fbf0 7b1d498e (MethodDesc 0x7b30bde0 +0x6
    System.ComponentModel.EventHandlerList.get_Item)
    0012fbf4 7b825a50 (MethodDesc 0x7b9e3168 +0x90
    System.Windows.Forms.Control.OnInvalidated)
    0012fc08 7b82597c (MethodDesc 0x7b9e3668 +0x34
    System.Windows.Forms.Control.NotifyInvalidate)

    LAST_CONTROL_TRANSFER:  from 79221be1 to 00000040

    STACK_TEXT:
    WARNING: Frame IP not in any known module. Following frames may be
    wrong.
    0012f374 79221be1 0171c298 00194aa8 0bfe8ed0 0x40
    0012f3a4 79232e77 00000000 00000000 0bfe8ed0 mscorwks!GetCompileInfo
    +0x47f06
    0012f3c0 79232ea8 00000001 0bfe8ed0 79232f86 mscorwks!GetCompileInfo
    +0x5919c
    0012f604 79232e0d 0bfe8ed0 0bff3c44 7923303c mscorwks!GetCompileInfo
    +0x591cd
    0012f62c 792335bc 0bff3840 002482d0 0012f660 mscorwks!GetCompileInfo
    +0x59132
    0012f63c 792325bb 0bff3840 0017ffe0 0012fad0 mscorwks!GetCompileInfo
    +0x598e1
    0012f660 79234dd3 00000000 0953fdf0 0012f680 mscorwks!GetCompileInfo
    +0x588e0
    0012f670 79234dae 002482d0 0023ce48 0012f698 mscorwks!GetCompileInfo
    +0x5b0f8
    0012f680 7cce50a3 0953fe0c 0012f69c 0012f6c4 mscorwks!GetCompileInfo
    +0x5b0d3
    0012f698 7800378e 001b29f8 0023ce48 02020202 ole32!
    CreateGenericComposite+0x7f0
    0012f6b4 780781a5 7cce5085 0012f6c8 00000002 RPCRT4!
    NdrServerInitializeNew+0x78a
    0012fa98 78078df8 001cab48 001cb730 0bf446cc RPCRT4!NdrStubCall2+0x1a5
    0012faf0 7cdc5c14 001cab48 0bf446cc 001cb730 RPCRT4!
    CStdStubBuffer_Invoke+0x82
    0012fb30 7cdc5bc3 0bf446cc 001cf244 00000000 ole32!
    CoSuspendClassObjects+0x4386
    0012fb78 7ccef474 0bf446cc 001cacd0 001cab48 ole32!
    CoSuspendClassObjects+0x4335
    0012fbec 7b819253 7b1d498e 7b825a50 0012fc68 ole32!CoGetCallContext
    +0x1e5
    0012fbf0 7b1d498e 7b825a50 0012fc68 073ab088
    system_windows_forms_7b810000+0x9253
    0012fbf4 7b825a50 0012fc68 073ab088 079e1d3c system_7b1d0000+0x498e
    0012fc08 7b82597c 073a9c74 7ccc1a4c 7ccc1a3c
    system_windows_forms_7b810000+0x15a50
    0012fc50 7ccef39e 001cb730 00000000 001cab48
    system_windows_forms_7b810000+0x1597c
    0012fc6c 7ccf5e6d 0bf446cc 00000001 001cab48 ole32!CoGetCallContext
    +0x10f
    0012fc98 7cdc6086 0bf446cc 00000001 001cab48 ole32!CoUnmarshalInterface
    +0x7ac
    0012fccc 7cdc59bd 0bf44680 001cb730 001cab48 ole32!
    CoSuspendClassObjects+0x47f8
    0012fd80 7ccef32f 001a4ce8 00000000 0017efa8 ole32!
    CoSuspendClassObjects+0x412f
    00000000 00000000 00000000 00000000 00000000 ole32!CoGetCallContext
    +0xa0

    FOLLOWUP_IP:
    mscorwks!GetCompileInfo+47f06
    79221be1 8945ec          mov     dword ptr [ebp-14h],eax

    SYMBOL_STACK_INDEX:  1

    FOLLOWUP_NAME:  MachineOwner

    MODULE_NAME: mscorwks

    IMAGE_NAME:  mscorwks.dll

    DEBUG_FLR_IMAGE_TIMESTAMP:  40f6320e

    PRIMARY_PROBLEM_CLASS:  BAD_INSTRUCTION_PTR

    BUGCHECK_STR:  APPLICATION_FAULT_BAD_INSTRUCTION_PTR

    SYMBOL_NAME:  mscorwks!GetCompileInfo+47f06

    STACK_COMMAND:  ~0s ; kb

    FAILURE_BUCKET_ID:
    APPLICATION_FAULT_BAD_INSTRUCTION_PTR_BAD_IP_mscorwks!GetCompileInfo
    +47f06

    BUCKET_ID:  APPLICATION_FAULT_BAD_INSTRUCTION_PTR_BAD_IP_mscorwks!
    GetCompileInfo+47f06

    Followup: MachineOwner
    ---------

    0:000> ~
    .  0  Id: e84.e88 Suspend: 1 Teb: 7ffde000 Unfrozen
       2  Id: e84.ed0 Suspend: 1 Teb: 7ffdc000 Unfrozen
       3  Id: e84.ed4 Suspend: 1 Teb: 7ffdb000 Unfrozen
       4  Id: e84.ed8 Suspend: 1 Teb: 7ffda000 Unfrozen
       5  Id: e84.edc Suspend: 1 Teb: 7ffd9000 Unfrozen
       6  Id: e84.ee0 Suspend: 1 Teb: 7ffd8000 Unfrozen
       7  Id: e84.f18 Suspend: 1 Teb: 7ffd7000 Unfrozen
       8  Id: e84.f28 Suspend: 1 Teb: 7ffd5000 Unfrozen
       9  Id: e84.fa0 Suspend: 1 Teb: 7ffd4000 Unfrozen
      11  Id: e84.c0 Suspend: 1 Teb: 7ffaf000 Unfrozen
      12  Id: e84.60c Suspend: 1 Teb: 7ffae000 Unfrozen
      13  Id: e84.518 Suspend: 1 Teb: 7ffad000 Unfrozen
      14  Id: e84.228 Suspend: 1 Teb: 7ffac000 Unfrozen

    0:000> !clrstack -a
    Thread 0
    ESP       EIP

     

     

    Monday, April 28, 2008 5:41 PM