From nobody Fri Apr 26 08:21:30 2024 X-Original-To: dev-commits-src-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 4VQm0C1WXXz5JCcg; Fri, 26 Apr 2024 08:21:31 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VQm0C12xwz446x; Fri, 26 Apr 2024 08:21:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714119691; 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=M+gHHkkL1Ue+8cL1UqO8MvuRJcmh40Vskuoy3QY/8kw=; b=Cd4sTQjCRMR0hbYECuPZejlqDubhcn7SvTN8gdjVkcA+gnF8VnFwEXLiNbU8k762xMcJST Di7nIFkSnFyV94nWEURCRNKSEE3xFZYCRN1rcxI28EKCHGWCcSIE19tiqfluk6VXrlLGTf 21hAdgSTu5avcnTnKntvMNyzfazgxwXX4SqsZdqh9LQJMahIqlF8L3fL+NFG9FLnyqvZTT dYPUlA/h70MA7oC1Z5atXRFz4WexV8oJ3KAaexP8B8NRopjafEFpJllqP2WdaQZ4smGZEl BynJWpGyxVNtct4oVMjWE2q0zYyMd0AECzIeVKA1jkVP6yi28oB4QWx8fXmHxg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714119691; a=rsa-sha256; cv=none; b=L4Gc34srvXpDgS2pyYHZza1cH46RekDn5TU3eCXw2FuWjANBiGUhLotZB7BevmdvV+ElP/ Wo1XoB2NLch2Vw8Eow1TGPs+9BLtjFnLmu+h7J4q84PtNidumxFvtNsP8fbKk8RvSAl/L4 hoRBTHdw1g/7mf/rRyFmaCAyd8R4fh/ZdHpMb9dXdKv191hCAihPDL52I1LRvF9OGxlF2R ibFDv2zUMBYZfzgIguKBwdOwAoDMEOiLzghIRYtDCYVfMQMbwUTr9Yh8MEhRrzeukCE8Rh KPcrC9oDG1G0/0U0d0zUw91nlUchYBg8UY4F5yYt8UnwGj0+xWTu7o6saMJolQ== 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=1714119691; 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=M+gHHkkL1Ue+8cL1UqO8MvuRJcmh40Vskuoy3QY/8kw=; b=GrQKCFYfRL49LSvGBWhp1Rb0qrF2g2m2KE/TjQ9eiQgqEBFKZ5pJiSoBDSCcj3YTbLiKU7 0XSnrsyiBqERmJMbFS6oiGNSP38Z7FmUhz7iVNjQQmsdIIuwUvTAMMSfTna1luT6Iash/r xhi8+EGP+huG8wNEIGD4amdAM2qHOO5wnt+zEMAuaNmqHhu5tNRovXNMQ65xtSAYx5uPp4 WFEVddIBze0trCahfuy2I+clVmnszFulRbyQjhQn6QEvm/KA45Jd+Z9DJ5hxj1Z9IpX17f kAJiDrnmGGOi8EW/nTDhL1+7oNHwSNbNn19wpVUGqPEFo8tSgzTUmksWHOEJHQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 4VQm0C0LLczZwc; Fri, 26 Apr 2024 08:21:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43Q8LU04032537; Fri, 26 Apr 2024 08:21:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43Q8LUVT032534; Fri, 26 Apr 2024 08:21:30 GMT (envelope-from git) Date: Fri, 26 Apr 2024 08:21:30 GMT Message-Id: <202404260821.43Q8LUVT032534@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Holm Subject: git: 9b10aa4a0591 - main - stress2: More detailed error reporting List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9b10aa4a05915a6519d942fea48113757dcf1699 Auto-Submitted: auto-generated The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=9b10aa4a05915a6519d942fea48113757dcf1699 commit 9b10aa4a05915a6519d942fea48113757dcf1699 Author: Peter Holm AuthorDate: 2024-04-26 08:20:49 +0000 Commit: Peter Holm CommitDate: 2024-04-26 08:20:49 +0000 stress2: More detailed error reporting --- tools/test/stress2/misc/rdwr.sh | 50 +++++++++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 17 deletions(-) diff --git a/tools/test/stress2/misc/rdwr.sh b/tools/test/stress2/misc/rdwr.sh index c77c955dc210..893056558560 100755 --- a/tools/test/stress2/misc/rdwr.sh +++ b/tools/test/stress2/misc/rdwr.sh @@ -28,6 +28,11 @@ # Test with read/write length of INT_MAX (i386) or INT_MAX+1 (amd64) +# Seen: +# rdwr: readv(). Expected 2147483648 (80000000), got -2147483648 (ffffffff80000000) bytes: No error: 0 +# rdwr: writev(). Expected 2147483648 (80000000), got -2147483648 (ffffffff80000000) bytes: No error: 0 +# Fixed by: 78101d437a92 + . ../default.cfg [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 @@ -61,11 +66,22 @@ EOF #include #include +static int s; + +static void +er(char * syscall, size_t len, ssize_t ret) +{ + warn("%8s. Expected %zu (%zx), got %zd (%zx) bytes", + syscall, len, len, ret, ret); + s=1; +} + int main(int argc, char **argv) { int fd1, fd2; size_t len; + ssize_t r; void *p; struct iovec iov; @@ -85,34 +101,34 @@ main(int argc, char **argv) MAP_FAILED) err(1, "mmap"); - if (read(fd2, p, len) != len) - err(1, "read"); + if ((r = read(fd2, p, len)) != len) + er("read()", len, r); - if (write(fd1, p, len) != len) - err(1, "write"); + if ((r = write(fd1, p, len)) != len) + er("write()", len, r); - if (pread(fd2, p, len, 0) != len) - err(1, "pread"); + if ((r = pread(fd2, p, len, 0)) != len) + er("pread()", len, r); - if (pwrite(fd1, p, len, 0) != len) - err(1, "pwrite"); + if ((r = pwrite(fd1, p, len, 0)) != len) + er("pwrite()", len, r); iov.iov_base = p; iov.iov_len = len; - if (readv(fd2, &iov, 1) != len) - err(1, "readv"); + if ((r = readv(fd2, &iov, 1)) != len) + er("readv()", len, r); - if (writev(fd1, &iov, 1) != len) - err(1, "writev"); + if ((r = writev(fd1, &iov, 1)) != len) + er("writev()", len, r); - if (preadv(fd2, &iov, 1, 0) != len) - err(1, "preadv"); + if ((r = preadv(fd2, &iov, 1, 0)) != len) + er("preadv()", len, r); - if (pwritev(fd1, &iov, 1, 0) != len) - err(1, "pwritev"); + if ((r = pwritev(fd1, &iov, 1, 0)) != len) + er("pwritev()", len, r); close(fd1); close(fd2); - return (0); + return (s); }