Any feedback ?

On Sat, May 31, 2014 at 12:47 AM, Alexandre Ferrieux <alexandre.ferrieux@gmail.com> wrote:


Below is the interesting part: the parent (6517) connects in v6 to the local server, which is the child (6529).
I'm not familiar with the fd dance at play here, with async sockets of various families, the fastest closing the others, and I'm not sure whom (the parent or the child) 6531 is the notifer of .

However, I do see that the deadlock is due to the child expecting some bytes down the (accepted) socket, and never getting them:

      6529  21:18:12.730608 recvfrom(6,  <unfinished ...>

Which is kinda strange since the server code doesn't try any IO on $s:

            set server [socket -server accept -myaddr ::1 0]
            proc accept {s h p} {set ::x $s}
            puts [lindex [fconfigure $server -sockname] 2]
            flush stdout
            vwait x
            puts [gets $x]

Does that help ?

-Alex

6517  21:18:12.729957 bind(8, {sa_family=AF_INET6, sin6_port=htons(0), inet_pton(AF_INET6, "::", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 28) = 0
6517  21:18:12.730011 connect(8, {sa_family=AF_INET6, sin6_port=htons(56997), inet_pton(AF_INET6, "::1", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 28 <unfinished ...>
6531  21:18:12.730088 <... select resumed> ) = 1 (in [5])
6517  21:18:12.730113 <... connect resumed> ) = 0
6531  21:18:12.730163 futex(0x2064d04, FUTEX_CMP_REQUEUE_PRIVATE, 1, 2147483647, 0x2008270, 2 <unfinished ...>
6517  21:18:12.730188 close(5 <unfinished ...>
6531  21:18:12.730215 <... futex resumed> ) = 1
6529  21:18:12.730233 <... futex resumed> ) = 0
6517  21:18:12.730252 <... close resumed> ) = 0
6531  21:18:12.730282 select(6, [3], [], [], NULL <unfinished ...>
6529  21:18:12.730305 futex(0x2008270, FUTEX_WAKE_PRIVATE, 1 <unfinished ...>
6517  21:18:12.730322 close(7 <unfinished ...>
6529  21:18:12.730341 <... futex resumed> ) = 0
6517  21:18:12.730361 <... close resumed> ) = 0
6529  21:18:12.730390 accept(5,  <unfinished ...>
6517  21:18:12.730413 close(6 <unfinished ...>
6529  21:18:12.730433 <... accept resumed> {sa_family=AF_INET6, sin6_port=htons(50716), inet_pton(AF_INET6, "::1", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, [28]) = 6
6517  21:18:12.730456 <... close resumed> ) = 0
6529  21:18:12.730476 fcntl(6, F_SETFD, FD_CLOEXEC <unfinished ...>
6517  21:18:12.730493 ioctl(9, SNDCTL_TMR_TIMEBASE or TCGETS <unfinished ...>
6529  21:18:12.730518 <... fcntl resumed> ) = 0
6517  21:18:12.730582 <... ioctl resumed> , 0x7fffc058a4d0) = -1 ENOTTY (Inappropriate ioctl for device)
6529  21:18:12.730608 recvfrom(6,  <unfinished ...>
6517  21:18:12.730626 getsockname(9, 0x7fffc058a590, [16]) = -1 ENOTSOCK (Socket operation on non-socket)
6517  21:18:12.730666 wait4(6529,  <unfinished ...>