From nobody Tue Jun 9 17:49:24 2026 X-Original-To: dev-commits-ports-all@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 4gZbyK1Ydsz6gMQV for ; Tue, 09 Jun 2026 17:49:29 +0000 (UTC) (envelope-from git@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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gZbyK1494z4QQ3 for ; Tue, 09 Jun 2026 17:49:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781027369; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rhWPmziNgVuFcFmxOradrscRTC/UZr0yYTOJLBmD0ZI=; b=pLzEoqQsqQKkzQ3Tts8kAhOVqf2+mOtO3M2Zielnbs9T17nRzbvDgWNqGWEXBkV2imZvqe Vx9AjHhzRxuhTaGxT3yVIisxYDUDsa1+K3H0P4R8xFOtoN4m9gCGsaju9hZdCEHGOq/x0r r5/XY0frhRtPgoDHCjQNhBj/VdxRcr3itmGUFITibutAUxw0VNgfZ2GWBtwZgu0X/9Cihb V47DVPZCllgdkFpxaN5mF9OInegrZOU+bv/WOxTdAEnFDx4Osm+/BHtc0XZgBhpSC2wGlE QuqEOJ+YBDU200aZ0lVIxWo0ADAJZytzUiigF6Nbsv2L96HgIlJaQWYYR4uAXA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781027369; a=rsa-sha256; cv=none; b=lRuEI8lqwwuIxd2M7nSr9TsNu0S6pHqEG+d1yQFKxtg//VOro7vefUZEZASReO4Rr0oqFI Phs6MatzW6cd9lsxprAXl4t9S+gEAnE3uC7MwuEvzcSQmJpaHM2YPDnSh2r4OJs4hcO4Ak Ar3ZpfBMmNG4si1Ul24xSmiu3rMJKEtDPyJD5z94FebFhrHcy8zNYj97cYeMxzC5Cn0Qe4 wSwF+oMf0r1wLwjkLkVPAEVdZw/+zy7niGnxmRC8jwIS3xGtYnvCy218SoU2AaEP6vVamW vMrTSirb4go7CuQRmDTGuowq0CevrSO0vITPoVHnO/mqzHqXJ/SlVENsleG61w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781027369; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rhWPmziNgVuFcFmxOradrscRTC/UZr0yYTOJLBmD0ZI=; b=ezbv7cRqK3VxoYkiBO9zFQtTsHtrJPoyghOunkVV/aUjN6PHTHse2iFsp+58T0DJccRf4C gSebWn7CwRSLOjU42F6mLOZWq8+/EUmdDU+TIaR16xGW/wpJsLkYjqoJ4pwYPhsbU+kvHJ oGbEB3irRK/+//PgrlB5S0JlZmejMAHjDLmn1j/ovC5KhPTp4auVL/fbAMSs0exE1nERir pCAnFUQg9wMZf/aFeHek7XcZxBHHNNWHzU9TTPrUK7ZoyXwvzqpdpa0g1qbx3uc8GBclwU ETruoJZL+kCtoXqXBxklgN4CeIl/if2nEfMqPbwHdXL/u0T4S7/fXM4aHu98dQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gZbyK0PyCzlDS for ; Tue, 09 Jun 2026 17:49:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 347dd by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 09 Jun 2026 17:49:24 +0000 To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Cc: PS From: Nuno Teixeira Subject: git: db15a1e6558a - main - net/eternalterminal: Fix etserver crashes List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-all@freebsd.org Sender: owner-dev-commits-ports-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eduardo X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: db15a1e6558a0fe310a8174ee2381ab8e98d4f60 Auto-Submitted: auto-generated Date: Tue, 09 Jun 2026 17:49:24 +0000 Message-Id: <6a285224.347dd.986784b@gitrepo.freebsd.org> The branch main has been updated by eduardo: URL: https://cgit.FreeBSD.org/ports/commit/?id=db15a1e6558a0fe310a8174ee2381ab8e98d4f60 commit db15a1e6558a0fe310a8174ee2381ab8e98d4f60 Author: PS AuthorDate: 2026-06-09 17:31:36 +0000 Commit: Nuno Teixeira CommitDate: 2026-06-09 17:48:33 +0000 net/eternalterminal: Fix etserver crashes Add backports to fix etserver crashes on session end and transient errors. PR: 295956 MFH: 2026Q2 --- net/eternalterminal/Makefile | 2 +- net/eternalterminal/files/patch-fix-crash-PR295956 | 113 +++++++++++++++++++++ 2 files changed, 114 insertions(+), 1 deletion(-) diff --git a/net/eternalterminal/Makefile b/net/eternalterminal/Makefile index b06ed1decac9..58d0ac3b460d 100644 --- a/net/eternalterminal/Makefile +++ b/net/eternalterminal/Makefile @@ -1,7 +1,7 @@ PORTNAME= eternalterminal DISTVERSIONPREFIX= et-v DISTVERSION= 6.2.11 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= net MAINTAINER= eduardo@FreeBSD.org diff --git a/net/eternalterminal/files/patch-fix-crash-PR295956 b/net/eternalterminal/files/patch-fix-crash-PR295956 new file mode 100644 index 000000000000..cfe3a864bc9b --- /dev/null +++ b/net/eternalterminal/files/patch-fix-crash-PR295956 @@ -0,0 +1,113 @@ +Add backports to fix etserver crashes on session end and transient errors. + +Backport from: +- a2d2e62d8d7b ("terminal: Fix etserver crash on session end due to ECHILD (#748)") +- c6650d9577f5 ("base: Fix etserver crash on transient accept() errors (#756)") + +--- src/base/UnixSocketHandler.cpp.orig 2025-07-22 01:37:18 UTC ++++ src/base/UnixSocketHandler.cpp +@@ -142,12 +142,28 @@ int UnixSocketHandler::accept(int sockFd) { + initSocket(client_sock); + VLOG(3) << "Client_socket inserted to activeSockets"; + return client_sock; +- } else if (acceptErrno != EAGAIN && acceptErrno != EWOULDBLOCK) { ++ } else if (isTransientAcceptError(acceptErrno)) { ++ // Transient, per-connection failure: fall through and return -1; the ++ // server loop simply retries on the next iteration. ++ } else { + FATAL_FAIL(-1); // STFATAL with the error + } + + SetErrno(acceptErrno); + return -1; ++} ++ ++bool UnixSocketHandler::isTransientAcceptError(int err) { ++ // accept(2) routinely fails for benign, per-connection reasons that must ++ // not abort the whole server: ++ // - EAGAIN/EWOULDBLOCK: non-blocking socket with no pending connection. ++ // - ECONNABORTED: the peer reset the connection between landing in the ++ // listen queue and our accept() call. Surfaced readily on FreeBSD by ++ // clients that connect and immediately disconnect (keepalive/reconnect ++ // churn) and previously aborted etserver. ++ // - EINTR: the call was interrupted by a signal. ++ return err == EAGAIN || err == EWOULDBLOCK || err == ECONNABORTED || ++ err == EINTR; + } + + void UnixSocketHandler::close(int fd) { +--- src/base/UnixSocketHandler.hpp.orig 2025-07-22 01:37:18 UTC ++++ src/base/UnixSocketHandler.hpp +@@ -14,6 +14,7 @@ class UnixSocketHandler : public SocketHandler { + virtual ssize_t read(int fd, void* buf, size_t count); + virtual ssize_t write(int fd, const void* buf, size_t count); + virtual int accept(int fd); ++ static bool isTransientAcceptError(int err); + virtual void close(int fd); + virtual vector getActiveSockets(); + +--- src/terminal/PsuedoUserTerminal.hpp.orig 2025-07-22 01:37:18 UTC ++++ src/terminal/PsuedoUserTerminal.hpp +@@ -96,7 +96,11 @@ class PsuedoUserTerminal : public UserTerminal { + FATAL_FAIL(waitpid(getPid(), &throwaway, WUNTRACED)); + #else + siginfo_t childInfo; +- FATAL_FAIL(waitid(P_PID, getPid(), &childInfo, WEXITED)); ++ if (getPid() > 0) { ++ if (waitid(P_PID, getPid(), &childInfo, WEXITED) == -1) { ++ LOG(ERROR) << "waitid failed, child already reaped."; ++ } ++ } + #endif + } + +--- test/unit_tests/UnixSocketHandlerTest.cpp.orig 2026-06-09 03:43:36 UTC ++++ test/unit_tests/UnixSocketHandlerTest.cpp +@@ -0,0 +1,47 @@ ++#include "PipeSocketHandler.hpp" ++#include "TestHeaders.hpp" ++ ++using namespace et; ++ ++TEST_CASE("AcceptTransientErrorClassification", "[UnixSocketHandler]") { ++ // The errnos that must be tolerated rather than aborting the server. ++ // ECONNABORTED is the case that crashed etserver on FreeBSD. ++ REQUIRE(UnixSocketHandler::isTransientAcceptError(EAGAIN)); ++ REQUIRE(UnixSocketHandler::isTransientAcceptError(EWOULDBLOCK)); ++ REQUIRE(UnixSocketHandler::isTransientAcceptError(ECONNABORTED)); ++ REQUIRE(UnixSocketHandler::isTransientAcceptError(EINTR)); ++ ++ // Genuine logic errors must still be treated as fatal. ++ REQUIRE_FALSE(UnixSocketHandler::isTransientAcceptError(EBADF)); ++ REQUIRE_FALSE(UnixSocketHandler::isTransientAcceptError(EINVAL)); ++ REQUIRE_FALSE(UnixSocketHandler::isTransientAcceptError(ENOTSOCK)); ++ REQUIRE_FALSE(UnixSocketHandler::isTransientAcceptError(EFAULT)); ++} ++ ++TEST_CASE("AcceptDoesNotAbortWhenNoPendingConnection", "[UnixSocketHandler]") { ++ // End-to-end check: accept() on a non-blocking listening socket with no ++ // pending connection fails with EAGAIN/EWOULDBLOCK and must return -1 to the ++ // caller instead of hitting FATAL_FAIL. ++ shared_ptr socketHandler(new PipeSocketHandler()); ++ ++ string tmpPath = GetTempDirectory() + string("et_test_XXXXXXXX"); ++ string pipeDirectory = string(mkdtemp(&tmpPath[0])); ++ string pipePath = pipeDirectory + "/pipe"; ++ ++ SocketEndpoint endpoint; ++ endpoint.set_name(pipePath); ++ ++ set serverFds = socketHandler->listen(endpoint); ++ REQUIRE(!serverFds.empty()); ++ int serverFd = *serverFds.begin(); ++ ++ int clientFd = socketHandler->accept(serverFd); ++ REQUIRE(clientFd == -1); ++ REQUIRE((GetErrno() == EAGAIN || GetErrno() == EWOULDBLOCK)); ++ ++ socketHandler->stopListening(endpoint); ++ // stopListening() only closes the fd; the bound socket file remains, so ++ // remove it before the (now empty) directory. ++ FATAL_FAIL(::remove(pipePath.c_str())); ++ FATAL_FAIL(::remove(pipeDirectory.c_str())); ++}