none
How can I access the CLR stress log in windbg? - Error "SOS stress log not in image" RRS feed

  • Question

  • This is essentially the same query as that raised by Rizwan Sharif in 2012 (Question: SOS.dll GC History commands). The difference is that all the necessary registry settings have been applied (as stated in the approved answer) and system restarted.

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework]
    "InstallRoot"="C:\\Windows\\Microsoft.NET\\Framework64\\"
    "Enable64Bit"=dword:00000001
    "DbgManagedDebugger"="\"C:\\Windows\\system32\\vsjitdebugger.exe\" PID %d APPDOM %d EXTEXT \"%s\" EVTHDL %d"
    "DbgJITDebugLaunchSetting"=dword:00000010
    "UseRyuJIT"=dword:00000001
    "GCBreakOnOOM"=dword:00000002
    "HeapVerify"=dword:00000001
    "StressLog"=dword:00000001
    "LogFacility"=dword:ffffffff
    "StressLogSize"=dword:00010000
    "LogLevel"=dword:00000010

    Commands such as !HistInit and !DumpLog output the same error message

    0:000> !histinit
    Attempting to read Stress log
    ----- No thread logs in the image: The stress log was probably not initialized correctly. -----
    No Stress log in the image, GCHist commands unavailable

    If the stress log has not been "initialized correctly" what must I do to initialize the stress log?

    Tested on Windows 7 and 10 with administrative account. Target application and windbg are also executed with administrative privileges, confirmed by UAC. x86 version of Windbg used for x86 target application.

    Monday, December 5, 2016 2:53 PM

All replies

  • Hi Steve,

    >>Attempting to read Stress log
    ----- No thread logs in the image: The stress log was probably not initialized correctly. -----
    No Stress log in the image, GCHist commands unavailable

    Could you help give a detailed steps to reproduce your issue?

    By the way, could you load SOS.dll correctly?

    To get the StressLog, do the following:

    1. At the command line, enter: set COMPLUS_StressLog = 1

    2. Start WinDbg from the command line, and then start the debugger through WinDbg until the program runs to the wrong place

    3. In WinDbg, enter: .loadby sos mscorwks. This step is used to load SOS. SOS is a WinDbg extension for debugging the CLR.

    4. In WinDbg, enter! DumpLog

    5. Locate the StressLog.txt file in the directory where the program starts, and the StressLog information is there.

    Best regards,

    Kristin


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, December 6, 2016 10:01 AM
  • Thanks for the assistance. The detailed steps are (now):

    1. Execute application after stresslog registry settings have been added and system restarted

    2. Create full dump from application (procexp.exe)

    3. Open CMD prompt

    4. set COMPLUS_StressLog = 1

    5. Open windbg from cmd

    6. Open dump file

    7. .extpath D:\WINDBG\NET40_WIN7

    8. .sympath D:\WINDBG\VM Build 9.0.0.2771\Output\bin\Debug;d:\dev_support\Symbols;https://msdl.microsoft.com/download/symbols

    9. .load clr

    10. .load sos

    11. .chain

    Extension DLL search Path:
        D:\WINDBG\NET40_WIN7
    Extension DLL chain:
        C:\Windows\Microsoft.NET\Framework\v4.0.30319\SOS.dll: image 4.6.1085.0, API 1.0.0, built Fri Aug  5 21:47:49 2016
            [path: C:\Windows\Microsoft.NET\Framework\v4.0.30319\SOS.dll]
        sos: image 4.6.1085.0, API 1.0.0, built Fri Aug  5 21:47:49 2016
            [path: D:\WINDBG\NET40_WIN7\sos.dll]
        clr: image 4.6.1085.0, built Fri Aug  5 21:52:10 2016
            [path: D:\WINDBG\NET40_WIN7\clr.dll]
        dbghelp: image 10.0.14321.1024, API 10.0.6, built Thu Jul 28 06:16:38 2016
            [path: C:\Program Files (x86)\Windows Kits\10\Debuggers\x86\dbghelp.dll]
        ext: image 10.0.14321.1024, API 1.0.0, built Thu Jul 28 06:18:44 2016
            [path: C:\Program Files (x86)\Windows Kits\10\Debuggers\x86\winext\ext.dll]
        exts: image 10.0.14321.1024, API 1.0.0, built Thu Jul 28 06:16:13 2016
            [path: C:\Program Files (x86)\Windows Kits\10\Debuggers\x86\WINXP\exts.dll]
        uext: image 10.0.14321.1024, API 1.0.0, built Thu Jul 28 06:16:01 2016
            [path: C:\Program Files (x86)\Windows Kits\10\Debuggers\x86\winext\uext.dll]
        ntsdexts: image 10.0.14393.33, API 1.0.0, built Thu Jul 28 06:23:56 2016
            [path: C:\Program Files (x86)\Windows Kits\10\Debuggers\x86\WINXP\ntsdexts.dll]

    12. !dumplog

    Attempting to dump Stress log to file 'StressLog.txt'
    ----- No thread logs in the image: The stress log was probably not initialized correctly. -----
    No Stress log in the image, no file written

    Thursday, December 8, 2016 11:28 AM