.net - Symbols for ngen-ed assemblies are not loaded -


i trying decode following call stack line procmon:

29  system.management.automation.ni.dll system.management.automation.ni.dll + 0x897a0a  0x7fee2ae7a0a   c:\windows\assembly\nativeimages_v4.0.30319_64\system.manaa57fc8cc#\a86698074f28597f1fc5ceabfed6fed6\system.management.automation.ni.dll 

as can see there ngen-ed assembly in it: system.management.automation.ni.dll. created pdb file ngen createpdb:

ps> ngen createpdb c:\windows\assembly\nativeimages_v4.0.30319_64\system.manaa57fc8cc#\a86698074f28597f1fc5ceabfed6fed6\system.management.automation.ni.dll c:\symbols\ngen  generated pdb native assembly 'c:\windows\assembly\nativeimages_v4.0.30319_64\system.manaa57fc8cc#\a8698074f28597f1fc5ceabfed6fed6\system.management.automation.ni.dll'. pdb generated in directory c:\symbols\ngen\system.management.automation.ni.pdb a86698074f28597f1fc5ceabfed6fed61\ 

my symbol path in _nt_symbol_path variable is:

srv*c:\symbols\ngen*;srv*c:\symbols\dbg*http://referencesource.microsoft.com/symbols;srv*c:\symbols\dbg*http://msdl.microsoft 

.com/download/symbols

but can still see newly generated symbol file not loaded assembly:

ps a86698074f28597f1fc5ceabfed6fed6> dbh -n .\system.management.automation.ni.dll verbose mode on. dbghelp: no header .\system.management.automation.ni.dll.  searching image on disk dbghelp: c:\windows\assembly\nativeimages_v4.0.30319_64\system.manaa57fc8cc#\a86698074f28597f1fc5ceabfed6fed6\system.management.automation.ni.dll - ok symsrv:  c:\symbols\ngen\system.management.automation.pdb\6b8b8f14d0564cb893b6e84b43cae67b1\system.management.automation.pdb - file not found symsrv:  c:\tools\diag\debugging tools windows\x64\sym\system.management.automation.pdb\6b8b8f14d0564cb893b6e84b43cae67b1\system.management.automation.pdb - file not found symsrv:  c:\symbols\ngen\system.management.automation.pdb\6b8b8f14d0564cb893b6e84b43cae67b1\system.management.automation.pdb not found symsrv:  c:\tools\diag\debugging tools windows\x64\sym\system.management.automation.pdb\6b8b8f14d0564cb893b6e84b43cae67b1\system.management.automation.pdb not found dbghelp: system.management.automation.ni - public symbols         c:\symbols\dbg\system.management.automation.pdb\6b8b8f14d0564cb893b6e84b43cae67b1\system.management.automation.pdb 

i've checked debug header in .dll file , has 2 entries:

ps> dumpbin /headers .\system.management.automation.ni.dll ...   debug directories         time type        size      rva  pointer     -------- ------- -------- -------- --------     56befbc1 cv           11c 01f200a4  1f1e8a4    format: rsds, {a8669807-4f28-597f-1fc5-ceabfed6fed6}, 1, system.management.automation.ni.pdb     56befbc1 cv            39 01f201c0  1f1e9c0    format: rsds, {6b8b8f14-d056-4cb8-93b6-e84b43cae67b}, 1, system.management.automation.pdb ... 

the a8669807-4f28-597f-1fc5-ceabfed6fed6 entry first, seems never used dbh (or dbghelp), , looking 6b8b8f14-d056-4cb8-93b6-e84b43cae67b. tried setting symbols path c:\symbols\ngen, didn't - symbol file still not found.

my dbghelp version is: 10.0.10240.16399

can point me i'm doing wrong here?

edit 1:

seems dbh verbose output pretty consistent procmon showing:

screenshot of process monitor

edit 2 (to hans answer)

my application powershell script. listed .net modules powershell.exe in process hacker , found it's using system.management.automation.dll version 3.0.0:

screenshot of loaded assemblies

i suppose original assembly located in gac: c:\windows\microsoft.net\assembly\gac_msil\system.management.automation\v4.0_3.0.0.0__31bf3856ad364e35\system.management.automation.dll

which apparently created .net 4.0:

ps temp> corflags c:\windows\microsoft.net\assembly\gac_msil\system.management.automation\v4.0_3.0.0.0__31bf3856ad364e35\system.management.automation.dll microsoft (r) .net framework corflags conversion tool.  version  4.6.1055.0 copyright (c) microsoft corporation.  rights reserved. version   : v4.0.30319 clr header: 2.5 pe        : pe32 corflags  : 0x9 ilonly    : 1 32bitreq  : 0 32bitpref : 0 signed    : 1 

now, i've looked other system.management.automation assemblies in nativeimages folder, there 1 .net 4.0 64-bit:

screenshot

the .aux header seems mention 3.0.0 version. notice .ni file has 2 pdb files referenced in debug header. 1 of them 1 want.

edit 3 (fuslogvw)

as advised hans enabled fusion log native images. below snippet showing path automation assembly loaded:

... pre-bind state information ... log: displayname = system.management.automation, version=3.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35  (fully-specified) log: appbase = file:///c:/windows/system32/windowspowershell/v1.0/ log: initial privatepath = null log: dynamic base = null log: cache base = null log: appname = powershell.exe calling assembly : microsoft.powershell.consolehost, version=3.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35. ... log: start validating dependencies. log: [level 1]start validating native image dependency mscorlib, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089. log: [level 1]start validating native image dependency system, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089. log: [level 1]start validating il dependency microsoft.management.infrastructure, version=1.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35. log: [level 1]start validating native image dependency system.core, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089. log: [level 1]start validating il dependency system.configuration.install, version=4.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a. log: [level 1]start validating il dependency system.transactions, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089. log: [level 1]start validating il dependency system.xml, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089. log: [level 1]start validating il dependency microsoft.management.infrastructure.native, version=1.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35. log: [level 1]start validating il dependency system.management, version=4.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a. log: [level 1]start validating il dependency system.configuration, version=4.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a. log: [level 1]start validating il dependency system.directoryservices, version=4.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a. log: [level 1]start validating il dependency system.runtime.serialization, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089. log: [level 1]start validating il dependency microsoft.csharp, version=4.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a. log: [level 1]start validating il dependency system.servicemodel.internals, version=4.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35. log: [level 1]start validating il dependency system.data, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089. log: [level 1]start validating il dependency system.numerics, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089. log: [level 1]start validating il dependency system.security, version=4.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a. log: [level 1]start validating il dependency smdiagnostics, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089. native image has correct version information. log: validation of dependencies succeeded. log: bind native image succeeded. attempting use native image c:\windows\assembly\nativeimages_v4.0.30319_64\system.manaa57fc8cc#\a86698074f28597f1fc5ceabfed6fed6\system.management.automation.ni.dll. native image used. 

unfortunately, think bug in either dbghelp or ngen. created test.dll assembly , ngen-ed it:

ngen install test.dll 

it landed in:

c:\windows\assembly\nativeimages_v4.0.30319_64\test\7dece650b5d91e7ac799a78b3d1b7c59\test.ni.dll

as expected. created symbols it:

ngen createpdb c:\windows\assembly\nativeimages_v4.0.30319_64\test\7dece650b5d91e7ac799a78b3d1b7c59\test.ni.dll c:\symbols\ngen 

when checked debug headers got 2 again:

> dumpbin /headers c:\windows\assembly\nativeimages_v4.0.30319_64\test\7dece650b5d91e 7ac799a78b3d1b7c59\test.ni.dll   debug directories         time type        size      rva  pointer     -------- ------- -------- -------- --------     5824bfeb cv           11c 00003d40     1f40    format: rsds, {7dece650-b5d9-1e7a-c799-a78b3d1b7c59}, 1, test.ni.pdb     5824bfeb cv           11c 00002e5c     205c    format: rsds, {f32eb2ce-973c-438f-bb78-a24d9971c194}, 1, c:\temp\test.pdb 

when tried load symbols test.ni.dll, dbh tried load .pdb file f32eb2ce-973c-438f-bb78-a24d9971c194 signatue (which wrong). opened hex editor, , replaced order in debug directories listed in pe file (i found them timestamps :)):

enter image description here

now, dumpbin showed them in different order:

time     type        size      rva  pointer -------- ------- -------- -------- -------- 5824bfeb cv           11c 00002e5c     205c    format: rsds, {f32eb2ce-973c-438f-bb78-a24d9971c194}, 1, c:\temp\test.pdb 5824bfeb cv           11c 00003d40     1f40    format: rsds, {7dece650-b5d9-1e7a-c799-a78b3d1b7c59}, 1, test.ni.pdb 

and dbh started working correctly:

> dbh -n -s:srv*c:\symbols\ngen* c:\windows\assembly\nativeimages_v4.0.30319_64\test\ 7dece650b5d91e7ac799a78b3d1b7c59\test.ni.dll verbose mode on. dbghelp: symbol search path: srv*c:\symbols\ngen* symbol search path: srv*c:\symbols\ngen* dbghelp: no header c:\windows\assembly\nativeimages_v4.0.30319_64\test\7dece650b5d91e7ac799a78b3d1b7c59\test.ni.dll.  searching image on disk dbghelp: c:\windows\assembly\nativeimages_v4.0.30319_64\test\7dece650b5d91e7ac799a78b3d1b7c59\test.ni.dll - ok dbghelp: test.ni - public symbols & lines         c:\symbols\ngen\test.ni.pdb\7dece650b5d91e7ac799a78b3d1b7c591\test.ni.pdb test.ni [1000000]: 

i created issue on connect , kindly ask upvote it.


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -