From owner-svn-src-user@freebsd.org Sun Dec 8 06:30:47 2019 Return-Path: Delivered-To: svn-src-user@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 896DE1D9F37 for ; Sun, 8 Dec 2019 06:30: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 47VxKM393Rz3D08; Sun, 8 Dec 2019 06:30: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 5178326075; Sun, 8 Dec 2019 06:30: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 xB86Ul4L086924; Sun, 8 Dec 2019 06:30:47 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB86UlSW086923; Sun, 8 Dec 2019 06:30:47 GMT (envelope-from pho@FreeBSD.org) Message-Id: <201912080630.xB86UlSW086923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Sun, 8 Dec 2019 06:30:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r355522 - 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: 355522 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: Sun, 08 Dec 2019 06:30:47 -0000 Author: pho Date: Sun Dec 8 06:30:46 2019 New Revision: 355522 URL: https://svnweb.freebsd.org/changeset/base/355522 Log: Also catch SIGBUS when accessing an unmapped page. Update the minimum memory requirements to run the test. Reported by: jeff Modified: user/pho/stress2/misc/holdcnt02.sh Modified: user/pho/stress2/misc/holdcnt02.sh ============================================================================== --- user/pho/stress2/misc/holdcnt02.sh Sun Dec 8 04:36:42 2019 (r355521) +++ user/pho/stress2/misc/holdcnt02.sh Sun Dec 8 06:30:46 2019 (r355522) @@ -34,7 +34,7 @@ [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 [ `swapinfo | wc -l` -eq 1 ] && exit 0 -[ `sysctl -n hw.physmem` -lt $((9 * 1024 * 1024 * 1024)) ] && exit 0 +[ `sysctl -n hw.physmem` -lt $((32 * 1024 * 1024 * 1024)) ] && exit 0 . ../default.cfg @@ -168,6 +168,7 @@ reader(void) setproctitle("reader"); signal(SIGSEGV, hand); + signal(SIGBUS, hand); fd = 0; for (;;) { (void)setjmp(jbuf); From owner-svn-src-user@freebsd.org Sun Dec 8 06:32:34 2019 Return-Path: Delivered-To: svn-src-user@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2FBAB1DA1B6 for ; Sun, 8 Dec 2019 06:32:34 +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 47VxMQ01Thz3DL0; Sun, 8 Dec 2019 06:32:34 +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 D8CE226224; Sun, 8 Dec 2019 06:32:33 +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 xB86WXdf092405; Sun, 8 Dec 2019 06:32:33 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB86WXMA092404; Sun, 8 Dec 2019 06:32:33 GMT (envelope-from pho@FreeBSD.org) Message-Id: <201912080632.xB86WXMA092404@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Sun, 8 Dec 2019 06:32:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r355523 - 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: 355523 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: Sun, 08 Dec 2019 06:32:34 -0000 Author: pho Date: Sun Dec 8 06:32:33 2019 New Revision: 355523 URL: https://svnweb.freebsd.org/changeset/base/355523 Log: Update the list of tests to exclude. Trim the size of the elapsed runtime log. Report total run time. Modified: user/pho/stress2/misc/all.sh Modified: user/pho/stress2/misc/all.sh ============================================================================== --- user/pho/stress2/misc/all.sh Sun Dec 8 06:30:46 2019 (r355522) +++ user/pho/stress2/misc/all.sh Sun Dec 8 06:32:33 2019 (r355523) @@ -39,64 +39,59 @@ # panic: 43 vncache entries remaining 20111220 # backingstore3.sh # g_vfs_done():md6a[WRITE(offset=...)]error = 28 20111230 -# buildworld3.sh WiP 20180919 -# chain.sh WiP 20171225 -# contigmalloc3.sh panic: Bad link elm 0x6766fbc next->prev != elm 20180318 -# crossmp4.sh Known nullfs issue 20150523 -# dev.sh g_access(958) error 6 seen 20180329 # devfs4.sh WiP 20181031 -# Xextattr2.sh WiP 20180921 -# fdatasync2.sh Deadlock 20180312 -# fdgrowtable.sh Deadlock 20180303 -# fsync.sh GEOM_JOURNAL: Cannot suspend file system /mnt 20160818 +# fexecve.sh WiP +# fsync.sh panic: Journal overflow 20190208 # fuse.sh Memory corruption seen in log file kostik734.txt 20141114 # fuse2.sh Deadlock seen 20121129 # fuse3.sh Deadlock seen 20141120 -# gbde.sh panic: handle_written_inodeblock: Invalid link count... 20131128 +# gjournal.sh panic: Journal overflow 20190626 # gjournal2.sh panic: Journal overflow 20180125 # gjournal3.sh panic: Bio not on queue 20171225 # gjournal4.sh CAM stuck in vmwait 20180517 +# gnop7.sh WiP 20190820 +# gpt.sh Page fault seen 20190913 # graid1_4.sh umount stuck in mntref r338639 20180921 # graid1_8.sh Known issue 20170909 # graid1_9.sh panic: Bad effnlink 20180212 -# kevent13.sh panic: mutex pipe mutex not owned at sys_pipe.c:1769 20181118 +# kevent13.sh panic: mutex pipe mutex not owned at sys_pipe.c:1769 20190208 # lockf5.sh Spinning threads seen 20160718 -# ifconfig.sh WiP 20181029 -# ifconfig2.sh WiP 20181029 -# maxvnodes2.sh WiP 20161129 -# mdconfig.sh Panic: g_read_data(): invalid length 262144 20161128 +# ifconfig.sh WiP 20190211 +# ifconfig2.sh WiP 20190211 +# maxvnodes.sh Only supposed to work in single user mode 20190412 +# maxvnodes2.sh Only supposed to work in single user mode 20190412 # memguard.sh Waiting for fix commit # memguard2.sh Waiting for fix commit # memguard3.sh Waiting for fix commit +# mkfifo8.sh WiP 20190629 # mlockall2.sh Unrecoverable OOM killing seen 20190203 -# mmap32.sh Kernel loop 20171118 -# newfs4.sh watchdog fired. newbuf 20180618 +# newfs4.sh watchdog fired. newbuf 20190225 # nfs10.sh Double fault 20151013 +# nfs13.sh mount_nfs hangs in mntref 20191007 # nfs16.sh panic: Failed to register NFS lock locally - error=11 20160608 # oom2.sh Hang in pfault 20180324 -# pfl3.sh panic: handle_written_inodeblock: live inodedep 20140812 -# pageout.sh panic: handle_written_filepage: not started 20180303 -# Xptrace9.sh WiP +# pfl3.sh panic: handle_written_inodeblock: live inodedep 20190211 +# pageout.sh panic: handle_written_filepage: not started 20190218 # quota2.sh panic: dqflush: stray dquot 20120221 # quota3.sh panic: softdep_deallocate_dependencies: unrecovered ... 20111222 # quota6.sh panic: softdep_deallocate_dependencies: unrecovered ... 20130206 # quota7.sh panic: dqflush: stray dquot 20120221 -# sendfile11.sh panic: vnode_pager_generic_getpages: sector size 8192 . 20170930 +# rename14.sh WiP 20190616 +# sctp.sh WiP 20190809 +# sctp2.sh WiP 20190809 +# sctp3.sh WiP 20190809 +# setsockopt2.sh in_epoch panic 20191010 # signal.sh Timing issues. Needs fixing 20171116 +# snap4.sh panic: snapacct_ufs2: bad block 20181014 # snap6.sh panic: softdep_deallocate_dependencies: unrecovered ... 20130630 # snap8.sh panic: softdep_deallocate_dependencies: unrecovered ... 20120630 # snap9.sh panic: handle_written_filepage: not started 20170722 -# suj3.sh panic: Memory modified after free 20150721 -# suj11.sh panic: ufsdirhash_newblk: bad offset 20120118 -# suj13.sh general protection fault in bufdaemon 20141130 -# suj30.sh panic: flush_pagedep_deps: MKDIR_PARENT 20121020 -# suj31.sh OOM 20180408 # suj34.sh Various hangs and panics (SUJ + NULLFS issue) 20131210 # swap4.sh WiP 20171208 # swapoff2.sh swap_pager_force_pagein: read from swap failed 20171223 # ucom.sh Stuck in tail -F 20180129 -# umountf3.sh KDB: enter: watchdog timeout 20170514 -# umountf7.sh panic: handle_written_inodeblock: live inodedep ... 20131129 +# umount4.sh Double fault seen 20191101 +# umountf7.sh panic: handle_written_inodeblock: live inodedep ... 20190219 # umountf9.sh panic: handle_written_inodeblock: live inodedep ... 20170221 # unionfs.sh insmntque: non-locked vp: xx is not exclusive locked... 20130909 # unionfs2.sh insmntque: mp-safe fs and non-locked vp is not ... 20111219 @@ -129,6 +124,7 @@ # nfs6.sh # nfs11.sh vmwait deadlock 20151004 # nullfs8.sh +# tmpfs18.sh mntref hang seen 20191019 # End of list @@ -198,6 +194,8 @@ minspace=$((1024 * 1024)) # in k [ ! -d $(dirname $RUNDIR) ] && echo "No such \$RUNDIR \"`dirname $RUNDIR`\"" && exit 1 +[ `sysctl -n hw.physmem` -le $((3 * 1024 * 1024 * 1024)) ] && + echo "Warn: Small RAM size for stress tests `sysctl -n hw.physmem`" [ `df -k $(dirname $RUNDIR) | tail -1 | awk '{print $4'}` -lt \ $minspace ] && echo "Warn: Not enough disk space on `dirname $RUNDIR` for \$RUNDIR" @@ -218,12 +216,13 @@ ping -c 2 -t 2 $BLASTHOST > /dev/null 2>&1 || echo "$loops" | grep -Eq "^[0-9]+$" || { echo "The -l argument must be a positive number"; exit 1; } -rm -f $alllist $allelepsed +rm -f $alllist find `dirname $alllast` -maxdepth 1 -name $alllast -mtime +12h -delete touch $alllast $alllog chmod 640 $alllast $alllog find ../testcases -perm -1 \( -name "*.debug" -o -name "*.full" \) -delete tail -2000 $alllog > ${alllog}.new; mv ${alllog}.new $alllog +tail -5000 $allelapsed > ${allelapsed}.new; mv ${allelapsed}.new $allelapsed console=/dev/console printf "\r\n" > $console & @@ -233,6 +232,24 @@ kill -0 $pid > /dev/null 2>&1 && { console=/dev/null; kill -9 $pid; } while pgrep -q fsck; do sleep 10; done +status() { + local s2 r + + s2=`date +%s` + r=$(echo "elapsed $(((s2 - s1) / 86400)) day(s)," \ + "`date -u -j -f '%s' '+%H:%M.%S' $((s2 - s1))`") + printf "`date '+%Y%m%d %T'` all.sh done, $r\n" + printf "`date '+%Y%m%d %T'` all.sh done, $r\r\n" > $console +} + +intr() { + printf "\nExit all.sh\n" + ./cleanup.sh + exit 1 +} +trap status EXIT +trap intr INT + [ -f all.debug.inc ] && . all.debug.inc s1=`date +%s` while true; do @@ -298,7 +315,7 @@ while true; do ) | tee $alloutput ts=`date '+%Y%m%d %T'` grep -qw FAIL $alloutput && - echo "$ts $i" >> $allfaillog && + echo "$ts $rev $i" >> $allfaillog && logger "stress2 test $i failed" grep -qw FATAL $alloutput && exit $e rm -f $alloutput @@ -319,7 +336,5 @@ while true; do done [ $((loops -= 1)) -eq 0 ] && break done -printf "`date '+%Y%m%d %T'` all: done\n" -printf "`date '+%Y%m%d %T'` all: done\r\n" > $console [ -x ../tools/fail.sh ] && ../tools/fail.sh find /tmp . -name "*.core" -mtime -2 -maxdepth 2 -ls 2>/dev/null From owner-svn-src-user@freebsd.org Sun Dec 8 06:34:36 2019 Return-Path: Delivered-To: svn-src-user@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5DAF31DA223 for ; Sun, 8 Dec 2019 06:34: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 47VxPm1ntSz3DQy; Sun, 8 Dec 2019 06:34:36 +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 1E86A26229; Sun, 8 Dec 2019 06:34:36 +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 xB86Ya1e092553; Sun, 8 Dec 2019 06:34:36 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB86YZuh092552; Sun, 8 Dec 2019 06:34:35 GMT (envelope-from pho@FreeBSD.org) Message-Id: <201912080634.xB86YZuh092552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Sun, 8 Dec 2019 06:34:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r355524 - 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: 355524 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: Sun, 08 Dec 2019 06:34:36 -0000 Author: pho Date: Sun Dec 8 06:34:35 2019 New Revision: 355524 URL: https://svnweb.freebsd.org/changeset/base/355524 Log: Added a regression test. Added: user/pho/stress2/misc/sendmsg2.sh (contents, props changed) Added: user/pho/stress2/misc/sendmsg2.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/sendmsg2.sh Sun Dec 8 06:34:35 2019 (r355524) @@ -0,0 +1,145 @@ +#!/bin/sh + +# +# Test scenario by Tanaka Akira +# from Bug 131876 - [socket] FD leak by receiving SCM_RIGHTS by recvmsg with +# small control message buffer +# Fixed by 337423 + +# $FreeBSD$ + +. ../default.cfg + +dir=/tmp +odir=`pwd` +cd $dir +sed '1,/^EOF/d' < $odir/$0 > $dir/sendmsg2.c +mycc -o sendmsg2 -Wall -Wextra -O0 -g sendmsg2.c || exit 1 +rm -f sendmsg2.c +cd $odir + +start=`date +%s` +/tmp/sendmsg2 & +while [ $((`date +%s` - start)) -lt 300 ]; do + kill -0 $! > /dev/null 2>&1 || break + sleep 2 +done +if kill -0 $! > /dev/null 2>&1; then + echo FAIL + ps -lp $! + procstat -k $! + kill -9 $! +fi +while pkill sendmsg2; do :; done +wait +s=$? +rm -f /tmp/sendmsg2 +exit $s +EOF +#include +#include +#include + +#include +#include +#include +#include + +#define MAX_FDS 10 +#define SEND_FDS 10 +#define RECV_FDS 3 + +void +test(void) +{ + struct msghdr msg; + struct iovec iov; + union { + struct cmsghdr header; + char bytes[CMSG_SPACE(sizeof(int)*MAX_FDS)]; + } cmsg; + struct cmsghdr *cmh = &cmsg.header, *c; + int *fds; + int i; + int ret; + int sv[2]; + char buf[1024]; + char cmdline[1024]; + + snprintf(cmdline, sizeof(cmdline), "fstat -p %u", (unsigned)getpid()); + + ret = socketpair(PF_UNIX, SOCK_STREAM, 0, sv); + if (ret == -1) { perror("socketpair"); exit(1); } + + iov.iov_base = "a"; + iov.iov_len = 1; + + cmh->cmsg_len = CMSG_LEN(sizeof(int)*SEND_FDS); + cmh->cmsg_level = SOL_SOCKET; + cmh->cmsg_type = SCM_RIGHTS; + fds = (int *)CMSG_DATA(cmh); + for (i = 0; i < SEND_FDS; i++) { + fds[i] = 0; /* stdin */ + } + + msg.msg_name = NULL; + msg.msg_namelen = 0; + msg.msg_iov = &iov; + msg.msg_iovlen = 1; + msg.msg_control = cmh; + msg.msg_controllen = CMSG_SPACE(sizeof(int)*SEND_FDS); + msg.msg_flags = 0; + + ret = sendmsg(sv[0], &msg, 0); + if (ret == -1) { perror("sendmsg"); exit(1); } + + + iov.iov_base = buf; + iov.iov_len = sizeof(buf); + + msg.msg_name = NULL; + msg.msg_namelen = 0; + msg.msg_iov = &iov; + msg.msg_iovlen = 1; + msg.msg_control = cmh; + msg.msg_controllen = CMSG_SPACE(sizeof(int)*RECV_FDS); + msg.msg_flags = 0; + +#if defined(DEBUG) + printf("before recvmsg: msg_controllen=%d\n", msg.msg_controllen); +#endif + + ret = recvmsg(sv[1], &msg, 0); + if (ret == -1) { perror("sendmsg"); exit(1); } + +#if defined(DEBUG) + printf("after recvmsg: msg_controllen=%d\n", msg.msg_controllen); +#endif + + for (c = CMSG_FIRSTHDR(&msg); c != NULL; c = CMSG_NXTHDR(&msg, c)) { + if (c->cmsg_len == 0) { printf("cmsg_len is zero\n"); exit(1); } + if (c->cmsg_level == SOL_SOCKET && c->cmsg_type == SCM_RIGHTS) { + int *fdp, *end; + printf("cmsg_len=%d\n", c->cmsg_len); + fdp = (int *)CMSG_DATA(c); + end = (int *)((char *)c + c->cmsg_len); + for (i = 0; fdp+i < end; i++) { + printf("fd[%d]=%d\n", i, fdp[i]); + } + } + } + /* Note the missing sockets close */ +} + +int +main(void) +{ + time_t start; + + alarm(600); + start = time(NULL); + while (time(NULL) - start < 300) + test(); + + return (0); +} From owner-svn-src-user@freebsd.org Sun Dec 8 06:35:26 2019 Return-Path: Delivered-To: svn-src-user@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 055E71DA2CA for ; Sun, 8 Dec 2019 06:35:26 +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 47VxQj6R1vz3DXk; Sun, 8 Dec 2019 06:35:25 +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 C19532622B; Sun, 8 Dec 2019 06:35:25 +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 xB86ZPsB092644; Sun, 8 Dec 2019 06:35:25 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB86ZPbI092643; Sun, 8 Dec 2019 06:35:25 GMT (envelope-from pho@FreeBSD.org) Message-Id: <201912080635.xB86ZPbI092643@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Sun, 8 Dec 2019 06:35:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r355525 - 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: 355525 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: Sun, 08 Dec 2019 06:35:26 -0000 Author: pho Date: Sun Dec 8 06:35:25 2019 New Revision: 355525 URL: https://svnweb.freebsd.org/changeset/base/355525 Log: Added a regression test. Added: user/pho/stress2/misc/ufssuspend.sh (contents, props changed) Added: user/pho/stress2/misc/ufssuspend.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/ufssuspend.sh Sun Dec 8 06:35:25 2019 (r355525) @@ -0,0 +1,133 @@ +#!/bin/sh + +# ioctl(g_ufs_suspend_handle, UFSSUSPEND, &statfsp->f_fsid) test scenario. + +# Bug 230220 - UFS: the freezing ioctl (i.e.UFSSUSPEND) causes panic or EBUSY +# "panic: devfs_set_cdevpriv failed" seen. +# Test scenario by Dexuan Cui +# Fixed by r337055. + +# $FreeBSD$ + +[ `id -u` -ne 0 ] && echo "Must be root!" && exit 1 +. ../default.cfg + +cat > /tmp/ufssuspend.c < +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static int g_ufs_suspend_handle = -1; +static const char *dev = "/dev"; + +static int +freeze(void) +{ + struct statfs *mntbuf, *statfsp; + int mntsize; + int error = 0; + int i; + + g_ufs_suspend_handle = open(_PATH_UFSSUSPEND, O_RDWR); + if (g_ufs_suspend_handle == -1) { + printf("unable to open %s", _PATH_UFSSUSPEND); + return (errno); + } + + mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); + if (mntsize == 0) { + printf("There is no mount information\n"); + return (EINVAL); + } + + for (i = mntsize - 1; i >= 0; --i) { + statfsp = &mntbuf[i]; + + if (strncmp(statfsp->f_mntonname, dev, strlen(dev)) == 0) + continue; /* skip to freeze '/dev' */ + + if (statfsp->f_flags & MNT_RDONLY) + continue; /* skip to freeze RDONLY partition */ + + if (strncmp(statfsp->f_fstypename, "ufs", 3) != 0) + continue; /* so far, only UFS can be frozen */ + + printf("suspending fs: %s\n", statfsp->f_mntonname); + error = ioctl(g_ufs_suspend_handle, UFSSUSPEND, &statfsp->f_fsid); + if (error != 0) { + printf("error: %d\n", errno); + error = errno; + } else { + printf("Successfully suspend fs: %s\n", statfsp->f_mntonname); + } + } + + return (error); +} + +/** + * closing the opened handle will thaw the FS. + */ +static int +thaw(void) +{ + int error = 0; + + if (g_ufs_suspend_handle != -1) { + error = close(g_ufs_suspend_handle); + if (!error) { + g_ufs_suspend_handle = -1; + printf("Successfully thaw the fs\n"); + } else { + error = errno; + printf("Fail to thaw the fs: " + "%d %s\n", errno, strerror(errno)); + } + } else { + printf("The fs has already been thawed\n\n"); + } + + return (error); +} + +int +main(void) +{ + int error; + + error = freeze(); + printf("freeze: err=%d\n", error); + + error = thaw(); + printf("thaw: err=%d\n", error); + + return 0; +} +EOF + +mycc -o /tmp/ufssuspend -Wall -Wextra -O2 -g /tmp/ufssuspend.c || exit 1 +rm /tmp/ufssuspend.c + +cd /tmp +./ufssuspend > /dev/null +s=$? +rm /tmp/ufssuspend +exit $s From owner-svn-src-user@freebsd.org Sun Dec 8 06:41:15 2019 Return-Path: Delivered-To: svn-src-user@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C506A1DA560 for ; Sun, 8 Dec 2019 06:41:15 +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 47VxYR4t0Zz3DjQ; Sun, 8 Dec 2019 06:41:15 +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 8A7EB26271; Sun, 8 Dec 2019 06:41:15 +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 xB86fFfl094281; Sun, 8 Dec 2019 06:41:15 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB86fFmJ094278; Sun, 8 Dec 2019 06:41:15 GMT (envelope-from pho@FreeBSD.org) Message-Id: <201912080641.xB86fFmJ094278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Sun, 8 Dec 2019 06:41:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r355526 - 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: 355526 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: Sun, 08 Dec 2019 06:41:15 -0000 Author: pho Date: Sun Dec 8 06:41:14 2019 New Revision: 355526 URL: https://svnweb.freebsd.org/changeset/base/355526 Log: Add two regression tests. Added: user/pho/stress2/misc/badcode.sh (contents, props changed) user/pho/stress2/misc/badcode2.sh (contents, props changed) Added: user/pho/stress2/misc/badcode.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/badcode.sh Sun Dec 8 06:41:14 2019 (r355526) @@ -0,0 +1,67 @@ +#!/bin/sh + +# +# Copyright (c) 2016 Dell EMC +# All rights reserved. +# +# 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$ +# + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +# Run tests on a 2g swap backed MD with UFS SU fs. + +# "panic: SACK scoreboard must not be empty" seen: +# https://people.freebsd.org/~pho/stress/log/full.txt +# Fixed by r310547. + +. ../default.cfg +kldstat -v | grep -q pty || kldload pty # ignore any load failure + +mount | grep "on $mntpoint " | grep -q /dev/md && umount -f $mntpoint +[ -c /dev/md$mdstart ] && mdconfig -d -u $mdstart +mdconfig -a -t swap -s 2g -u $mdstart +bsdlabel -w md$mdstart auto +newfs $newfs_flags md${mdstart}$part > /dev/null +mount /dev/md${mdstart}$part $mntpoint +chmod 777 $mntpoint + +export LOAD=80 +export rwLOAD=80 +export runRUNTIME=10m +export RUNDIR=$mntpoint/stressX + +export TESTPROGS=" +testcases/badcode/badcode +testcases/swap/swap +testcases/sysctl/sysctl +" +su $testuser -c 'cd ..; ./testcases/run/run $TESTPROGS' + +../tools/killall.sh +while mount | grep "on $mntpoint " | grep -q /dev/md; do + umount $mntpoint || sleep 1 +done +checkfs /dev/md${mdstart}$part +mdconfig -d -u $mdstart Added: user/pho/stress2/misc/badcode2.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/badcode2.sh Sun Dec 8 06:41:14 2019 (r355526) @@ -0,0 +1,58 @@ +#!/bin/sh + +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2019 Peter Holm +# +# 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$ +# +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +# Freeze seen: https://people.freebsd.org/~pho/stress/log/kostik1241.txt +# Fixed by: r355474 + +. ../default.cfg + +mount | grep "on $mntpoint " | grep -q /dev/md && umount -f $mntpoint +[ -c /dev/md$mdstart ] && mdconfig -d -u $mdstart +mdconfig -a -t swap -s 2g -u $mdstart +newfs $newfs_flags md$mdstart > /dev/null +mount /dev/md$mdstart $mntpoint +chmod 777 $mntpoint + +export badcodeLOAD=100 +export runRUNTIME=10m +export RUNDIR=$mntpoint/stressX + +export TESTPROGS="testcases/badcode/badcode" +su $testuser -c 'cd ..; ./testcases/run/run $TESTPROGS' + +../tools/killall.sh +while mount | grep "on $mntpoint " | grep -q /dev/md; do + umount $mntpoint || sleep 1 +done +mdconfig -d -u $mdstart +exit + From owner-svn-src-user@freebsd.org Sun Dec 8 09:44:51 2019 Return-Path: Delivered-To: svn-src-user@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 17AD51DEC84 for ; Sun, 8 Dec 2019 09:44:51 +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 47W1dG6snNz3MpY; Sun, 8 Dec 2019 09:44:50 +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 CF584427; Sun, 8 Dec 2019 09:44:50 +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 xB89iolw004486; Sun, 8 Dec 2019 09:44:50 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB89ioxd004485; Sun, 8 Dec 2019 09:44:50 GMT (envelope-from pho@FreeBSD.org) Message-Id: <201912080944.xB89ioxd004485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Sun, 8 Dec 2019 09:44:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r355527 - 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: 355527 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: Sun, 08 Dec 2019 09:44:51 -0000 Author: pho Date: Sun Dec 8 09:44:50 2019 New Revision: 355527 URL: https://svnweb.freebsd.org/changeset/base/355527 Log: Added comment about problem found. Modified: user/pho/stress2/misc/tmpfs13.sh Modified: user/pho/stress2/misc/tmpfs13.sh ============================================================================== --- user/pho/stress2/misc/tmpfs13.sh Sun Dec 8 06:41:14 2019 (r355526) +++ user/pho/stress2/misc/tmpfs13.sh Sun Dec 8 09:44:50 2019 (r355527) @@ -36,6 +36,9 @@ # http://people.freebsd.org/~pho/stress/log/tmpfs13.txt # Fixed by r269457. +# "panic: vm_domainset_iter_first: Invalid domain 2" seen. +# Fixed by r339075 + . ../default.cfg N=`sysctl -n hw.ncpu`