.Net 4 constantly wasting one CPU core on StrongNameSignatureVerification

前端 未结 2 1801
深忆病人
深忆病人 2021-02-07 10:23

We have a mixed mode assembly application (MFC+WinForms) running on .Net 4, Windows 2008 R2 that constantly uses 100% cpu on one thread.

Using ProcessExplorer we see

相关标签:
2条回答
  • 2021-02-07 10:36

    clr.dll!StrongNameSignatureVerification+0x164d9

    This does not do what you think it does. The number at the right of the identifier is important, that gives the number of bytes past the known location of the StrongNameSignatureVerification function address. That's 91353 bytes, that is a lot. The only thing you can tell from that is that it is not executing StrongNameSignatureVerification, the function is not nearly that long. The rest of the identifiers in the stack trace are equally unreliable.

    The problem is that the debugger doesn't have a PDB file for these DLLs. It can only discover the address of exported functions, it doesn't know enough about all the functions in between. You can only trust the displayed name if the offset is less than about 0x100 bytes. Give or take.

    You will need to get these PDB files to know what is really going on. That requires enabling the Microsoft Symbol Server. The debugger will download the required PDB files from that server when you start debugging. You'll now get much more reliable symbols, giving you much better insight in what code is really executing.

    Enabling the symbol server is easy, the MSDN page is here.

    0 讨论(0)
  • 2021-02-07 10:49

    You might consider using the profiling tools in visual studio to identify hotspots in your code that could be contributing to this problem. To get symbol support for the .net CLR see this link.

    http://blogs.msdn.com/b/sburke/archive/2008/01/16/configuring-visual-studio-to-debug-net-framework-source-code.aspx

    0 讨论(0)
提交回复
热议问题