From owner-svn-src-user@freebsd.org Mon Jun 10 07:12:47 2019 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A279E15B7529 for ; Mon, 10 Jun 2019 07:12:47 +0000 (UTC) (envelope-from pho@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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 39D2E95DDF; Mon, 10 Jun 2019 07:12:47 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 134AAEFA4; Mon, 10 Jun 2019 07:12:47 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5A7CknL029425; Mon, 10 Jun 2019 07:12:46 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5A7Ck9u029424; Mon, 10 Jun 2019 07:12:46 GMT (envelope-from pho@FreeBSD.org) Message-Id: <201906100712.x5A7Ck9u029424@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Mon, 10 Jun 2019 07:12:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r348848 - user/pho/stress2/misc X-SVN-Group: user X-SVN-Commit-Author: pho X-SVN-Commit-Paths: user/pho/stress2/misc X-SVN-Commit-Revision: 348848 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 39D2E95DDF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jun 2019 07:12:48 -0000 Author: pho Date: Mon Jun 10 07:12:46 2019 New Revision: 348848 URL: https://svnweb.freebsd.org/changeset/base/348848 Log: Added a regression test. Sponsored by: Dell EMC Isilon Added: user/pho/stress2/misc/mmap35.sh (contents, props changed) Added: user/pho/stress2/misc/mmap35.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/mmap35.sh Mon Jun 10 07:12:46 2019 (r348848) @@ -0,0 +1,114 @@ +#!/bin/sh + +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2019 Dell EMC Isilon +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +# mmap(2) should fail with "Invalid argument" on i386 +# Fixed by r348843 + +. ../default.cfg +[ `id -u` -ne 0 ] && echo "Must be root!" && exit 1 +[ "`uname -p`" = "i386" ] || exit 0 + +dir=/tmp +odir=`pwd` +cd $dir +sed '1,/^EOF/d' < $odir/$0 > $dir/mmap35.c +mycc -o mmap35 -Wall -Wextra -O0 -g mmap35.c || exit 1 +cd $odir + +set -e +mount | grep "on $mntpoint " | grep -q /dev/md && umount -f $mntpoint +[ -c /dev/md$mdstart ] && mdconfig -d -u $mdstart +mdconfig -a -t swap -s 4g -u $mdstart +newfs $newfs_flags -n md$mdstart > /dev/null +mount /dev/md$mdstart $mntpoint +set +e + +cd $mntpoint +echo "Expect: mmap35: mmap: Invalid argument" +$dir/mmap35 +s=$? +[ -f mmap35.core ] && + { ls -l mmap35.core; mv mmap35.core $dir; s=1; } +cd $odir + +for i in `jot 6`; do + mount | grep -q "on $mntpoint " || break + umount $mntpoint && break || sleep 10 + [ $i -eq 6 ] && + { echo FATAL; fstat -mf $mntpoint; exit 1; } +done +mdconfig -d -u $mdstart +rm -f $dir/mmap35 +[ $s -eq 0 ] && rm -f mmap35.c +exit $s + +EOF +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#define SIZ 0xfffff0fcULL + +int +main(void) +{ + off_t offset; + int fd; + char *c, file[80]; + + snprintf(file, sizeof(file), "file.%d", getpid()); + if ((fd = open(file, O_RDWR | O_CREAT, DEFFILEMODE)) == -1) + err(1, "open(%s)", file); + + offset = SIZ; + if (ftruncate(fd, offset) == -1) + err(1, "ftruncate(%jd)", offset); + write(fd, "b", 1); + + c = mmap(NULL, offset, PROT_READ | PROT_WRITE, MAP_SHARED, + fd, 0); + if (c == MAP_FAILED) + warn("mmap"); + else + c[offset / 2] = 1; + + unlink(file); + + return (0); +} From owner-svn-src-user@freebsd.org Wed Jun 12 12:19:36 2019 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1918E15B43F8 for ; Wed, 12 Jun 2019 12:19:36 +0000 (UTC) (envelope-from pho@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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A989673915; Wed, 12 Jun 2019 12:19:35 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7ABD518E83; Wed, 12 Jun 2019 12:19:35 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5CCJZZd002952; Wed, 12 Jun 2019 12:19:35 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5CCJZAh002951; Wed, 12 Jun 2019 12:19:35 GMT (envelope-from pho@FreeBSD.org) Message-Id: <201906121219.x5CCJZAh002951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Wed, 12 Jun 2019 12:19:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r348992 - user/pho/stress2/misc X-SVN-Group: user X-SVN-Commit-Author: pho X-SVN-Commit-Paths: user/pho/stress2/misc X-SVN-Commit-Revision: 348992 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A989673915 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jun 2019 12:19:36 -0000 Author: pho Date: Wed Jun 12 12:19:34 2019 New Revision: 348992 URL: https://svnweb.freebsd.org/changeset/base/348992 Log: Added a SCTP(4) test scenario. Sponsored by: Dell EMC Isilon Added: user/pho/stress2/misc/sctp.sh (contents, props changed) Added: user/pho/stress2/misc/sctp.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/sctp.sh Wed Jun 12 12:19:34 2019 (r348992) @@ -0,0 +1,157 @@ +#!/bin/sh + +# Based on https://gist.github.com/zonque/7d03568eab14a2bb57cb by +# Daniel Mack github@zonque.org + +# "panic: general protection fault" seen: +# https://people.freebsd.org/~pho/stress/log/sctp.txt + +# $FreeBSD$ + +cat > /tmp/sctp.c < +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static int my_port_num; + +static void +die(const char *s) +{ + perror(s); + exit(1); +} + +static void +server(void) +{ + struct sctp_sndrcvinfo sndrcvinfo; + struct sockaddr_in servaddr = { + .sin_family = AF_INET, + .sin_addr.s_addr = htonl(INADDR_ANY), + .sin_port = htons(my_port_num), + }; + struct sctp_initmsg initmsg = { + .sinit_num_ostreams = 5, + .sinit_max_instreams = 5, + .sinit_max_attempts = 4, + }; + int listen_fd, conn_fd, flags, ret, in; + + listen_fd = socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP); + if (listen_fd < 0) + die("socket"); + + ret = bind(listen_fd, (struct sockaddr *) &servaddr, sizeof(servaddr)); + if (ret < 0) + die("bind"); + + ret = setsockopt(listen_fd, IPPROTO_SCTP, SCTP_INITMSG, &initmsg, + sizeof(initmsg)); + if (ret < 0) + die("setsockopt"); + + ret = listen(listen_fd, initmsg.sinit_max_instreams); + if (ret < 0) + die("listen"); + + for (;;) { + char buffer[1024]; + + printf("Waiting for connection\n"); + fflush(stdout); + + conn_fd = accept(listen_fd, (struct sockaddr *) NULL, NULL); + if(conn_fd < 0) + die("accept()"); + + printf("New client connected\n"); + fflush(stdout); + + in = sctp_recvmsg(conn_fd, buffer, sizeof(buffer), NULL, 0, + &sndrcvinfo, &flags); + if (in > 0) { + printf("Received data: %s\n", buffer); + fflush(stdout); + } + + close(conn_fd); + } +} + +static void +client(void) +{ + struct sockaddr_in servaddr = { + .sin_family = AF_INET, + .sin_port = htons(my_port_num), + .sin_addr.s_addr = inet_addr("127.0.0.1"), + }; + int conn_fd, ret; + const char *msg = "Hello, Server!"; + + conn_fd = socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP); + if (conn_fd < 0) + die("socket()"); + + ret = connect(conn_fd, (struct sockaddr *) &servaddr, sizeof(servaddr)); + if (ret < 0) + die("connect()"); + + ret = sctp_sendmsg(conn_fd, (void *) msg, strlen(msg) + 1, NULL, 0, 0, 0, 0, 0, 0 ); + if (ret < 0) + die("sctp_sendmsg"); + + close(conn_fd); +} + +int +main(int argc __unused, char *argv[]) +{ + + my_port_num = atoi(argv[1]); + if (strstr(basename(argv[0]), "server")) + server(); + else + client(); + + return 0; +} +EOF + +cc -o /tmp/server -Wall -Wextra -O2 /tmp/sctp.c || exit +ln -sf /tmp/server /tmp/client + +parallel=100 +for i in `jot $parallel 62324`; do + /tmp/server $i > /dev/null & +done +(cd ../testcases/swap; ./swap -t 1m -i 20 -l 100) & +sleep 2 + +start=`date +%s` +while [ $((`date +%s` - start)) -lt 60 ]; do + pids= + for i in `jot 50`; do + for j in `jot $parallel 62324`; do + /tmp/client $j & + pids="$pids $!" + done + done + for i in $pids; do + wait $i + done +done +pkill server +wait +while pkill swap; do :; done +wait +rm -f /tmp/server /tmp/client +exit 0 From owner-svn-src-user@freebsd.org Thu Jun 13 07:13:23 2019 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51DE315CE453 for ; Thu, 13 Jun 2019 07:13:23 +0000 (UTC) (envelope-from pho@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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E6AFE6F7F5; Thu, 13 Jun 2019 07:13:22 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA66F24F7A; Thu, 13 Jun 2019 07:13:22 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5D7DMSn098843; Thu, 13 Jun 2019 07:13:22 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5D7DMqA098842; Thu, 13 Jun 2019 07:13:22 GMT (envelope-from pho@FreeBSD.org) Message-Id: <201906130713.x5D7DMqA098842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Thu, 13 Jun 2019 07:13:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r349012 - user/pho/stress2/misc X-SVN-Group: user X-SVN-Commit-Author: pho X-SVN-Commit-Paths: user/pho/stress2/misc X-SVN-Commit-Revision: 349012 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E6AFE6F7F5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jun 2019 07:13:23 -0000 Author: pho Date: Thu Jun 13 07:13:22 2019 New Revision: 349012 URL: https://svnweb.freebsd.org/changeset/base/349012 Log: Added a mmap(2) regression test. Sponsored by: Dell EMC Isilon Added: user/pho/stress2/misc/mmap34.sh (contents, props changed) Added: user/pho/stress2/misc/mmap34.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/mmap34.sh Thu Jun 13 07:13:22 2019 (r349012) @@ -0,0 +1,232 @@ +#!/bin/sh + +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2019 Dell EMC Isilon +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +# "panic: caller failed to provide space -546873344 at address 0x20a00000" +# seen. +# https://people.freebsd.org/~pho/stress/log/indir_trunc.txt +# Fixed by r348968 + +# Test scenario inspired by: +# syzbot+6532e9aab8911f58beeb@syzkaller.appspotmail.com + +. ../default.cfg +[ `id -u` -ne 0 ] && echo "Must be root!" && exit 1 + +dir=/tmp +odir=`pwd` +cd $dir +sed '1,/^EOF/d' < $odir/$0 > $dir/mmap34.c +mycc -o mmap34 -Wall -Wextra -O0 -g mmap34.c -lpthread || exit 1 +cd $odir + +set -e +mount | grep "on $mntpoint " | grep -q /dev/md && umount -f $mntpoint +[ -c /dev/md$mdstart ] && mdconfig -d -u $mdstart +mdconfig -a -t swap -s 4g -u $mdstart +newfs $newfs_flags -n md$mdstart > /dev/null +mount /dev/md$mdstart $mntpoint +set +e + +(cd ../testcases/swap; ./swap -t 5m -i 20) & +cd $mntpoint +$dir/mmap34 +s=$? +while pkill swap; do :; done +wait +[ -f mmap34.core ] && + { ls -l mmap34.core; mv mmap34.core $dir; s=1; } +cd $odir + +for i in `jot 6`; do + mount | grep -q "on $mntpoint " || break + umount $mntpoint && break || sleep 10 + [ $i -eq 6 ] && + { echo FATAL; fstat -mf $mntpoint; exit 1; } +done +mdconfig -d -u $mdstart +rm -f $dir/mmap34 +[ $s -eq 0 ] && rm -f mmap34.c +exit $s + +EOF +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +static volatile u_int *share; + +#if defined(__LP64__) +#define MASK 0x7ffffffffffffULL +#else +#define MASK 0xffffffffULL +#endif +#define PARALLEL 64 +#define RUNTIME (5 * 60) +#define SYNC 0 + +static int fd; + +static void * +t1(void *data __unused) +{ + off_t offset; + time_t start; + + start = time(NULL); + while (time(NULL) - start < 30) { + offset = arc4random(); + offset = (offset << 32) | arc4random(); + offset &= MASK; + if (lseek(fd, offset, SEEK_SET) == -1) + err(1, "lseek(%jd)", offset); + if (write(fd, "a", 1) != 1) + err(1, "write"); + if (fsync(fd) == -1) + err(1, "fsync"); + usleep(100); + } + return (NULL); +} +static void * +t2(void *data __unused) +{ + off_t offset, old; + time_t start; + void *p; + char *c; + + old = 0; + start = time(NULL); + while (time(NULL) - start < 30) { + if (old != 0) + munmap(p, old); + offset = arc4random(); + offset = (offset << 32) | arc4random(); + offset &= MASK; + if (ftruncate(fd, offset) == -1) + err(1, "ftruncate(%jd)", offset); + write(fd, "b", 1); + p = mmap(NULL, offset, PROT_READ | PROT_WRITE, MAP_SHARED, + fd, 0); + if (p == MAP_FAILED) + old = 0; + else { + old = offset; + c = p; + c[offset / 2] = 1; + if (offset > 0) + c[offset - 1] = 2; + } + usleep(20000); + } + return (NULL); +} + +static void +test(void) +{ + pthread_t tid[2]; + int r; + char file[80]; + + atomic_add_int(&share[SYNC], 1); + while (share[SYNC] != PARALLEL) + ; + + snprintf(file, sizeof(file), "file.%d", getpid()); + if ((fd = open(file, O_RDWR | O_CREAT, DEFFILEMODE)) == -1) + err(1, "open(%s)", file); + + if ((r = pthread_create(&tid[0], NULL, t1, NULL)) != 0) + errc(1, r, "pthread_create"); + if ((r = pthread_create(&tid[1], NULL, t2, NULL)) != 0) + errc(1, r, "pthread_create"); + + if ((r = pthread_join(tid[0], NULL)) != 0) + errc(1, r, "pthread_join"); + if ((r = pthread_join(tid[1], NULL)) != 0) + errc(1, r, "pthread_join"); + close(fd); + unlink(file); + + _exit(0); +} + +int +main(void) +{ + pid_t pids[PARALLEL]; + size_t len; + time_t start; + int e, i, status; + + e = 0; + len = PAGE_SIZE; + if ((share = mmap(NULL, len, PROT_READ | PROT_WRITE, + MAP_ANON | MAP_SHARED, -1, 0)) == MAP_FAILED) + err(1, "mmap"); + + start = time(NULL); + while ((time(NULL) - start) < RUNTIME && e == 0) { + share[SYNC] = 0; + for (i = 0; i < PARALLEL; i++) { + if ((pids[i] = fork()) == 0) + test(); + if (pids[i] == -1) + err(1, "fork()"); + } + for (i = 0; i < PARALLEL; i++) { + if (waitpid(pids[i], &status, 0) == -1) + err(1, "waitpid(%d)", pids[i]); + if (status != 0) { + if (WIFSIGNALED(status)) + fprintf(stderr, + "pid %d exit signal %d\n", + pids[i], WTERMSIG(status)); + } + e += status == 0 ? 0 : 1; + } + } + + return (e); +} From owner-svn-src-user@freebsd.org Fri Jun 14 18:33:42 2019 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 774BD15AEB62 for ; Fri, 14 Jun 2019 18:33:42 +0000 (UTC) (envelope-from gordon@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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 141B774C5C; Fri, 14 Jun 2019 18:33:42 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F08E51BA88; Fri, 14 Jun 2019 18:33:41 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5EIXfnN024719; Fri, 14 Jun 2019 18:33:41 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5EIXf4R024717; Fri, 14 Jun 2019 18:33:41 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <201906141833.x5EIXf4R024717@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Fri, 14 Jun 2019 18:33:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r349037 - in user/cperciva/freebsd-update-build/scripts/11.3-RC1: . amd64 i386 X-SVN-Group: user X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in user/cperciva/freebsd-update-build/scripts/11.3-RC1: . amd64 i386 X-SVN-Commit-Revision: 349037 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 141B774C5C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jun 2019 18:33:42 -0000 Author: gordon Date: Fri Jun 14 18:33:41 2019 New Revision: 349037 URL: https://svnweb.freebsd.org/changeset/base/349037 Log: Add 11.3-RC1. Added: user/cperciva/freebsd-update-build/scripts/11.3-RC1/ user/cperciva/freebsd-update-build/scripts/11.3-RC1/amd64/ user/cperciva/freebsd-update-build/scripts/11.3-RC1/amd64/build.conf (contents, props changed) user/cperciva/freebsd-update-build/scripts/11.3-RC1/i386/ user/cperciva/freebsd-update-build/scripts/11.3-RC1/i386/build.conf (contents, props changed) Added: user/cperciva/freebsd-update-build/scripts/11.3-RC1/amd64/build.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/11.3-RC1/amd64/build.conf Fri Jun 14 18:33:41 2019 (r349037) @@ -0,0 +1,10 @@ +export RELH=9bd3b8a6ef03dc511f4de18e6b1b8e592a1582dab6bcfc77b268ec50a6485b0b769636c27378da5e3e4e9b1f943862fb09b7fbd062c782259fa6e769096cba94 +export FTP=https://people.freebsd.org/~gjb/11.3-RC1/ + +# Components of the world, source, and kernels +export WORLDPARTS="base base-dbg doc lib32 lib32-dbg" +export SOURCEPARTS="src" +export KERNELPARTS="kernel kernel-dbg" + +# EOL date +export EOL=1563062400 Added: user/cperciva/freebsd-update-build/scripts/11.3-RC1/i386/build.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/11.3-RC1/i386/build.conf Fri Jun 14 18:33:41 2019 (r349037) @@ -0,0 +1,10 @@ +export RELH=6fff5fc60295619369b4b463fef45644f88e94e6cb028237ffb24974e92627c7fb6091745e1cf9b08eeb96368b3369ce90cd36fedfe3c109898e462a6093a3a7 +export FTP=https://people.freebsd.org/~gjb/11.3-RC1/ + +# Components of the world, source, and kernels +export WORLDPARTS="base base-dbg doc" +export SOURCEPARTS="src" +export KERNELPARTS="kernel kernel-dbg" + +# EOL date +export EOL=1563062400