From owner-svn-src-user@freebsd.org Mon Feb 6 09:31:27 2017 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4AC12CD3559 for ; Mon, 6 Feb 2017 09:31:27 +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 mx1.freebsd.org (Postfix) with ESMTPS id 22DFEBD0; Mon, 6 Feb 2017 09:31:27 +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 v169VQTE081980; Mon, 6 Feb 2017 09:31:26 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v169VQbb081978; Mon, 6 Feb 2017 09:31:26 GMT (envelope-from pho@FreeBSD.org) Message-Id: <201702060931.v169VQbb081978@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Mon, 6 Feb 2017 09:31:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r313334 - user/pho/stress2/misc X-SVN-Group: user 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.23 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, 06 Feb 2017 09:31:27 -0000 Author: pho Date: Mon Feb 6 09:31:25 2017 New Revision: 313334 URL: https://svnweb.freebsd.org/changeset/base/313334 Log: Removed tests from the exclude list after problems were fixed. Added the option for using a debug include file. Sponsored by: Dell EMC Isilon Added: user/pho/stress2/misc/all.debug.inc Modified: user/pho/stress2/misc/all.sh Added: user/pho/stress2/misc/all.debug.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/all.debug.inc Mon Feb 6 09:31:25 2017 (r313334) @@ -0,0 +1,22 @@ +# $FreeBSD$ + +# Example debug include file for misc/all.sh + +pre_debug() { + if [ ! $debug_first ] ; then + debug_first=1 + debug_statfs=`vmstat -m | grep statfs | awk '{print $2}'` + fi +} + +post_debug() { + local debug_old + + debug_old=$debug_statfs + debug_statfs=`vmstat -m | grep statfs | awk '{print $2}'` + [ $((debug_statfs - debug_old)) -gt 1 ] && + printf "statfs leak: $i %d %d\r\n" \ + $((debug_statfs - debug_old)) $debug_statfs > $console +} + +all_debug=1 Modified: user/pho/stress2/misc/all.sh ============================================================================== --- user/pho/stress2/misc/all.sh Mon Feb 6 09:18:47 2017 (r313333) +++ user/pho/stress2/misc/all.sh Mon Feb 6 09:31:25 2017 (r313334) @@ -62,19 +62,13 @@ # newfs4.sh Deadlock seen 20150906 # nfs10.sh Double fault 20151013 # nfs16.sh panic: Failed to register NFS lock locally - error=11 20160608 -# oovm.sh Waiting for PQ_LAUNDRY 20151206 -# oovm2.sh Waiting for PQ_LAUNDRY 20151206 # pfl3.sh panic: handle_written_inodeblock: live inodedep 20140812 # pmc.sh NMI ... going to debugger 20111217 -# posix_openpt2.sh -# WiP 20160109 -# pty.sh WiP 20160111 # snap5-1.sh mksnap_ffs deadlock 20111218 # 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 -# rw.sh Out of VM 20151116 # sendmsg.sh Test loops in the kernel 20160519 # shm_open.sh panic: kmem_malloc(4096): kmem_map too small 20130504 # snap3.sh mksnap_ffs stuck in snaprdb 20111226 @@ -123,9 +117,7 @@ # nfs2.sh panic: wrong diroffset 20140219 # nfs5.sh # nfs6.sh -# nfs10.sh # nfs11.sh vmwait deadlock 20151004 -# nfs13.sh # nullfs8.sh # End of list @@ -200,6 +192,7 @@ rm -f $alllog $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 console=/dev/console printf "\r\n" > $console & @@ -208,6 +201,7 @@ sleep 1 kill -0 $pid > /dev/null 2>&1 && { console=/dev/null; kill -9 $pid; } +[ -f all.debug.inc ] && . all.debug.inc while true; do exclude=`sed -n '/^# Start of list/,/^# End of list/p' < $0 | cat - all.exclude 2>/dev/null | @@ -250,6 +244,7 @@ while true; do printf "`date '+%Y%m%d %T'` all ($n1/$n2): $i\n" >> $alllog printf "`date '+%Y%m%d %T'` all ($n1/$n2): $i\r\n" > $console logger "Starting test all: $i" + [ $all_debug ] && pre_debug sync;sync;sync start=`date '+%s'` ( @@ -270,6 +265,7 @@ while true; do echo "swap still running" sleep 2 done + [ $all_debug ] && post_debug done [ -n "$once" ] && break done From owner-svn-src-user@freebsd.org Fri Feb 10 11:15:14 2017 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49EE9CD9C26 for ; Fri, 10 Feb 2017 11:15:14 +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 mx1.freebsd.org (Postfix) with ESMTPS id 1A7C5AFE; Fri, 10 Feb 2017 11:15:14 +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 v1ABFDAP018200; Fri, 10 Feb 2017 11:15:13 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1ABFDmM018198; Fri, 10 Feb 2017 11:15:13 GMT (envelope-from pho@FreeBSD.org) Message-Id: <201702101115.v1ABFDmM018198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Fri, 10 Feb 2017 11:15:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r313545 - user/pho/stress2/misc X-SVN-Group: user 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.23 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, 10 Feb 2017 11:15:14 -0000 Author: pho Date: Fri Feb 10 11:15:12 2017 New Revision: 313545 URL: https://svnweb.freebsd.org/changeset/base/313545 Log: Added two regression tests. Sponsored by: Dell EMC Isilon Added: user/pho/stress2/misc/dev3.sh (contents, props changed) user/pho/stress2/misc/pts2.sh (contents, props changed) Added: user/pho/stress2/misc/dev3.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/dev3.sh Fri Feb 10 11:15:12 2017 (r313545) @@ -0,0 +1,162 @@ +#!/bin/sh + +# +# Copyright (c) 2017 Dell EMC Isilon +# 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$ +# + +# pts memory leak regression test. + +# Leaks seen when flags is either O_SHLOCK or O_EXLOCK and /dev/ptmx and +# /dev/pts/ is being opened. +# Fixed in r313496. + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +. ../default.cfg + +kldstat -v | grep -q pty || { kldload pty || exit 0; } +here=`pwd` +cd /tmp +sed '1,/^EOF/d' < $here/$0 > dev3.c +mycc -o dev3 -Wall -Wextra -O2 dev3.c || exit 1 +rm -f dev3.c + +#(cd $here/../testcases/swap; ./swap -t 10h -i 20 -l 100) > \ +# /dev/null & + +pts=`vmstat -m | grep pts | awk '{print $2}'` +[ -z "$pts" ] && pts=0 + +e=0 +n=0 +while true; do + su $testuser -c "/tmp/dev3 $n" + new=`vmstat -m | grep pts | awk '{print $2}'` + if [ $new -gt $pts ]; then + leak=$((new - pts)) + printf "flag %d (0x%x) leaks %d pts, %d allocated.\n" $n $n \ + $leak $new + pts=$new + e=1 + fi + [ $n -eq 0 ] && n=1 || n=$((n * 2)) + [ $n -gt $((0x00200000)) ] && break # O_VERIFY +done +while pkill -9 swap; do + sleep 1 +done +wait +rm -f /tmp/dev3 +exit $e +EOF +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define PARALLEL 4 +#define RUNTIME 60 + +jmp_buf jbuf; +char path[80]; + +void +handler(int i __unused) { + longjmp(jbuf, 1); +} + +void +churn(int flag, char *path) +{ + FTS *fts; + FTSENT *p; + time_t start; + int fd, ftsoptions; + char *args[2]; + + ftsoptions = FTS_PHYSICAL; + args[0] = path; + args[1] = 0; + + start = time(NULL); + while (time(NULL) - start < RUNTIME) { + if ((fts = fts_open(args, ftsoptions, NULL)) == NULL) + err(1, "fts_open"); + + (void)setjmp(jbuf); + ualarm(0, 0); + while ((p = fts_read(fts)) != NULL) { + if (p->fts_info == FTS_D || + p->fts_info == FTS_DP) + continue; + ualarm(500000, 0); + if ((fd = open(p->fts_path, flag)) == -1) + continue; + ualarm(0, 0); + usleep(arc4random() % 1000); + close(fd); + + } + + if (errno != 0 && errno != ENOENT) + warn("fts_read"); + if (fts_close(fts) == -1) + err(1, "fts_close()"); + } + + _exit(0); +} + +int +main(int argc, char *argv[]) +{ + int flag, i; + + if (argc != 2) { + fprintf(stderr, "Usage: %s \n", argv[0]); + exit(1); + } + flag = atoi(argv[1]); + signal(SIGALRM, handler); + for (i = 0; i < PARALLEL; i++) + if (fork() == 0) + churn(flag, "/dev"); + + for (i = 0; i < PARALLEL; i++) + wait(NULL); + + return (0); +} Added: user/pho/stress2/misc/pts2.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/pts2.sh Fri Feb 10 11:15:12 2017 (r313545) @@ -0,0 +1,81 @@ +#!/bin/sh + +# +# Copyright (c) 2017 Dell EMC Isilon +# 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$ +# + +# pts leak seen. +# Fixed in r313496. + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 +kldstat -v | grep -q pty || { kldload pty || exit 0; } + +. ../default.cfg + +here=`pwd` +cd /tmp +sed '1,/^EOF/d' < $here/$0 > pts2.c +mycc -o pts2 -Wall -Wextra -O2 pts2.c || exit 1 +rm -f pts2.c + +pts=`vmstat -m | grep pts | awk '{print $2}'` +for i in `jot 10`; do + /tmp/pts2 +done +new=`vmstat -m | grep pts | awk '{print $2}'` +s=0 +[ $((new - pts)) -gt 1 ] && { s=1; echo "Leaked $((new - pts)) pts."; } + +rm -f /tmp/pts2 +exit $s +EOF +#include + +#include +#include +#include + +const char *master = "/dev/ptmx"; +int +main(void) +{ + int fd, fd2, slave; + char sl[80]; + + if ((fd = open(master, O_RDONLY)) == -1) + err(1, "open(%s)", master); + + if (ioctl(fd, TIOCGPTN, &slave) == -1) + err(1, "ioctl"); + + snprintf(sl, sizeof(sl), "/dev/pts/%d", slave); + + if ((fd2 = open(sl, O_RDONLY | O_EXLOCK)) == -1) + err(1, "open(%s)", sl); + + return (0); +} From owner-svn-src-user@freebsd.org Fri Feb 10 11:17:47 2017 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47EA7CD9C43 for ; Fri, 10 Feb 2017 11:17: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 mx1.freebsd.org (Postfix) with ESMTPS id E47C8C1E; Fri, 10 Feb 2017 11:17:46 +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 v1ABHjAt018336; Fri, 10 Feb 2017 11:17:45 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1ABHjUc018334; Fri, 10 Feb 2017 11:17:45 GMT (envelope-from pho@FreeBSD.org) Message-Id: <201702101117.v1ABHjUc018334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Fri, 10 Feb 2017 11:17:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r313546 - user/pho/stress2/misc X-SVN-Group: user 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.23 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, 10 Feb 2017 11:17:47 -0000 Author: pho Date: Fri Feb 10 11:17:45 2017 New Revision: 313546 URL: https://svnweb.freebsd.org/changeset/base/313546 Log: Removed test from the no-run list after trimming the run time. Sponsored by: Dell EMC Isilon Modified: user/pho/stress2/misc/all.sh user/pho/stress2/misc/marcus4.sh Modified: user/pho/stress2/misc/all.sh ============================================================================== --- user/pho/stress2/misc/all.sh Fri Feb 10 11:15:12 2017 (r313545) +++ user/pho/stress2/misc/all.sh Fri Feb 10 11:17:45 2017 (r313546) @@ -95,7 +95,6 @@ # fuzz.sh A know issue # marcus3.sh OK, but runs for a long time -# marcus4.sh OK, but runs for a long time # statfs.sh Not very interesting # vunref.sh No problems ever seen # vunref2.sh No problems ever seen Modified: user/pho/stress2/misc/marcus4.sh ============================================================================== --- user/pho/stress2/misc/marcus4.sh Fri Feb 10 11:15:12 2017 (r313545) +++ user/pho/stress2/misc/marcus4.sh Fri Feb 10 11:17:45 2017 (r313546) @@ -34,19 +34,23 @@ # Deadlock and "panic: smp_targeted_tlb_shootdown: interrupts disabled" # https://people.freebsd.org/~pho/stress/log/marcus4.txt +# "panic: spin lock held too long" seen. +# Fixed in r313472. + . ../default.cfg -pgrep -q watchdogd && exit 0 +pgrep -q watchdogd && { service watchdogd stop > /dev/null && restart=1; } dev=$(df -h `dirname $RUNDIR` | tail -1 | awk '{print $1}') mount | grep $dev | grep -q journaled && exit 0 size=$((`sysctl -n hw.physmem` / 1024 / 1024)) [ $size -gt $((4 * 1024)) ] && - { echo "RAM must be capped to 4GB for this test."; exit 0; } + { echo "RAM should be capped to 4GB for this test."; } [ "`sysctl -n debug.deadlkres.sleepfreq 2>/dev/null`" = "3" ] && { echo "deadlkres must be disabled for this test."; exit 0; } n=`find ../testcases -perm -1 -type f | wc -l` m=`su $testuser -c "limits | grep maxprocesses | awk '{print \\$NF}'"` +m=$((m / 2)) export INCARNATIONS=$((m / n)) export runRUNTIME=15m @@ -67,4 +71,12 @@ testcases/rename/rename testcases/mkfifo/mkfifo " -su $testuser -c 'cd ..; ./testcases/run/run $TESTPROGS' +su $testuser -c 'cd ..; ./testcases/run/run $TESTPROGS' & + +sleep $((16 * 60)) +../tools/killall.sh +wait +./cleanup.sh + +[ $restart ] && service watchdogd start > /dev/null +exit 0