https://bugzilla.novell.com/show_bug.cgi?id=462688


           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
        AssignedTo: ll...@novell.com
        ReportedBy: d.pale...@gmail.com
         QAContact: mono-bugs@lists.ximian.com
          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
IPv6.

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
/home/neo/code/c-sharp/ipv6/Client/Client.cs:31.
  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
/tmp/buildd/mono-2.0.1/mcs/class/System/System.Net.Sockets/TcpClient.cs:87 
  at ipv6.Client.Main (System.String[] args) [0x00028] in
/home/neo/code/c-sharp/ipv6/Client/Client.cs:40 
Thread @1 caught unhandled exception at #0: 0xb700d77b in
System.Net.Sockets.Socket.Bind(System.Net.EndPoint)+0xeb.
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
/tmp/buildd/mono-2.0.1/mcs/class/System/System.Net.Sockets/TcpClient.cs:87
0xb700d4de      call  
0xb700d690:System.Net.Sockets.Socket.Bind(System.Net.EndPoint)
(mdb) show locals
(mdb) show params
family = (System.Net.Sockets.AddressFamily) InterNetworkV6
(mdb) up
#2: 0xb795481b in ipv6.Client.Main(string[])+0x6b at
/home/neo/code/c-sharp/ipv6/Client/Client.cs:40
  40                    TcpClient client = new
TcpClient(AddressFamily.InterNetworkV6);
(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[]) [ ]
(mdb)


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
_______________________________________________
mono-bugs maillist  -  mono-bugs@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to