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

regression: System.Net.Dns.GetHostAddresses crashes #7900

Closed
Spongman opened this issue Dec 3, 2019 · 3 comments · Fixed by #7901
Closed

regression: System.Net.Dns.GetHostAddresses crashes #7900

Spongman opened this issue Dec 3, 2019 · 3 comments · Fixed by #7901

Comments

@Spongman
Copy link

@Spongman Spongman commented Dec 3, 2019

1.0.0-alpha-28402-01

I'm seeing a failure where HttpClient is crashing trying to make a connection, i have narrowed it down to DNS resolution.

here's a zip containing a repro project:
wslbug.zip

class Foo
{
	static void Main(string[] args)
	{
		System.Net.Dns.GetHostAddresses("microsoft.com");
	}
}

on windows:

c:\play\wslbug\>dotnet publish -r win-x64 -c Debug && bin\Debug\netcoreapp3.0\win-x64\publish\wslbug.exe
Microsoft (R) Build Engine version 16.3.0+0f4c62fea for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restore completed in 26.93 ms for C:\play\wslbug\wslbug.csproj.
  wslbug -> C:\play\wslbug\bin\Debug\netcoreapp3.0\win-x64\wslbug.dll
  Generating native code
EXEC : warning : RD.XML processing will change before release (https://github.com/dotnet/corert/issues/5001) [C:\play\wslbug\wslbug.csproj]
  wslbug -> C:\play\wslbug\bin\Debug\netcoreapp3.0\win-x64\publish\
Unhandled Exception: System.Exception: Method '[System.Net.NameResolution]Interop+Winsock.GetAddrInfoW(string,string,AddressInfo*,AddressInfo**)' requires marshalling that is not yet supported by this compiler.
   at Interop.Winsock.GetAddrInfoW(String, String, Interop.Winsock.AddressInfo*, Interop.Winsock.AddressInfo**) + 0x49
   at System.Net.NameResolutionPal.TryGetAddrInfo(String, Boolean, String&, String[]&, IPAddress[]&, Int32&) + 0xd4
   at System.Net.Dns.GetHostEntryOrAddressesCore(String, Boolean) + 0x61
   at System.Net.Dns.GetHostAddressesCore(String) + 0x22
   at System.Net.Dns.GetHostAddresses(String) + 0x23f
   at Foo.Main(String[]) + 0x21
   at wslbug!<BaseAddress>+0x364d47
   at wslbug!<BaseAddress>+0x364dcd

on Ubuntu 18.04:

/mnt/c/play/wslbug$ dotnet publish -r linux-x64 -c Debug && bin/Debug/netcoreapp3.0/linux-x64/publish/wslbug
Microsoft (R) Build Engine version 16.3.2+e481bbf88 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restore completed in 157.92 ms for /mnt/c/play/wslbug/wslbug.csproj.
  wslbug -> /mnt/c/play/wslbug/bin/Debug/netcoreapp3.0/linux-x64/wslbug.dll
  /usr/lib/llvm-7/bin/clang
  Generating native code
EXEC : warning : RD.XML processing will change before release (https://github.com/dotnet/corert/issues/5001) [/mnt/c/play/wslbug/wslbug.csproj]
  wslbug -> /mnt/c/play/wslbug/bin/Debug/netcoreapp3.0/linux-x64/publish/
Unhandled Exception: System.Exception: Method '[System.Net.NameResolution]Interop+Sys.GetHostEntryForName(string,HostEntry*)' requires marshalling that is not yet supported by this compiler.
   at Interop.Sys.GetHostEntryForName(String, Interop.Sys.HostEntry*) + 0x41
   at System.Net.NameResolutionPal.TryGetAddrInfo(String, Boolean, String&, String[]&, IPAddress[]&, Int32&) + 0x87
   at System.Net.Dns.GetHostEntryOrAddressesCore(String, Boolean) + 0x58
   at System.Net.Dns.GetHostAddressesCore(String) + 0x22
   at System.Net.Dns.GetHostAddresses(String) + 0x23e
   at Foo.Main(String[]) + 0x21
   at wslbug!<BaseAddress>+0x33c8d7
   at wslbug!<BaseAddress>+0x33c95d
Aborted (core dumped)

of course, if i run .exe./.dll version with the core runtime, it work fine.

jkotas added a commit to jkotas/corert that referenced this issue Dec 3, 2019
@jkotas

This comment has been minimized.

Copy link
Member

@jkotas jkotas commented Dec 3, 2019

@Spongman Thank you for the bug report! The fix will be available in next build.

@jkotas jkotas closed this in #7901 Dec 3, 2019
jkotas added a commit that referenced this issue Dec 3, 2019
Fixes #7900
@jkotas

This comment has been minimized.

Copy link
Member

@jkotas jkotas commented Dec 3, 2019

The fixed build is available now. Let us know if you run into any other issues.

@Spongman

This comment has been minimized.

Copy link
Author

@Spongman Spongman commented Dec 3, 2019

excellent, thanks for the quick turnaround, that works great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.