Error with X11 Forwarding
Opened this issue · 1 comments
Users see 'could not bind local socket: Invalid argument' in their error stream when using qsub -X
. The error originates from
torque/src/lib/Libnet/port_forwarding.c
Line 440 in 8a0b748
It is because the get_local_address() function returns a sa_family=AF_INET struct but the loop at
torque/src/lib/Libnet/port_forwarding.c
Lines 420 to 446 in 8a0b748
I've submitted #458 as a potential fix, but should probably be revisited so that it will work with IPv6. Note that the IPv6 limitation is one of get_local_address() and not the patch.
An example from strace of it trying to bind a mismatched AF_ family and then succeeding on the second:
[pid 27167] socket(AF_INET6, SOCK_STREAM, IPPROTO_IP) = 8
[pid 27167] bind(8, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("redacted")}, 16) = -1 EINVAL (Invalid argument)
[pid 27167] write(2, "could not bind local socket: Inv"..., 45) = 45
[pid 27167] close(8) = 0
[pid 27167] socket(AF_INET, SOCK_STREAM, IPPROTO_IP) = 8
[pid 27167] bind(8, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("redacted")}, 16) = 0