ModLoad: 5adc0000 5adf7000   C:\WINDOWS\system32\uxtheme.dll
ModLoad: 74680000 746cc000   C:\WINDOWS\system32\MSCTF.dll
ModLoad: 73640000 7366e000   C:\WINDOWS\system32\msctfime.ime
ModLoad: 01510000 01588000   C:\WINDOWS\system32\BAIDUCN.IME
ModLoad: 016a0000 018f6000   C:\Program Files\Baidu\BaiduPinyin\2.14.2.46\UIPFull.dll
ModLoad: 61880000 618ba000   C:\WINDOWS\system32\OLEACC.dll
ModLoad: 762f0000 762f5000   C:\WINDOWS\system32\MSIMG32.dll
ModLoad: 4ae90000 4b03b000   C:\WINDOWS\WinSxS\x86_Microsoft.Windows.GdiPlus_6595b64144ccf1df_1.0.6002.23084_x-ww_f3f35550\gdiplus.dll
ModLoad: 01910000 01988000   C:\Program Files\Baidu\BaiduPinyin\2.14.2.46\IMEFREETYPE.dll
ModLoad: 019a0000 019de000   C:\Program Files\Baidu\BaiduPinyin\2.14.2.46\imepng.dll
ModLoad: 019f0000 01a1b000   C:\Program Files\Baidu\BaiduPinyin\2.14.2.46\imezlib.dll
ModLoad: 76cb0000 76cd0000   C:\WINDOWS\system32\NTMARTA.DLL
ModLoad: 71b70000 71b83000   C:\WINDOWS\system32\SAMLIB.dll
ModLoad: 76f30000 76f5c000   C:\WINDOWS\system32\WLDAP32.dll
ModLoad: 76c00000 76c2e000   C:\WINDOWS\system32\WINTRUST.dll
ModLoad: 765e0000 76675000   C:\WINDOWS\system32\CRYPT32.dll
ModLoad: 76db0000 76dc2000   C:\WINDOWS\system32\MSASN1.dll
ModLoad: 76c60000 76c89000   C:\WINDOWS\system32\IMAGEHLP.dll
ModLoad: 68be0000 68be9000   C:\WINDOWS\system32\HID.DLL
ModLoad: 76fa0000 7701f000   C:\WINDOWS\system32\CLBCATQ.DLL
ModLoad: 77020000 770ba000   C:\WINDOWS\system32\COMRes.dll
ModLoad: 0a0f0000 0a17e000   C:\WINDOWS\system32\XAudio2_7.dll
ModLoad: 73e70000 73ecc000   C:\WINDOWS\system32\dsound.dll
ModLoad: 72c90000 72c99000   C:\WINDOWS\system32\wdmaud.drv
ModLoad: 72c80000 72c88000   C:\WINDOWS\system32\msacm32.drv
ModLoad: 77bb0000 77bc5000   C:\WINDOWS\system32\MSACM32.dll
ModLoad: 77ba0000 77ba7000   C:\WINDOWS\system32\midimap.dll
ModLoad: 73e40000 73e44000   C:\WINDOWS\system32\KsUser.dll
(d7c.1278)(3ec.de0): Access violation - code c0000005 (first chance) 每次红色那都不一样
First chance exceptions are reported before any exception handling. 
This exception may be expected and handled. 
eax=00000000 ebx=00000000 ecx=006712a8 edx=ff98ed58 esi=0071b7b0 
edi=01248da0 eip=00502482 esp=01247900 ebp=01247970 iopl=0  nv up ei ng nz ac po cy cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00010293 
Game+0x102482: 00502482 89740a30   mov  dword ptr [edx+ecx+30h],esi ds:0023:00000030=???????? 
Windbg运行一个Game.exe程序时出现的异常,有些系统的机器可以正常,但是这台就不行,调试的错误如下,有哪位大神看下如何解决?是要改写Game.exe还是软件要卸载什么? 补充下:这个Game.exe同样在有些机器上是可以用的,都是XP,一样的系统,都是SP3,一样的DX9.0c连文件我都比对过,都是版本一样的,也有配置比这个机器低的都可以运行不出错,但有些机器就和这个机器一样,在这个程序的一开始显示loading时候就挂了。正常是loading几秒就显示游戏的背景了。想知道如何解决,还有时候会提示 0x005024**记不清了指令引用的内存0x00000030不能为"written"

解决方案 »

  1.   

    使用k命令查看Call Stack中列出的从上到下列出的对应从里层到外层的函数调用历史。如果单靠查看Call Stack无法弄懂哪里出了问题,参考下面:有时不将“调用函数名字+各参数值,进入函数后各参数值,中间变量值,退出函数前准备返回的值,返回函数到调用处后函数名字+各参数值+返回值”这些信息写日志到文件中是无论如何也发现不了问题在哪里的,包括捕获各种异常、写日志到屏幕、单步或设断点或生成core文件、……这些方法都不行! 写日志到文件参考下面:
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #ifdef WIN32
        #include <windows.h>
        #include <io.h>
    #else
        #include <unistd.h>
        #include <sys/time.h>
        #include <pthread.h>
        #define  CRITICAL_SECTION   pthread_mutex_t
        #define  _vsnprintf         vsnprintf
    #endif
    //Log{
    #define MAXLOGSIZE 20000000
    #define MAXLINSIZE 16000
    #include <time.h>
    #include <sys/timeb.h>
    #include <stdarg.h>
    char logfilename1[]="MyLog1.log";
    char logfilename2[]="MyLog2.log";
    static char logstr[MAXLINSIZE+1];
    char datestr[16];
    char timestr[16];
    char mss[4];
    CRITICAL_SECTION cs_log;
    FILE *flog;
    #ifdef WIN32
    void Lock(CRITICAL_SECTION *l) {
        EnterCriticalSection(l);
    }
    void Unlock(CRITICAL_SECTION *l) {
        LeaveCriticalSection(l);
    }
    #else
    void Lock(CRITICAL_SECTION *l) {
        pthread_mutex_lock(l);
    }
    void Unlock(CRITICAL_SECTION *l) {
        pthread_mutex_unlock(l);
    }
    #endif
    void LogV(const char *pszFmt,va_list argp) {
        struct tm *now;
        struct timeb tb;    if (NULL==pszFmt||0==pszFmt[0]) return;
        _vsnprintf(logstr,MAXLINSIZE,pszFmt,argp);
        ftime(&tb);
        now=localtime(&tb.time);
        sprintf(datestr,"%04d-%02d-%02d",now->tm_year+1900,now->tm_mon+1,now->tm_mday);
        sprintf(timestr,"%02d:%02d:%02d",now->tm_hour     ,now->tm_min  ,now->tm_sec );
        sprintf(mss,"%03d",tb.millitm);
        printf("%s %s.%s %s",datestr,timestr,mss,logstr);
        flog=fopen(logfilename1,"a");
        if (NULL!=flog) {
            fprintf(flog,"%s %s.%s %s",datestr,timestr,mss,logstr);
            if (ftell(flog)>MAXLOGSIZE) {
                fclose(flog);
                if (rename(logfilename1,logfilename2)) {
                    remove(logfilename2);
                    rename(logfilename1,logfilename2);
                }
            } else {
                fclose(flog);
            }
        }
    }
    void Log(const char *pszFmt,...) {
        va_list argp;    Lock(&cs_log);
        va_start(argp,pszFmt);
        LogV(pszFmt,argp);
        va_end(argp);
        Unlock(&cs_log);
    }
    //Log}
    int main(int argc,char * argv[]) {
        int i;
    #ifdef WIN32
        InitializeCriticalSection(&cs_log);
    #else
        pthread_mutex_init(&cs_log,NULL);
    #endif
        for (i=0;i<10000;i++) {
            Log("This is a Log %04d from FILE:%s LINE:%d\n",i, __FILE__, __LINE__);
        }
    #ifdef WIN32
        DeleteCriticalSection(&cs_log);
    #else
        pthread_mutex_destroy(&cs_log);
    #endif
        return 0;
    }
    //1-78行添加到你带main的.c或.cpp的那个文件的最前面
    //81-85行添加到你的main函数开头
    //89-93行添加到你的main函数结束前
    //在要写LOG的地方仿照第87行的写法写LOG到文件MyLog1.log中
      

  2.   

    (1758.a3c): Access violation - code c0000005 (first chance)
    First chance exceptions are reported before any exception handling.
    This exception may be expected and handled.
    eax=00000000 ebx=00000000 ecx=006712a8 edx=ff98ed58 esi=0071b7b0 edi=01248da0
    eip=00502482 esp=01247900 ebp=01247970 iopl=0         nv up ei ng nz ac po cy
    cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00010293
    *** ERROR: Module load completed but symbols could not be loaded for Game.exe
    Game+0x102482:
    00502482 89740a30        mov     dword ptr [edx+ecx+30h],esi ds:0023:00000030=????????
    0:003> k
    ChildEBP RetAddr  
    WARNING: Stack unwind information not available. Following frames may be wrong.
    01247970 00000000 Game+0x102482