Date: Sat, 24 Jul 2021 01:47:00 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 257368] ggate(d) misbehaving Message-ID: <bug-257368-227-XhMkt8fve2@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-257368-227@https.bugs.freebsd.org/bugzilla/> References: <bug-257368-227@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D257368 --- Comment #4 from johannes@jo-t.de --- > Looks like the code is expecting to be able to send/receive pretty huge p= ackets as is, instead of breaking it up into smaller chunks. Ignore that, found the helper function that breaks it up. Here's a truss of ggated: debug: Received hdr packet. 2008: write(1,"debug: Received hdr packet.\n",28) =3D 28 (0x1c) debug: recv_thread: offset=3D16384 length=3D2147467264 2008: write(1,"debug: recv_thread: offset=3D16384"...,51) =3D 51 (0x33) 2008: mmap(0x0,2147487744,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0= ) =3D 56795097997312 (0x33a7a3a42000) 2008: mmap(0x0,6291456,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = =3D 56797253623808 (0x33a824206000) 2008: munmap(0x33a824206000,6291456) =3D 0 (0x0) 2008: mmap(0x0,8384512,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = =3D 56797253255168 (0x33a8241ac000) 2008: munmap(0x33a8241ac000,344064) =3D 0 (0x0) 2008: munmap(0x33a824800000,1748992) =3D 0 (0x0) 2008: _umtx_op(0x33a783f9f1b8,UMTX_OP_NWAKE_PRIVATE,0x1,0x0,0x0) =3D 0 (0x= 0) 2008: _umtx_op(0x33a77e55dfd0,UMTX_OP_WAIT_UINT_PRIVATE,0x0,0x0,0x0) =3D 0= (0x0) debug: disk_thread: offset=3D16384 length=3D2147467264 2008: write(1,"debug: disk_thread: offset=3D16384"...,51) =3D 51 (0x33) 2008: pread(7,"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"...,2147467264,0x4000) =3D 2147467264 (0x7fffc000) 2008: _umtx_op(0x33a783f9e2b8,UMTX_OP_NWAKE_PRIVATE,0x1,0x0,0x0) =3D 0 (0x= 0) 2008: _umtx_op(0x33a794e63008,UMTX_OP_WAIT_UINT_PRIVATE,0x0,0x0,0x0) =3D 0= (0x0) debug: send_thread: offset=3D16384 length=3D2147467264 2008: write(1,"debug: send_thread: offset=3D16384"...,51) =3D 51 (0x33) 2008: sendto(6,"\0\0\0\0\0\0\0@\0\^?\M^?\M-@\0\0"...,23,0,NULL,0) =3D 23 (= 0x17) debug: Sent hdr packet. 2008: write(1,"debug: Sent hdr packet.\n",24) =3D 24 (0x18) 2008: sendto(6,"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"...,131072,0,NULL,0) =3D = 131072 (0x20000) 2008: sendto(6,"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"...,131072,0,NULL,0) =3D = 131072 (0x20000) 2008: sendto(6,"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"...,131072,0,NULL,0) =3D = 131072 (0x20000) 2008: recvfrom(8,0x33a796ff97b0,23,MSG_WAITALL,NULL,0x0) =3D 0 (0x0) 2008: getpid() =3D 2008 (0x7d8) debug: Process 2008 exiting. 2008: write(1,"debug: Process 2008 exiting.\n",29) =3D 29 (0x1d) 2008: sendto(6,"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"...,131072,0,NULL,0) =3D = 131072 (0x20000) We can see that ggated allocs a big chunk of mem and successfully reads data into it and then tries to send it off, in chunks of 128kB. So far so good. But then the receive thread notices that it did not read a full header and = thus exits and the whole process dies only having sent 4x128kB. Smells like a race condition? --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-257368-227-XhMkt8fve2>