Summary: IPv6 bug in TcpClient calling Socket.Bind()
           Product: Mono: Runtime
           Version: 2.0.x
          Platform: i686
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: remoting
          Found By: Development

Trying to debug why a c# IRC client did not connect through IPv6, I've found
out that a bug probably exists in TcpClient calling Bind(). I'm attaching a
simple testcase, with a server and a client both communicating locally with

Also, I believe it's the internal call of Bind() from TcpClient that is buggy,
since an implementation with the lower-level Socket class is successful.

Here's the mdb run (sorry I've not been able to go further):

$ mdb ./Client/bin/Debug/Client.exe 
Mono Debugger
(mdb) run
Starting program: ./Client/bin/Debug/Client.exe 
Thread @1 stopped at #0: 0xb79547b9 in ipv6.Client.Main(string[])+0x9 at
  31                    if (!Socket.OSSupportsIPv6) {
(mdb) c

Unhandled Exception: System.Net.Sockets.SocketException: Invalid arguments
  at System.Net.Sockets.Socket.Bind (System.Net.EndPoint local_end) [0x0006c]
in /tmp/buildd/mono-2.0.1/mcs/class/System/System.Net.Sockets/Socket.cs:2038 
  at System.Net.Sockets.TcpClient..ctor (AddressFamily family) [0x0002c] in
  at ipv6.Client.Main (System.String[] args) [0x00028] in
Thread @1 caught unhandled exception at #0: 0xb700d77b in
0xb700d77b      add    %ch,0xffffffe4(%eax)
(mdb) f
#0: 0xb700d77b in System.Net.Sockets.Socket.Bind(System.Net.EndPoint)+0xeb
0xb700d77b      add    %ch,0xffffffe4(%eax)
(mdb) show locals
ERROR: Selected stack frame has no method.
(mdb) show params
ERROR: Selected stack frame has no method.
(mdb) up
#1: 0xb700d4de in
System.Net.Sockets.TcpClient..ctor(System.Net.Sockets.AddressFamily)+0x56 at
0xb700d4de      call  
(mdb) show locals
(mdb) show params
family = (System.Net.Sockets.AddressFamily) InterNetworkV6
(mdb) up
#2: 0xb795481b in ipv6.Client.Main(string[])+0x6b at
  40                    TcpClient client = new
(mdb) show locals
b = (byte[]) null
client = <cannot display object>
ip = (System.Net.IPAddress) { m_Address = 0, m_Family = InterNetworkV6,
m_Numbers = 0x0008b6e0, 
   m_ScopeId = 0, m_HashCode = 0 }
iploop = (System.Net.IPAddress) { m_Address = 0, m_Family = InterNetworkV6, 
   m_Numbers = 0x000484a0, m_ScopeId = 0, m_HashCode = 0 }
IPv6_ADDR = (string) "::1"
(mdb) show params
args = (string[]) [ ]

Configure bugmail:
------- You are receiving this mail because: -------
You are the QA contact for the bug.
mono-bugs maillist  -

Reply via email to