Ticket #13 (closed defect: fixed)

Opened 6 years ago

Last modified 6 years ago

network accept returns server port number rather than client in some environments

Reported by: Bart Massey <bart@…> Owned by:
Priority: minor Milestone: 2.2.1.2
Component: network Version: 2.0
Keywords: Cc:

Description

I have a number of machines running Debian Linux. Most of them are running it in 32-bit mode. I also have a work machine that is an AMD64.

On the AMD64 machine, Network.accept returns the server port number rather than the client port number. This seems to be true with ghc-6.8.3 and ghc-6.10.1, and with network-2.2.0.1 and network-2.2.1.2. It does not seem to happen on my 32-bit machines.

Even when the wrong port number is returned, the handle seems to be perfectly good.

Reproduce by running the attached test code and then telnetting to it.

Change History

Changed 6 years ago by bos

  • status changed from new to closed
  • resolution set to fixed

Fixed in darcs.

Changed 6 years ago by anonymous

It turns out that the problem is not entirely a 64-bit problem. On the affected machine, my student made the bug reliably disappear by switching to libc6 2.9-4, and reliably reappear by switching back to libc6 2.7-15. The corresponding C program works fine with both libc versions, so this is apparently something specific to Network.accept. libc6 2.7-15 works fine on one of my 32-bit machines, so apparently it does have something to do with 64 bit. The final score:

Failed to reproduce the bug:

  • barton: 64-bit, kernel 2.6.28.7, libc6 2.9, network 2.2.0.1, ghc 6.10.1
  • po8: 32-bit, kernel 2.6.24, libc6 2.7, network 2.1.0.0, ghc 6.8.1
  • po8: 32-bit, kernel 2.6.24, libc6 2.7, network 2.2.0.1, ghc 6.10.1
  • bartfan: 32-bit, kernel 2.6.28.9, libc6 2.9, network 2.2.0.1, ghc 6.10.1
  • svcs: 64-bit, kernel 2.6.26, libc6 2.9, network 2.2.1.2, ghc 6.10.1

Faithfully reproduced the bug:

  • svcs: 64-bit, kernel 2.6.26, libc6 2.7, network 2.2.1.2, ghc 6.10.1
  • barton: 64-bit, kernel 2.6.28.7, libc6 2.7, network 2.2.0.1, ghc 6.10.1

Have fun!

Note: See TracTickets for help on using tickets.