Access Violation RtlpWaitForCriticalSection



  • Hallooo,...

    ich habe ein Problem,..
    Das Release schmeißt mir ab und zu eine access violation raus.
    Es stellte sich herraus das die angegebene Addresse
    bei ntdll.dll!_RtlpWaitForCriticalSection@4+0x5b Bytes (bei mir 7c92b21a) ist.
    Die register sehen wie folgt aus:

    EAX = 00000000 EBX = 00000000 ECX = 00000A08 EDX = 003B5C48 ESI = 003B5C38
    EDI = 00000000 EIP = 7C92B21A ESP = 0A8CFE78 EBP = 0A8CFEEC EFL = 00000000

    ESI ist gleich der Critical Section.

    Gucke ich mir die Critical Section an:

    - csAccess {DebugInfo=0x07deba10 LockCount=0xffffffff RecursionCount=0x00000000 ...} _RTL_CRITICAL_SECTION
    - DebugInfo 0x07deba10 {Type=0x0000 CreatorBackTraceIndex=0x0000 CriticalSection=0x003b5c38 ...} _RTL_CRITICAL_SECTION_DEBUG *
    Type 0x0000 unsigned short
    CreatorBackTraceIndex 0x0000 unsigned short
    + CriticalSection 0x003b5c38 {DebugInfo=0x07deba10 LockCount=0xffffffff RecursionCount=0x00000000 ...} _RTL_CRITICAL_SECTION *
    + ProcessLocksList {Flink=0x001e0950 Blink=0x07deb9f0 } _LIST_ENTRY
    EntryCount 0x00000000 unsigned long
    ContentionCount 0x00000000 unsigned long
    Flags 0x00000000 unsigned long
    CreatorBackTraceIndexHigh 0x0000 unsigned short
    SpareWORD 0x0000 unsigned short
    LockCount 0xffffffff long
    RecursionCount 0x00000000 long
    OwningThread 0x00000000 void *
    LockSemaphore 0x00000000 void *
    SpinCount 0x00000000 unsigned long

    so ist die sektion ja released,...

    hier noch das codefragment:

    7C92B20F  mov         dword ptr [ebp-4],eax 
    7C92B212  je          _RtlpWaitForCriticalSection@4+7Eh (7C92B2B6h) 
    7C92B218  mov         eax,dword ptr [esi] 
    7C92B21A  inc         dword ptr [eax+10h] 
    7C92B21D  mov         eax,dword ptr [ebp-4] 
    7C92B220  and         eax,1 
    .
    .
    .
    

    habt ihr ein paar ideen warum dieser fehler auftreten könnte ?
    seid gegrüßt und habt dank,...



  • na dann holt mal alle eure Kristallkugeln raus ...



  • ?

    Das ist ne multithreaded app,...

    in einem thread wird EnterCriticalSection aufgerufen,..

    Die CriticalSection DebugInfo, die register des Threads habe ich geposted,...

    Der fehler tritt exact an der stelle 7c92b21a auf.

    Kein anderer Thread griff zu diesem Zeitpunkt, oder kurz vorher auf die Sektion zu.

    Der fehler ist schwer reproduzierbar. (tritt selten auf...)

    Und da ich auch keine Kristallkugel habe ist ja die frage "ob jemand eine idee" hätte, unter welchen bedingungen solch ein fehler in der ntdll auftritt.

    Oder vielleicht wonach ich suchen könnte,...

    Seid gegrüßt und habt dank,..



  • Hallo,

    Dies könnte vielleicht helfen

    Erreur :
    svchost.exe instruction "0x7c92b21a" emploie l'adresse mémoire "0x00000010" la mémoire ne peut être "written".

    Dr Watson : Erreurs d'application : C:\windows\system32\svchost.exe c00000005 ntdll!RtlpWaitForCriticalSection(7C92B21A)

    Une exception d'application s'est produite :
            App : C:\WINDOWS\system32\svchost.exe (pid=912)
            Lorsque : 23/11/2010 @ 18:52:06.593
            Numéro d'exception :c0000005 (violation d'accès)
    
    *----> Vidage de l'état de la thread 0x3a8 <----*
    
    eax=00000000 ebx=00000000 ecx=0000011c edx=006ad7a0 esi=006ad790 edi=00000000
    eip=7c92b21a esp=0069febc ebp=0069ff30 iopl=0         nv up ei pl zr na po nc
    cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00000246
    
    fonction : ntdll!RtlpWaitForCriticalSection
            7c92b1fe 57               push    edi
            7c92b1ff 1bc0             sbb     eax,eax
            7c92b201 f7d0             not     eax
            7c92b203 25e0e1987c       and     eax,0x7c98e1e0
            7c92b208 8bf8             mov     edi,eax
            7c92b20a 8b4610           mov     eax,[esi+0x10]
            7c92b20d 3bc3             cmp     eax,ebx
            7c92b20f 8945fc           mov     [ebp-0x4],eax
            7c92b212 0f849e000000     je  ntdll!RtlpUnWaitCriticalSection+0x2f (7c92b2b6)
            7c92b218 8b06             mov     eax,[esi]
    [b]FAUTE ->7c92b21a ff4010           inc  dword ptr [eax+0x10] ds:0023:00000010=????????[/b]
            7c92b21d 8b45fc           mov     eax,[ebp-0x4]
            7c92b220 83e001           and     eax,0x1
            7c92b223 8945e8           mov     [ebp-0x18],eax
            7c92b226 8b06             mov     eax,[esi]
            7c92b228 ff4014           inc     dword ptr [eax+0x14]
            7c92b22b f605f002fe7f01   test    byte ptr [7ffe02f0],0x1
            7c92b232 0f853e870200     jne     ntdll!RtlDeleteAce+0xb825 (7c953976)
            7c92b238 395de8           cmp     [ebp-0x18],ebx
            7c92b23b 57               push    edi
            7c92b23c 53               push    ebx
    

    Herzlich
    ErreurFault



  • Verdacht: du rufst EnterCriticalSection auf nachdem die CRITICAL_SECTION bereits mit DeleteCriticalSection gelöscht wurde.


Anmelden zum Antworten