From nobody Sat Jul 24 01:47:00 2021 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9FB7112A809D for ; Sat, 24 Jul 2021 01:47:00 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GWpvm3qbgz4rKM for ; Sat, 24 Jul 2021 01:47:00 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C6552F653 for ; Sat, 24 Jul 2021 01:47:00 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 16O1l03P025931 for ; Sat, 24 Jul 2021 01:47:00 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 16O1l0ej025930 for bugs@FreeBSD.org; Sat, 24 Jul 2021 01:47:00 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 257368] ggate(d) misbehaving Date: Sat, 24 Jul 2021 01:47:00 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 12.2-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: johannes@jo-t.de X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N 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.=