From nobody Mon May 22 08:08:43 2023 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 4QPqpM6pPcz4TCH3; Mon, 22 May 2023 08:08:43 +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 4QPqpM6FQFz47JT; Mon, 22 May 2023 08:08:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684742923; 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=/UzlLZsuNi1JxT2WbcWj097AwO0NIT76P5hX42KqLxo=; b=lVhCCgnMxQu93DQAmRgXSe5ZngdN2DOgdbNJbyA5+1UECNlvioHlP2CchR7XhXyTj/W5XP lqZ8xsyL/fswVIv0LoaP/M1NnRCKxxXaypYIeduyCD//grhcMPRR8KscpZ1ZIYO44Xoor2 IYVyQQ7RPHDS+7jbO4lusLP/geB1CyX+W3RlsxtZskbkDo2JHeH8KV9eXPpLBRnbhRhI74 PCDtzHYzWWa2KLnpm75v41DfYifk8ZwW1EQv33QG/xvDPp28K7ZCLE/4LjgtSnDxyshTf9 osZO7kRmy0JgRmHgn0fDNDp6CUWfmRHTbEPq15MXT6C8I3qBB3SSJQqG8UGs5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684742923; 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=/UzlLZsuNi1JxT2WbcWj097AwO0NIT76P5hX42KqLxo=; b=owetIGFxGUuiTK8XRIs1M0AQ/DEOVaqYd3zqpTXy9TMoy728kP6QNp4eKeGcFYzR6jnNzx 2g3QNM1QIah3y4oW19+tZ9PXVgzOezB8MLpTWBrG3Wi/qvEqRkVtTlLPlM2hS1i99D24Lr iIKi3o791UIE7O/nWwuvp8l+mko8E8otm4qQJHcTY8cLc4nOIeN4FiLLhss5QHCcelpjbY Zb7E9zCxi7JZk/a2hIUtGUDcpZ/mZTrSy6EVuWZ49e3ldLwhPI2vranrjtq6rFc/yqtG26 pXFPYtcb2r6SOCo3ZH6zpanaMItrg51/iBMgCCMN5NmbqkmXM29ZEE1H9a77QA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684742923; a=rsa-sha256; cv=none; b=YI3q5XJdNlRmJwVpyCMVCBBewydwPKnbBEm3yxzmvil+exvlfieKg80ack7lgal0iUrt+P VRWFtT23SWXeogavMt5MguN2BSmMuEeRWqjWmUM5Cru0KuEMMik9oSBa1dR8/N8ipzzP6z mNgM1kOqugSb9l4862iQRJO9b73fXPJjFxjGfMRg2Zqc8q+p6g6U7su0qrmtJEoU6iD1yx JsbRDG4Mk1nWg9KKVhl4WcsU7hdCRef1tQBJZS5XhdhBt2IPI1jdEEQeWeim/3Yti/KDsM ptgV68GGOshEDT/NgNhx6iWgOawpFbVrZtTPEqii39McYIGTNfaTuh7GFJXiUw== 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 4QPqpM5Jb0z1PTd; Mon, 22 May 2023 08:08:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34M88hhZ018375; Mon, 22 May 2023 08:08:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34M88hgL018374; Mon, 22 May 2023 08:08:43 GMT (envelope-from git) Date: Mon, 22 May 2023 08:08:43 GMT Message-Id: <202305220808.34M88hgL018374@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: ca0088ae27a5 - main - stress2: Occasionally modify 8 bits 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: ca0088ae27a5154f9279b53b2f7493986167d967 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=ca0088ae27a5154f9279b53b2f7493986167d967 commit ca0088ae27a5154f9279b53b2f7493986167d967 Author: Peter Holm AuthorDate: 2023-05-22 08:05:34 +0000 Commit: Peter Holm CommitDate: 2023-05-22 08:05:34 +0000 stress2: Occasionally modify 8 bits --- tools/test/stress2/tools/flip.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tools/test/stress2/tools/flip.c b/tools/test/stress2/tools/flip.c index a298aebf6d43..e1f12e97a79c 100644 --- a/tools/test/stress2/tools/flip.c +++ b/tools/test/stress2/tools/flip.c @@ -70,6 +70,15 @@ flip(void *ap, size_t len) #endif } +static void +trash(char *c) +{ + if (arc4random() % 2 == 1) + *c = 0; + else + arc4random_buf(c, sizeof(c)); +} + int main(int argc, char *argv[]) { @@ -122,7 +131,10 @@ main(int argc, char *argv[]) err(1, "lseek()"); if (read(fd, &c, 1) != 1) err(1, "read()"); - flip(&c, 1); + if (arc4random() % 100 < 80) + flip(&c, 1); + else + trash(&c); if (lseek(fd, pos, SEEK_SET) == -1) err(1, "lseek()"); if (write(fd, &c, 1) != 1)