From nobody Fri Nov 26 06:02:08 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 3AA5418AD097 for ; Fri, 26 Nov 2021 06:02:09 +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 4J0kfS0vWRz3Kcd for ; Fri, 26 Nov 2021 06:02:08 +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 D5BC12B741 for ; Fri, 26 Nov 2021 06:02:07 +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 1AQ6270w099926 for ; Fri, 26 Nov 2021 06:02:07 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 1AQ627it099925 for bugs@FreeBSD.org; Fri, 26 Nov 2021 06:02:07 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 260055] recvmsg / IP_RECVDSTADDR issue Date: Fri, 26 Nov 2021 06:02:08 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 12.2-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: eugen@freebsd.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter cc Message-ID: 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637906528; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BbAbDzTZT1BCR74VkbuCK+4kQl/Sb1SUW2TYVyjib9c=; b=EZB3rtIrg2/UTjIRvzXEmdtW/zTmfF31udxnVcYrPyiJ7CcN6a/BWBz/CMw2x5XNvFC/e1 9IgZfJ8TNmMrgb71AgumVqK8iAWQHn+AvsLxKyKN/4uHlcw/6pShUUSCv9uyUDYBZ/1XbP Z3BoTRy2D8A53XclpujHenhLkWE7vu7DD31HS+SCuPLDJJCvsYFVCXLBcj+TOqvFWM/i1X mgbU31zHgFG78xJOl0e/jxARBkQcRTQeDEmdPlG9T4GXMptn/fqq5JDNQwfOwrUGv+ovom w/bo+SdcxXBY9BRqTF8DVSofPcN5x9n9dT/kIWNAPxiB7M7oMf7TY4kj7uf34Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637906528; a=rsa-sha256; cv=none; b=V79nhTTPWcY0w9H2XfLpQ5eDCeO5AZTFNx0g3y/stLoTR/i6M3ytqboOmweaePMpn4gFeg 7+LwFJyq1MeZ0v2VPzYdYH4NeAHQ3RqA3Y8crcFrsdZhMfnXzr/skyGrmqXhMpEls4ThQX jV5r2OTEZMd1vjZqfMOKNM/yNKMxBpIw+pDoVrmrqs2MrPtDuT64FKvmDP1MSsJ1XZdQNZ 0U1FVEksDVZ4fO0WcpR/ORFYnl7TwVfJl5w39K+Cl+7d9hGpe3+2Q2foaj/RSY2Aadp4Oq uVHjFm6KGR9511maFkYhbTdH6yqGN6NfYUqdvLeqtpBLDIhtI33OicuK4t/Y3Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D260055 Bug ID: 260055 Summary: recvmsg / IP_RECVDSTADDR issue Product: Base System Version: 12.2-STABLE Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: eugen@freebsd.org CC: kib@FreeBSD.org, mav@FreeBSD.org Multi-protocol daemon net/mpd5 that includes L2TP server implementation recently got ability to use IP_RECVDSTADDR IPv4 UDP socket option to support multi-homed configurations without multiple single-IP sub-configurations. Since then, users observe strange "hangs" of L2TP server when it stops processing new incoming connections for hours (if not killed). It may "unha= ng" after several hours if left in this state and continue to work normally unt= il next hang. This problem observed under FreeBSD versions 11, 12 and 13. I have it, too. I've rebult binary with debugging symbols and got coredump = with SIGQUIT when problem occured. Here is a backtrace that shows it blocks on recvmsg() trying to obtain source address of UDP socket: (gdb) thread apply all bt Thread 1 (process 100333): #0 0x2853a6e3 in _recvmsg () from /lib/libc.so.7 #1 0x2844f0c1 in pthread_suspend_all_np () from /lib/libthr.so.3 #2 0x284d118f in recvmsg () from /lib/libc.so.7 #3 0x080dea71 in GetSockDstAddress (sock=3D24, addr=3D0x28c484e8) at util.= c:1581 #4 0x0806c48a in L2tpServerEvent (type=3D1, arg=3D0x28c47048) at l2tp.c:14= 19 #5 0x080a1e4f in EventHandler (arg=3D0x28c47068) at event.c:146 #6 0x080ea7de in pevent_ctx_execute (arg=3D0x28c139b4) at contrib/libpdel/util/pevent.c:884 #7 0x080ea354 in pevent_ctx_service (ev=3D0x28c139b4) at contrib/libpdel/util/pevent.c:773 #8 0x080e9e33 in pevent_ctx_main (arg=3D0x28a41004) at contrib/libpdel/util/pevent.c:719 #9 0x2844c2c2 in pthread_create () from /lib/libthr.so.3 #10 0x00000000 in ?? () (gdb) frame 3 #3 0x080dea71 in GetSockDstAddress (sock=3D24, addr=3D0x28c484e8) at util.= c:1581 1581 if ((size =3D recvmsg(sock, &b.msg, 0)) < 0) { (gdb) p b $1 =3D {msg =3D {msg_name =3D 0x0, msg_namelen =3D 0, msg_iov =3D 0xbbbfd33= 4, msg_iovlen =3D 1, msg_control =3D 0xbbbfd340, msg_controllen =3D 16, msg_flags =3D 0}, io= v =3D {iov_base =3D 0xbbbfd354, iov_len =3D 1024}} There is corresponding source code, function GetSockDstAddress() https://sourceforge.net/p/mpd/svn/HEAD/tree/trunk/src/util.c#l1553 FreeBSD base system has not many consumers of IP_RECVDSTADDR socket options: src/contrib/pf/tftp-proxy src/contrib/unbound contrib/bsnmp/snmpd None of them is threaded application like net/mpd5. I suspect an issue in threaded iplementation of this socket option that leads to long time block = of recvmsg(). --=20 You are receiving this mail because: You are the assignee for the bug.=