Bug 30018

Summary: Use "Dns.GetHostEntry" or "Dns.GetHostByName",sometime throw error "Cannot handle address family xxxxx"
Product: [Mono] Class Libraries Reporter: Alex Lin <linqingfeng>
Component: System.Net.HttpAssignee: Bugzilla <bugzilla>
Severity: normal CC: aaron, alkpli, angeloyz, dudu.yz, fryderyk.huang, joao.matos, kumpera, mono-bugs+mono, narinder.claire, peter.collins
Priority: ---    
Version: 4.0.0   
Target Milestone: (C6SR1)   
Hardware: PC   
OS: Linux   
Tags: Is this bug a regression?: ---
Last known good build:

Description Alex Lin 2015-05-13 04:42:58 UTC
Use "Dns.GetHostEntry" or "Dns.GetHostByName",sometime throw error "Cannot handle address family xxxxx"

error message


Cannot handle address family 53936

  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.Net.Dns.GetHostByName_internal (string,string&,string[]&,string[]&) <0xffffffff>
  at System.Net.Dns.GetHostByName (string) <0x0004d>
  at System.Net.ServicePoint.get_HostEntry () <0x00223>
  at System.Net.WebConnection.Connect (System.Net.HttpWebRequest) <0x001d4>
  at System.Net.WebConnection.InitConnection (object) <0x00312>
  at System.Net.WebConnection.<WebConnection>m__0 (object) <0x00024>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object (object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

        mono() [0x4b8028]
        /lib/x86_64-linux-gnu/libpthread.so.0(+0x10340) [0x7f5534098340]
        /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x39) [0x7f5533cf9cc9]
        /lib/x86_64-linux-gnu/libc.so.6(abort+0x148) [0x7f5533cfd0d8]
        mono() [0x62d029]
        mono() [0x62d22f]
        mono() [0x62d2d2]
        mono() [0x628aa5]
        mono() [0x57e74e]

Debug info from gdb:

Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.


my environment:
OS: Ubuntu 14.04, 64 bit
Comment 1 dudu 2015-06-26 22:53:43 UTC
Same issue on Mono JIT compiler version 4.3.0 (master/a5f77b1 Fri Jun 26 13:57:47 CST 2015).
Comment 2 dudu 2015-06-30 02:52:02 UTC
It can be fixed by clearing dns client cache with "service nscd restart" command.
Comment 3 Narinder 2015-08-14 04:58:47 UTC
I also see this issue. I am using :
Mono JIT compiler version 4.0.2 ((no/c99aa0c Wed Jun 24 13:39:51 BST 2015)

I get a crash on Debian 8 but NOT on Debian 7
Comment 4 fryderyk.huang 2015-10-02 07:42:33 UTC
disable IPv6 and you're golden
Comment 5 Narinder 2015-10-06 02:00:35 UTC
I believe this issue is linked to this bug :


Comment 6 João Matos 2015-10-22 07:42:39 UTC
Should be fixed by https://github.com/mono/mono/commit/be1d9a7fe207f86fe7033cb49dea0e9a367ece79.
Comment 7 Rodrigo Kumpera 2015-10-23 00:19:06 UTC
João, could you add this one to C6SR1?
Comment 8 Alexander Köplinger [MSFT] 2015-11-03 18:43:36 UTC
*** Bug 35509 has been marked as a duplicate of this bug. ***
Comment 9 Alexander Köplinger [MSFT] 2015-11-06 11:57:35 UTC
@Joao: aspnet5 is hitting this pretty regularly, it would be great to get this into C6SR1 :)
Comment 10 Alexander Köplinger [MSFT] 2015-11-09 15:22:17 UTC
Since Joao is FTO, I've created the Trello card for backporting this to C6SR1: https://trello.com/c/2MibizOG/101-mono-bug-30018
Comment 11 zed 2015-12-17 03:26:52 UTC
is this bug fixed in 4.2.1? I still get this mono core dump error on ubuntu .

Mono JIT compiler version 4.2.1 (Stable Thu Nov 12 09:52:44 UTC 2015)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
	TLS:           __thread
	SIGSEGV:       altstack
	Notifications: epoll
	Architecture:  amd64
	Disabled:      none
	Misc:          softdebug 
	LLVM:          supported, not enabled.
	GC:            sgen
Comment 12 Alexander Köplinger [MSFT] 2015-12-17 11:39:19 UTC
@zed: it will be available in Service Release 1, which is in the alpha channel right now: http://www.mono-project.com/download/alpha/.
Comment 13 zed 2015-12-18 07:44:07 UTC
great, that did work! thanks Alex!