Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hang in System.Buffer Memmove #266

Open
clairernovotny opened this issue May 9, 2020 · 9 comments
Open

Hang in System.Buffer Memmove #266

clairernovotny opened this issue May 9, 2020 · 9 comments

Comments

@clairernovotny
Copy link
Member

When trying to convert a particular Windows PDB to portable, the method hangs. Stack trace and repro files attached.
AWSSDK.2.3.55.2.nupkg.zip [rename to remove the .zip, it's a nupkg file].

It's using lib\net35\AWSSDK.dll as the PE stream and lib\net35\AWSSDK.pdb as the PDB.

It's using
.NET Core SDK (reflecting any global.json):
Version: 5.0.100-preview.3.20216.6
Commit: 9f62a32109

 	[Managed to Native Transition]	
 	System.Private.CoreLib.dll!System.Buffer._Memmove(ref byte dest, ref byte src, ulong len)	Unknown
 	System.Private.CoreLib.dll!System.Buffer.Memmove(ref byte dest, ref byte src, ulong len)	Unknown
 	System.Private.CoreLib.dll!System.Runtime.InteropServices.Marshal.CopyToNative<byte>(byte[] source, int startIndex, System.IntPtr destination, int length)	Unknown
 	System.Reflection.Metadata.dll!System.Reflection.Internal.StreamExtensions.CopyTo(System.IO.Stream source, byte* destination, int size)	Unknown
 	System.Reflection.Metadata.dll!System.Reflection.Internal.StreamMemoryBlockProvider.ReadMemoryBlockNoLock(System.IO.Stream stream, bool isFileStream, long start, int size)	Unknown
 	System.Reflection.Metadata.dll!System.Reflection.Internal.StreamMemoryBlockProvider.GetMemoryBlockImpl(int start, int size)	Unknown
 	System.Reflection.Metadata.dll!System.Reflection.PortableExecutable.PEReader.GetPESectionBlock(int index)	Unknown
 	System.Reflection.Metadata.dll!System.Reflection.PortableExecutable.PEReader.GetSectionData(int relativeVirtualAddress)	Unknown
 	System.Reflection.Metadata.dll!System.Reflection.Metadata.PEReaderExtensions.GetMethodBody(System.Reflection.PortableExecutable.PEReader peReader, int relativeVirtualAddress)	Unknown
 	Microsoft.DiaSymReader.Converter.dll!Microsoft.DiaSymReader.Tools.PdbConverterWindowsToPortable.Convert(Microsoft.DiaSymReader.ISymUnmanagedReader5 symReader, System.Reflection.PortableExecutable.PEReader peReader, System.IO.Stream targetPdbStream, System.Reflection.Metadata.BlobContentId pdbId)	Unknown
 	Microsoft.DiaSymReader.Converter.dll!Microsoft.DiaSymReader.Tools.PdbConverterWindowsToPortable.Convert(System.Reflection.PortableExecutable.PEReader peReader, System.IO.Stream sourcePdbStream, System.IO.Stream targetPdbStream)	Unknown
 	Microsoft.DiaSymReader.Converter.dll!Microsoft.DiaSymReader.Tools.PdbConverter.ConvertWindowsToPortable(System.Reflection.PortableExecutable.PEReader peReader, System.IO.Stream sourcePdbStream, System.IO.Stream targetPdbStream)	Unknown
 	Microsoft.DiaSymReader.Converter.dll!Microsoft.DiaSymReader.Tools.PdbConverter.ConvertWindowsToPortable(System.IO.Stream peStream, System.IO.Stream sourcePdbStream, System.IO.Stream targetPdbStream)	Unknown
>	Core.dll!NuGetPe.AssemblyMetadata.AssemblyDebugParser.AssemblyDebugParser(System.IO.Stream peStream, System.IO.Stream pdbStream) Line 36	C#


@clairernovotny clairernovotny changed the title Hang on ConvertWindowsToPortable Hang in System.Buffer Memmove May 9, 2020
@clairernovotny clairernovotny transferred this issue from dotnet/symreader-converter May 9, 2020
@ghost
Copy link

ghost commented May 9, 2020

Tagging subscribers to this area: @tannergooding
Notify danmosemsft if you want to be subscribed.

@benaadams
Copy link
Member

In the native call __Memmove?

/cc @jkotas

@EgorBo
Copy link
Member

EgorBo commented May 9, 2020

Are you sure it's not just some infinite loop that just spends a lot of time in Memmove?

@clairernovotny
Copy link
Member Author

@EgorBo I couldn't tell you that, I just know the call never completes.

Easiest repro (for me) is in opening the attached NuGet package in the latest NuGet Package Explorer. Symbol validation never completes and breaking in the debugger shows the above callstack.

@clairernovotny
Copy link
Member Author

I see 02 on the CPU usage for the process out of 56 logical cores. It appears to be burning a core.

@benaadams
Copy link
Member

_Memmove doesn't look like the only call stack, if it is the highest

Infinite loop in Microsoft.DiaSymReader.Tools.PdbConverterWindowsToPortable.Convert ?

image

@benaadams
Copy link
Member

Bit more filtered
image

@EgorBo
Copy link
Member

EgorBo commented May 9, 2020

I also tried it locally and if you are lucky enough, the stacktrace starts from Kernel32.LocalFree instead 🙂

@danmoseley
Copy link
Member

This should be moved to https://github.com/dotnet/symreader-portable for investigation

@clairernovotny clairernovotny transferred this issue from dotnet/runtime May 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants