From owner-svn-src-user@freebsd.org Sun Feb 9 08:26:37 2020 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 9373A231273 for ; Sun, 9 Feb 2020 08:26:37 +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 48Fhvx3D8Sz3LTY; Sun, 9 Feb 2020 08:26:37 +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 69B1333E5; Sun, 9 Feb 2020 08:26:37 +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 0198QbSe060342; Sun, 9 Feb 2020 08:26:37 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0198QbfH060341; Sun, 9 Feb 2020 08:26:37 GMT (envelope-from pho@FreeBSD.org) Message-Id: <202002090826.0198QbfH060341@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Sun, 9 Feb 2020 08:26:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r357689 - 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: 357689 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, 09 Feb 2020 08:26:37 -0000 Author: pho Date: Sun Feb 9 08:26:36 2020 New Revision: 357689 URL: https://svnweb.freebsd.org/changeset/base/357689 Log: Added a regression test Added: user/pho/stress2/misc/swap6.sh (contents, props changed) Added: user/pho/stress2/misc/swap6.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/swap6.sh Sun Feb 9 08:26:36 2020 (r357689) @@ -0,0 +1,53 @@ +#!/bin/sh + +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2020 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$ + +# Verify that the VM pressure generated is sufficient for stress testing. +# Regression test for OOM fix in r357253 + +. ../default.cfg + +[ `sysctl -n vm.swap_total` -eq 0 ] && exit 0 +min=5 # percent swap usage +(cd ../testcases/swap; ./swap -t 5m -i 20 -l 100 -h > /dev/null) & +sleep 5 +mx=0 +while pgrep -q swap; do + n=`swapinfo | tail -1 | sed 's/.* //; s/%//'` + [ $n -gt $mx ] && mx=$n + [ $mx -ge $min ] && pkill swap + sleep 2 +done +wait +if [ $mx -lt $min ]; then + echo "FAIL Only $mx% swap used" + exit 1 +else + exit 0 +fi From owner-svn-src-user@freebsd.org Sun Feb 9 08:39:16 2020 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 96193231574 for ; Sun, 9 Feb 2020 08:39:16 +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 48FjBX3QJDz3LwK; Sun, 9 Feb 2020 08:39:16 +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 70AC33763; Sun, 9 Feb 2020 08:39:16 +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 0198dGJ5067304; Sun, 9 Feb 2020 08:39:16 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0198dG6K067303; Sun, 9 Feb 2020 08:39:16 GMT (envelope-from pho@FreeBSD.org) Message-Id: <202002090839.0198dG6K067303@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Sun, 9 Feb 2020 08:39:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r357690 - 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: 357690 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, 09 Feb 2020 08:39:16 -0000 Author: pho Date: Sun Feb 9 08:39:16 2020 New Revision: 357690 URL: https://svnweb.freebsd.org/changeset/base/357690 Log: Added a regression test. Added: user/pho/stress2/misc/procstat2.sh (contents, props changed) Added: user/pho/stress2/misc/procstat2.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/procstat2.sh Sun Feb 9 08:39:16 2020 (r357690) @@ -0,0 +1,46 @@ +#!/bin/sh + +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2020 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$ +# + +# This test scenario would trigger an NMI. +# https://people.freebsd.org/~pho/stress/log/mjguzik022.txt + +# Test scenario idea by Mark Johnston +# Fixed by r357334 + +../misc/marcus.sh > /dev/null 2>&1 & +start=`date +%s` +while [ $((`date +%s` - start)) -lt 300 ]; do + procstat -kka > /dev/null 2>&1 +done +../tools/killall.sh +wait + +exit 0 From owner-svn-src-user@freebsd.org Sun Feb 9 08:45:37 2020 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 4AAC12319B5 for ; Sun, 9 Feb 2020 08:45:37 +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 48FjKs1Dfkz3MTJ; Sun, 9 Feb 2020 08:45:37 +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 259D4396F; Sun, 9 Feb 2020 08:45:37 +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 0198jb2U073555; Sun, 9 Feb 2020 08:45:37 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0198jaTW073554; Sun, 9 Feb 2020 08:45:36 GMT (envelope-from pho@FreeBSD.org) Message-Id: <202002090845.0198jaTW073554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Sun, 9 Feb 2020 08:45:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r357691 - 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: 357691 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, 09 Feb 2020 08:45:37 -0000 Author: pho Date: Sun Feb 9 08:45:36 2020 New Revision: 357691 URL: https://svnweb.freebsd.org/changeset/base/357691 Log: Run test from /tmp. Fix cleanup. Modified: user/pho/stress2/misc/fexecve.sh Modified: user/pho/stress2/misc/fexecve.sh ============================================================================== --- user/pho/stress2/misc/fexecve.sh Sun Feb 9 08:39:16 2020 (r357690) +++ user/pho/stress2/misc/fexecve.sh Sun Feb 9 08:45:36 2020 (r357691) @@ -56,7 +56,7 @@ main(int argc __unused, char **argv) sz = 16 * 4096; - (void)snprintf(template, sizeof(template), "test.XXXXXX"); + (void)snprintf(template, sizeof(template), "fexecve.XXXXXX"); fd = mkstemp(template); if (fd < 0) err(1, "mkstemp"); @@ -91,6 +91,6 @@ main(int argc __unused, char **argv) EOF cc -o /tmp/fexecve -Wall -Wextra -O2 /tmp/fexecve.c || exit 1 echo "Expect: fexecve: fexecve: Input/output error" -/tmp/fexecve +(cd /tmp; /tmp/fexecve) -rm -f /tmp/fexecve /tmp/fexecve.c +rm -f /tmp/fexecve /tmp/fexecve.c /tmp/fexecve.?????? From owner-svn-src-user@freebsd.org Sun Feb 9 10:42:02 2020 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 45701234349 for ; Sun, 9 Feb 2020 10:42:02 +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 48FlwB18K1z3yBw; Sun, 9 Feb 2020 10:42:02 +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 22A7A4FC7; Sun, 9 Feb 2020 10:42:02 +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 019Ag2ZW051175; Sun, 9 Feb 2020 10:42:02 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 019Ag1OD051172; Sun, 9 Feb 2020 10:42:01 GMT (envelope-from pho@FreeBSD.org) Message-Id: <202002091042.019Ag1OD051172@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Sun, 9 Feb 2020 10:42:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r357692 - 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: 357692 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, 09 Feb 2020 10:42:02 -0000 Author: pho Date: Sun Feb 9 10:42:01 2020 New Revision: 357692 URL: https://svnweb.freebsd.org/changeset/base/357692 Log: Added some syzkaller "C reproducer" tests. Added: user/pho/stress2/misc/syzkaller1.sh (contents, props changed) user/pho/stress2/misc/syzkaller2.sh (contents, props changed) user/pho/stress2/misc/syzkaller3.sh (contents, props changed) Added: user/pho/stress2/misc/syzkaller1.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/syzkaller1.sh Sun Feb 9 10:42:01 2020 (r357692) @@ -0,0 +1,248 @@ +#!/bin/sh + +# panic: refcount 0xfffff8001dd678e8 wraparound +# cpuid = 4 +# time = 1580840365 +# KDB: stack backtrace: +# db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe00e56517b0 +# vpanic() at vpanic+0x185/frame 0xfffffe00e5651810 +# panic() at panic+0x43/frame 0xfffffe00e5651870 +# _refcount_update_saturated() at _refcount_update_saturated+0x15/frame 0xfffffe00e5651880 +# refcount_release_last() at refcount_release_last+0x7c/frame 0xfffffe00e56518a0 +# closef() at closef+0x1f7/frame 0xfffffe00e5651930 +# fdescfree_fds() at fdescfree_fds+0x3c/frame 0xfffffe00e5651980 +# fdescfree() at fdescfree+0x456/frame 0xfffffe00e5651a40 +# exit1() at exit1+0x4f3/frame 0xfffffe00e5651ab0 +# sys_sys_exit() at sys_sys_exit+0xd/frame 0xfffffe00e5651ac0 +# amd64_syscall() at amd64_syscall+0x2f1/frame 0xfffffe00e5651bf0 +# fast_syscall_common() at fast_syscall_common+0x101/frame 0xfffffe00e5651bf0 +# --- syscall (1, FreeBSD ELF64, sys_sys_exit), rip = 0x8003d53ba, rsp = 0x7fffffffe9f8, rbp = 0x7fffffffea10 --- + +# Fixed by r357554 + +# $FreeBSD$ + +. ../default.cfg +cat > /tmp/syzkaller1.c < +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static void sleep_ms(uint64_t ms) +{ + usleep(ms * 1000); +} + +static uint64_t current_time_ms(void) +{ + struct timespec ts; + if (clock_gettime(CLOCK_MONOTONIC, &ts)) + exit(1); + return (uint64_t)ts.tv_sec * 1000 + (uint64_t)ts.tv_nsec / 1000000; +} + +static void thread_start(void* (*fn)(void*), void* arg) +{ + pthread_t th; + pthread_attr_t attr; + pthread_attr_init(&attr); + pthread_attr_setstacksize(&attr, 128 << 10); + int i; + for (i = 0; i < 100; i++) { + if (pthread_create(&th, &attr, fn, arg) == 0) { + pthread_attr_destroy(&attr); + return; + } + if (errno == EAGAIN) { + usleep(50); + continue; + } + break; + } + exit(1); +} + +typedef struct { + pthread_mutex_t mu; + pthread_cond_t cv; + int state; +} event_t; + +static void event_init(event_t* ev) +{ + if (pthread_mutex_init(&ev->mu, 0)) + exit(1); + if (pthread_cond_init(&ev->cv, 0)) + exit(1); + ev->state = 0; +} + +static void event_reset(event_t* ev) +{ + ev->state = 0; +} + +static void event_set(event_t* ev) +{ + pthread_mutex_lock(&ev->mu); + if (ev->state) + exit(1); + ev->state = 1; + pthread_mutex_unlock(&ev->mu); + pthread_cond_broadcast(&ev->cv); +} + +static void event_wait(event_t* ev) +{ + pthread_mutex_lock(&ev->mu); + while (!ev->state) + pthread_cond_wait(&ev->cv, &ev->mu); + pthread_mutex_unlock(&ev->mu); +} + +static int event_isset(event_t* ev) +{ + pthread_mutex_lock(&ev->mu); + int res = ev->state; + pthread_mutex_unlock(&ev->mu); + return res; +} + +static int event_timedwait(event_t* ev, uint64_t timeout) +{ + uint64_t start = current_time_ms(); + uint64_t now = start; + pthread_mutex_lock(&ev->mu); + for (;;) { + if (ev->state) + break; + uint64_t remain = timeout - (now - start); + struct timespec ts; + ts.tv_sec = remain / 1000; + ts.tv_nsec = (remain % 1000) * 1000 * 1000; + pthread_cond_timedwait(&ev->cv, &ev->mu, &ts); + now = current_time_ms(); + if (now - start > timeout) + break; + } + int res = ev->state; + pthread_mutex_unlock(&ev->mu); + return res; +} + +struct thread_t { + int created, call; + event_t ready, done; +}; + +static struct thread_t threads[16]; +static void execute_call(int call); +static int running; + +static void* thr(void* arg) +{ + struct thread_t* th = (struct thread_t*)arg; + for (;;) { + event_wait(&th->ready); + event_reset(&th->ready); + execute_call(th->call); + __atomic_fetch_sub(&running, 1, __ATOMIC_RELAXED); + event_set(&th->done); + } + return 0; +} + +static void loop(void) +{ + int i, call, thread; + for (call = 0; call < 7; call++) { + for (thread = 0; thread < (int)(sizeof(threads) / sizeof(threads[0])); + thread++) { + struct thread_t* th = &threads[thread]; + if (!th->created) { + th->created = 1; + event_init(&th->ready); + event_init(&th->done); + event_set(&th->done); + thread_start(thr, th); + } + if (!event_isset(&th->done)) + continue; + event_reset(&th->done); + th->call = call; + __atomic_fetch_add(&running, 1, __ATOMIC_RELAXED); + event_set(&th->ready); + event_timedwait(&th->done, 45); + break; + } + } + for (i = 0; i < 100 && __atomic_load_n(&running, __ATOMIC_RELAXED); i++) + sleep_ms(1); +} + +uint64_t r[3] = {0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff}; + +void execute_call(int call) +{ + intptr_t res; + switch (call) { + case 0: + memcpy((void*)0x20000000, "./file0\000", 8); + res = syscall(SYS_open, 0x20000000ul, 0x40000400000002c2ul, 0ul); + if (res != -1) + r[0] = res; + break; + case 1: + res = syscall(SYS_socket, 0x1cul, 1ul, 0ul); + if (res != -1) + r[1] = res; + break; + case 2: + syscall(SYS_listen, r[1], 0); + break; + case 3: + syscall(SYS_close, r[0]); + break; + case 4: + syscall(SYS_accept, r[1], 0ul, 0ul); + break; + case 5: + res = syscall(SYS_dup2, r[0], r[1]); + if (res != -1) + r[2] = res; + break; + case 6: + syscall(SYS_mmap, 0x20ffd000ul, 0x1000ul, 0ul, 0x10ul, r[2], 0ul); + break; + } +} +int main(void) +{ + syscall(SYS_mmap, 0x20000000ul, 0x1000000ul, 3ul, 0x1012ul, -1, 0ul); + loop(); + return 0; +} +EOF +mycc -o /tmp/syzkaller1 -Wall -Wextra -O2 /tmp/syzkaller1.c -lpthread || + exit 1 + +(cd /tmp; ./syzkaller1) + +rm /tmp/syzkaller1 /tmp/syzkaller1.c +exit 0 Added: user/pho/stress2/misc/syzkaller2.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/syzkaller2.sh Sun Feb 9 10:42:01 2020 (r357692) @@ -0,0 +1,91 @@ +#!/bin/sh + +# panic: mutex pcbinfohash not owned at +# /syzkaller/managers/main/kernel/sys/netinet6/in6_pcb.c:717 +# cpuid = 0 +# time = 1573247472 +# KDB: stack backtrace: +# db_trace_self_wrapper() at db_trace_self_wrapper+0x47/frame +# 0xfffffe0022a56260 +# vpanic() at vpanic+0x1c7/frame 0xfffffe0022a562d0 +# panic() at panic+0x43/frame 0xfffffe0022a56330 +# __mtx_assert() at __mtx_assert+0x18b/frame 0xfffffe0022a56370 +# in6_pcblookup_local() at in6_pcblookup_local+0x53/frame 0xfffffe0022a563c0 +# in_pcb_lport() at in_pcb_lport+0x3fd/frame 0xfffffe0022a56450 +# in_pcbbind_setup() at in_pcbbind_setup+0x28b/frame 0xfffffe0022a564f0 +# in_pcbconnect_setup() at in_pcbconnect_setup+0x4aa/frame 0xfffffe0022a565b0 +# udp_send() at udp_send+0xee4/frame 0xfffffe0022a566c0 +# udp6_send() at udp6_send+0x4e8/frame 0xfffffe0022a56870 +# sosend_dgram() at sosend_dgram+0x54f/frame 0xfffffe0022a568e0 +# sosend() at sosend+0xc6/frame 0xfffffe0022a56950 +# kern_sendit() at kern_sendit+0x32d/frame 0xfffffe0022a56a00 +# sendit() at sendit+0x226/frame 0xfffffe0022a56a60 +# sys_sendto() at sys_sendto+0x5c/frame 0xfffffe0022a56ac0 +# amd64_syscall() at amd64_syscall+0x473/frame 0xfffffe0022a56bf0 +# fast_syscall_common() at fast_syscall_common+0x101/frame 0xfffffe0022a56bf0 +# --- syscall (0, FreeBSD ELF64, nosys), rip = 0x41c3aa, rsp = + +# $FreeBSD$ + +. ../default.cfg +cat > /tmp/syzkaller2.c < +#include +#include +#include +#include +#include +#include +#include +#include +#include + +uint64_t r[1] = {0xffffffffffffffff}; + +int main(void) +{ + syscall(SYS_mmap, 0x20000000ul, 0x1000000ul, 3ul, 0x1012ul, -1, 0ul); + intptr_t res = 0; + res = syscall(SYS_socket, 0x1cul, 2ul, 0ul); + if (res != -1) + r[0] = res; + *(uint32_t*)0x200001c0 = 0; + syscall(SYS_setsockopt, r[0], 0x29ul, 0x1bul, 0x200001c0ul, 4ul); + *(uint8_t*)0x20000100 = 0x1c; + *(uint8_t*)0x20000101 = 0x1c; + *(uint16_t*)0x20000102 = htobe16(0x4e21); + *(uint32_t*)0x20000104 = 0; + *(uint8_t*)0x20000108 = 0; + *(uint8_t*)0x20000109 = 0; + *(uint8_t*)0x2000010a = 0; + *(uint8_t*)0x2000010b = 0; + *(uint8_t*)0x2000010c = 0; + *(uint8_t*)0x2000010d = 0; + *(uint8_t*)0x2000010e = 0; + *(uint8_t*)0x2000010f = 0; + *(uint8_t*)0x20000110 = 0; + *(uint8_t*)0x20000111 = 0; + *(uint8_t*)0x20000112 = -1; + *(uint8_t*)0x20000113 = -1; + *(uint8_t*)0x20000114 = 0xac; + *(uint8_t*)0x20000115 = 0x14; + *(uint8_t*)0x20000116 = 0; + *(uint8_t*)0x20000117 = 0xaa; + *(uint32_t*)0x20000118 = 0; + syscall(SYS_sendto, r[0], 0ul, 0ul, 0ul, 0x20000100ul, 0x1cul); + return 0; +} +EOF +mycc -o /tmp/syzkaller2 -Wall -Wextra -O2 /tmp/syzkaller2.c || + exit 1 +rm /tmp/syzkaller2.c + +(cd /tmp; ./syzkaller2) + +rm /tmp/syzkaller2 +exit 0 Added: user/pho/stress2/misc/syzkaller3.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/syzkaller3.sh Sun Feb 9 10:42:01 2020 (r357692) @@ -0,0 +1,51 @@ +#!/bin/sh + +# panic: mutex process lock not owned at ../../../kern/kern_time.c:261 +# cpuid = 17 +# time = 1580844484 +# KDB: stack backtrace: +# db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe01387b7920 +# vpanic() at vpanic+0x185/frame 0xfffffe01387b7980 +# panic() at panic+0x43/frame 0xfffffe01387b79e0 +# __mtx_assert() at __mtx_assert+0xb0/frame 0xfffffe01387b79f0 +# kern_thread_cputime() at kern_thread_cputime+0x99/frame 0xfffffe01387b7a30 +# kern_clock_gettime() at kern_clock_gettime+0x2a6/frame 0xfffffe01387b7a90 +# sys_clock_gettime() at sys_clock_gettime+0x17/frame 0xfffffe01387b7ac0 +# amd64_syscall() at amd64_syscall+0x2f1/frame 0xfffffe01387b7bf0 +# fast_syscall_common() at fast_syscall_common+0x101/frame 0xfffffe01387b7bf0 +# --- syscall (0, FreeBSD ELF64, nosys), rip = 0x80041b8ca, rsp = 0x7fffffffe9f8, rbp = 0x7fffffffea10 --- + +# $FreeBSD$ + +. ../default.cfg +cat > /tmp/syzkaller3.c < +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int main(void) +{ + syscall(SYS_mmap, 0x20000000ul, 0x1000000ul, 3ul, 0x1012ul, -1, 0ul); + syscall(SYS_clock_gettime, 0xeul, 0ul); + return 0; +} +EOF +mycc -o /tmp/syzkaller3 -Wall -Wextra -O2 /tmp/syzkaller3.c || + exit 1 + +(cd /tmp; ./syzkaller3) + +rm /tmp/syzkaller3 /tmp/syzkaller3.c +exit 0 From owner-svn-src-user@freebsd.org Sun Feb 9 12:29:13 2020 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 A81BF238207 for ; Sun, 9 Feb 2020 12:29:13 +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 48FpHs3v8Kz45y5; Sun, 9 Feb 2020 12:29:13 +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 7BF4462C7; Sun, 9 Feb 2020 12:29:13 +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 019CTDFb018544; Sun, 9 Feb 2020 12:29:13 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 019CTDJj018543; Sun, 9 Feb 2020 12:29:13 GMT (envelope-from pho@FreeBSD.org) Message-Id: <202002091229.019CTDJj018543@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Sun, 9 Feb 2020 12:29:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r357699 - 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: 357699 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, 09 Feb 2020 12:29:13 -0000 Author: pho Date: Sun Feb 9 12:29:13 2020 New Revision: 357699 URL: https://svnweb.freebsd.org/changeset/base/357699 Log: Added a tmpfs test scenario. Added: user/pho/stress2/misc/tmpfs22.sh (contents, props changed) Added: user/pho/stress2/misc/tmpfs22.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/tmpfs22.sh Sun Feb 9 12:29:13 2020 (r357699) @@ -0,0 +1,120 @@ +#!/bin/sh + +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2020 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$ +# + +# A tmpfs "nomtime" mount option test. + +# kib@ wrote: +# A test program should do something along the lines: +# 1. open tmpfs file, ftruncate it, mmap +# 2. write to the mmaped file area periodically, for long time +# e.g. 1 write in 10 secs, for 120 secs +# 3. the mtime of the file should be the same as after the truncation +# if the nomtime flag is set. Otherwise, it should be around +-30 +# secs of the last write to the area. +# +# Really the current (unpatched) situation is some not well defined +# mix between nomtime and its absence. + +. ../default.cfg + +odir=`pwd` +cd /tmp +sed '1,/^EOF/d' < $odir/$0 > tmpfs22.c +mycc -o tmpfs22 -Wall -Wextra -O2 -g tmpfs22.c || exit 1 +rm -f tmpfs22.c +cd $odir + +mount | grep "$mntpoint" | grep -q tmpfs && umount $mntpoint +mount -o size=2g,nomtime -t tmpfs tmpfs $mntpoint || exit 1 + +(cd $mntpoint; /tmp/tmpfs22); s=$? + +for i in `jot 6`; do + umount $mntpoint && break + sleep 2 +done +rm -f /tmp/tmpfs22 +exit $s + +EOF +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +static char *file = "test"; + +int +main(void) +{ + struct stat st1, st2; + size_t len; + int fd, i, s; + char *p; + + if ((fd = open(file, O_RDWR | O_CREAT, 0644)) == -1) + err(1, "open(%s)", file); + len = 2LL * 1024 * 1024; + if (ftruncate(fd, len) == -1) + err(1, "ftruncate"); + if ((p = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)) == + MAP_FAILED) { + if (errno == ENOMEM) + return (1); + err(1, "mmap()"); + } + if (fstat(fd, &st1) == -1) + err(1, "fstat 1"); + + + for (i = 0; i < 12; i++) { + sleep(10); + p[arc4random() % len] = 1; + } + if (fstat(fd, &st2) == -1) + err(1, "fstat 2"); + s = 0; + if (st1.st_mtime != st2.st_mtime) { + fprintf(stderr, "mtime differs: %ld %ld\n", + (long)st1.st_mtime, (long)st2.st_mtime); + s=1; + } + munmap(p, len); + close(fd); + + return (s); +} From owner-svn-src-user@freebsd.org Mon Feb 10 08:46:39 2020 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 95AE1232770 for ; Mon, 10 Feb 2020 08:46:39 +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 48GKJb3RDXz49XC; Mon, 10 Feb 2020 08:46:39 +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 6C1281C7CF; Mon, 10 Feb 2020 08:46:39 +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 01A8kdtL053869; Mon, 10 Feb 2020 08:46:39 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01A8kdvh053868; Mon, 10 Feb 2020 08:46:39 GMT (envelope-from pho@FreeBSD.org) Message-Id: <202002100846.01A8kdvh053868@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Mon, 10 Feb 2020 08:46:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r357717 - 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: 357717 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: Mon, 10 Feb 2020 08:46:39 -0000 Author: pho Date: Mon Feb 10 08:46:38 2020 New Revision: 357717 URL: https://svnweb.freebsd.org/changeset/base/357717 Log: Added a regression test. Added: user/pho/stress2/misc/smrstress.sh (contents, props changed) Added: user/pho/stress2/misc/smrstress.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/smrstress.sh Mon Feb 10 08:46:38 2020 (r357717) @@ -0,0 +1,55 @@ +#!/bin/sh + +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2020 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$ +# + +# "panic: vm_page_assert_xbusied: page 0xf... not exclusive busy" seen +# https://people.freebsd.org/~pho/stress/log/jeff146.txt +# Fixed by r357392 + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 +dir=/usr/src/tools/uma/smrstress +mod=/boot/modules/smrstress.ko +[ -d $dir ] || exit 0 + +rm -f $mod +here=`pwd` +cd $dir +make all install + +(cd $here/../testcases/swap; ./swap -t 2m -i 20 -l 100) & +sleep 5 +kldload smrstress.ko +kldunload smrstress.ko +pkill swap +wait + +make clean +rm -f kldload.core $mod +exit 0 From owner-svn-src-user@freebsd.org Mon Feb 10 08:48:37 2020 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 7A7EF23283B for ; Mon, 10 Feb 2020 08:48:37 +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 48GKLs2d0bz49l7; Mon, 10 Feb 2020 08:48:37 +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 511571C7D0; Mon, 10 Feb 2020 08:48:37 +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 01A8mbLu054007; Mon, 10 Feb 2020 08:48:37 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01A8mbFK054006; Mon, 10 Feb 2020 08:48:37 GMT (envelope-from pho@FreeBSD.org) Message-Id: <202002100848.01A8mbFK054006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Mon, 10 Feb 2020 08:48:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r357718 - 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: 357718 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: Mon, 10 Feb 2020 08:48:37 -0000 Author: pho Date: Mon Feb 10 08:48:36 2020 New Revision: 357718 URL: https://svnweb.freebsd.org/changeset/base/357718 Log: Added missing "umount". Fix mistake of using run.sh instead of run. Modified: user/pho/stress2/misc/zfs9.sh Modified: user/pho/stress2/misc/zfs9.sh ============================================================================== --- user/pho/stress2/misc/zfs9.sh Mon Feb 10 08:46:38 2020 (r357717) +++ user/pho/stress2/misc/zfs9.sh Mon Feb 10 08:48:36 2020 (r357718) @@ -62,8 +62,9 @@ export LOAD=70 export TESTPROGS=`cd ..; find testcases/ -perm -1 -type f | \ egrep -v "/run/"` -(cd ..; ./run.sh $TESTPROGS) +(cd ..; ./testcases/run/run $TESTPROGS) +zfs umount stress2_tank/test zfs destroy -r stress2_tank zpool destroy stress2_tank From owner-svn-src-user@freebsd.org Mon Feb 10 08:50:44 2020 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 835E023289F for ; Mon, 10 Feb 2020 08:50:44 +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 48GKPJ2ycGz49w0; Mon, 10 Feb 2020 08:50:44 +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 60D451C7E9; Mon, 10 Feb 2020 08:50:44 +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 01A8oicZ054187; Mon, 10 Feb 2020 08:50:44 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01A8oiim054186; Mon, 10 Feb 2020 08:50:44 GMT (envelope-from pho@FreeBSD.org) Message-Id: <202002100850.01A8oiim054186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Mon, 10 Feb 2020 08:50:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r357719 - 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: 357719 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: Mon, 10 Feb 2020 08:50:44 -0000 Author: pho Date: Mon Feb 10 08:50:43 2020 New Revision: 357719 URL: https://svnweb.freebsd.org/changeset/base/357719 Log: Added comment about problem found. If umount fails, do not loop forever. Returen fsck exit code. Modified: user/pho/stress2/misc/suj33.sh Modified: user/pho/stress2/misc/suj33.sh ============================================================================== --- user/pho/stress2/misc/suj33.sh Mon Feb 10 08:48:36 2020 (r357718) +++ user/pho/stress2/misc/suj33.sh Mon Feb 10 08:50:43 2020 (r357719) @@ -31,6 +31,10 @@ # Test "umount" of active file system # Triggers "fsync: giving up on dirty" with ease. +# umount -f fails with +# "softdep_waitidle: Failed to flush worklist for 0xfffff80308cea000" +# Fixed by r356763 + [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 . ../default.cfg @@ -50,11 +54,15 @@ su $testuser -c '(cd ..; ./run.sh disk.cfg)' > /dev/nu sleep 20 umount $mntpoint kill $! -../tools/killall.sh +../tools/killall.sh || exit wait -while mount | grep -q "$mntpoint "; do - umount $mntpoint || sleep 1 +for i in `jot 6`; do + mount | grep -q "on $mntpoint " || break + umount $mntpoint && break || sleep 10 + [ $i -eq 6 ] && + { echo FAIL; fstat -mf $mntpoint; exit 1; } done -checkfs /dev/md${mdstart}$part +checkfs /dev/md${mdstart}$part; s=$? mdconfig -d -u $mdstart +exit $s From owner-svn-src-user@freebsd.org Mon Feb 10 08:55:12 2020 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 4CBEC232ADC for ; Mon, 10 Feb 2020 08:55:12 +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 48GKVS1Httz4BL7; Mon, 10 Feb 2020 08:55:12 +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 27A921C9CE; Mon, 10 Feb 2020 08:55:12 +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 01A8tC4V060314; Mon, 10 Feb 2020 08:55:12 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01A8tC08060313; Mon, 10 Feb 2020 08:55:12 GMT (envelope-from pho@FreeBSD.org) Message-Id: <202002100855.01A8tC08060313@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Mon, 10 Feb 2020 08:55:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r357720 - 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: 357720 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: Mon, 10 Feb 2020 08:55:12 -0000 Author: pho Date: Mon Feb 10 08:55:11 2020 New Revision: 357720 URL: https://svnweb.freebsd.org/changeset/base/357720 Log: Added a regression test. Added: user/pho/stress2/misc/mlockall6.sh (contents, props changed) Added: user/pho/stress2/misc/mlockall6.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/mlockall6.sh Mon Feb 10 08:55:11 2020 (r357720) @@ -0,0 +1,205 @@ +#!/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: Lock (rw) vm object not locked @ vm/vm_page.c:1013" seen: +# https://people.freebsd.org/~pho/stress/log/mlockall6-2.txt + +. ../default.cfg + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 +[ `swapinfo | wc -l` -eq 1 ] && exit 0 + +dir=/tmp +odir=`pwd` +cd $dir +sed '1,/^EOF/d' < $odir/$0 > $dir/mlockall6.c +mycc -o mlockall6 -Wall -Wextra -O0 -g mlockall6.c || exit 1 +rm -f mlockall6.c +cd $odir + +mount | grep "on $mntpoint " | grep -q /dev/md && umount -f $mntpoint +mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart +mdconfig -a -t swap -s 512m -u $mdstart || exit 1 +bsdlabel -w md$mdstart auto +newfs $newfs_flags -n md${mdstart}$part > /dev/null +mount /dev/md${mdstart}$part $mntpoint || exit 1 + +daemon sh -c "(cd $odir/../testcases/swap; ./swap -t 20m -i 20 -l 100)" \ + > /dev/null 2>&1 +sleep 2 + +(cd $mntpoint; /tmp/mlockall6 || echo FAIL) + +while pgrep -q swap; do + pkill -9 swap +done + +n=0 +while mount | grep "on $mntpoint " | grep -q /dev/md; do + umount $mntpoint || sleep 1 + n=$((n + 1)) + [ $n -gt 10 ] && { echo FAIL; exit 1; } +done +mdconfig -d -u $mdstart +rm -rf /tmp/mlockall6 +exit 0 + +EOF +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#define LOOPS 2 +#define PARALLEL 8 +#define R0 0 +#define R1 1 +#define R2 2 +#define RUNTIME (10 * 60) + +static volatile u_int *share; +static int ps; +static char c[32 * 1024 * 1024]; + +static void +touch(void) +{ + int i; + + for (i = 0; i < (int)sizeof(c); i += ps) + c[i] = 1; +} + +static void +test2(void) +{ + pid_t pid; + volatile u_int *share2; + size_t len; + int i, status; + + len = ps; + if ((share2 = mmap(NULL, len, PROT_READ | PROT_WRITE, + MAP_ANON | MAP_SHARED, -1, 0)) == MAP_FAILED) + err(1, "mmap"); + touch(); + usleep(arc4random() % 100000); + alarm(600); + if ((pid = fork()) == 0) { + alarm(600); + while (share2[R1] == 0) /* Wait for parent */ + ; + atomic_add_int(&share2[R1], 1); + if (arc4random() % 100 < 50) + usleep(arc4random() % 1000); + if (mlockall(MCL_CURRENT | MCL_FUTURE) == -1) + err(1, "mlock"); + touch(); + atomic_add_int(&share2[R2], 1); + _exit(0); + } + atomic_add_int(&share2[R1], 1); + while (share2[R1] != 2) /* Wait for child */ + ; + + for (i = 0; i < 100000 && share2[R2] == 0; i++) + touch(); /* while child is running */ + + if (waitpid(pid, &status, 0) == -1) + err(1, "wait"); + + if (status != 0) + fprintf(stderr, "Got signal %d\n", WTERMSIG(status)); + _exit(WTERMSIG(status)); +} + +static void +test(void) +{ + pid_t pid; + int i, s, status; + + while (share[R0] == 0) + ; + s = 0; + for (i = 0; i < LOOPS; i++) { + if ((pid = fork()) == 0) + test2(); + waitpid(pid, &status, 0); + s = (s == 0) ? status : s; + } + _exit(s); +} + +int +main(void) +{ + pid_t pid; + size_t len; + time_t start; + int i, s, status; + + ps = getpagesize(); + len = ps; + if ((share = mmap(NULL, len, PROT_READ | PROT_WRITE, + MAP_ANON | MAP_SHARED, -1, 0)) == MAP_FAILED) + err(1, "mmap"); + start = time(NULL); + s = 0; + while (s == 0 && (time(NULL) - start) < RUNTIME) { + for (i = 0; i < PARALLEL; i++) { + if ((pid = fork()) == 0) + test(); + } + atomic_add_int(&share[R0], 1); /* Start test() runs */ + for (i = 0; i < PARALLEL; i++) { + waitpid(pid, &status, 0); + if (status != 0) { + fprintf(stderr, "FAIL: status = %d\n", + status); + } + s = (s == 0) ? status : s; + } + atomic_add_int(&share[R0], -1); + } + + return (s); +} From owner-svn-src-user@freebsd.org Mon Feb 10 08:55:46 2020 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 94572232AFE for ; Mon, 10 Feb 2020 08:55:46 +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 48GKW63Rmpz4BQN; Mon, 10 Feb 2020 08:55:46 +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 7125B1C9CF; Mon, 10 Feb 2020 08:55: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 01A8tkaT060379; Mon, 10 Feb 2020 08:55:46 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01A8tkKk060378; Mon, 10 Feb 2020 08:55:46 GMT (envelope-from pho@FreeBSD.org) Message-Id: <202002100855.01A8tkKk060378@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Mon, 10 Feb 2020 08:55:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r357721 - 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: 357721 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: Mon, 10 Feb 2020 08:55:46 -0000 Author: pho Date: Mon Feb 10 08:55:45 2020 New Revision: 357721 URL: https://svnweb.freebsd.org/changeset/base/357721 Log: Limit run time. Modified: user/pho/stress2/misc/snap5.sh Modified: user/pho/stress2/misc/snap5.sh ============================================================================== --- user/pho/stress2/misc/snap5.sh Mon Feb 10 08:55:11 2020 (r357720) +++ user/pho/stress2/misc/snap5.sh Mon Feb 10 08:55:45 2020 (r357721) @@ -41,7 +41,7 @@ rm -f /tmp/.snap/stress2 trap "rm -f /tmp/.snap/stress2" 0 start=`date '+%s'` -while [ `date '+%s'` -lt $((start + 1800)) ]; do +while [ `date '+%s'` -lt $((start + 1200)) ]; do date '+%T' mksnap_ffs /tmp /tmp/.snap/stress2 mdconfig -a -t vnode -f /tmp/.snap/stress2 -u $mdstart -o readonly From owner-svn-src-user@freebsd.org Mon Feb 10 08:56:30 2020 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 7658F232B27 for ; Mon, 10 Feb 2020 08:56:30 +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 48GKWy2NYcz4BVt; Mon, 10 Feb 2020 08:56:30 +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 4CEF21C9D0; Mon, 10 Feb 2020 08:56:30 +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 01A8uUk4060457; Mon, 10 Feb 2020 08:56:30 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01A8uURe060456; Mon, 10 Feb 2020 08:56:30 GMT (envelope-from pho@FreeBSD.org) Message-Id: <202002100856.01A8uURe060456@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Mon, 10 Feb 2020 08:56:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r357722 - 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: 357722 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: Mon, 10 Feb 2020 08:56:30 -0000 Author: pho Date: Mon Feb 10 08:56:29 2020 New Revision: 357722 URL: https://svnweb.freebsd.org/changeset/base/357722 Log: Added comment about problem found. Cap run time. Modified: user/pho/stress2/misc/snap4.sh Modified: user/pho/stress2/misc/snap4.sh ============================================================================== --- user/pho/stress2/misc/snap4.sh Mon Feb 10 08:55:45 2020 (r357721) +++ user/pho/stress2/misc/snap4.sh Mon Feb 10 08:56:29 2020 (r357722) @@ -30,8 +30,11 @@ [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 -# Test with snapshot file unlinked before unmount +# Test with snapshot file unlinked before unmount. +# "panic: snapacct_ufs2: bad block" seen: +# https://people.freebsd.org/~pho/stress/log/snap4.txt + . ../default.cfg mount | grep -q "on /tmp (ufs," || exit 0 @@ -41,7 +44,7 @@ rm -f /tmp/.snap/stress2 trap "rm -f /tmp/.snap/stress2" 0 start=`date '+%s'` -while [ `date '+%s'` -lt $((start + 1800)) ]; do +while [ `date '+%s'` -lt $((start + 1200)) ]; do mksnap_ffs /tmp /tmp/.snap/stress2 mdconfig -a -t vnode -f /tmp/.snap/stress2 -u $mdstart -o readonly mount -o ro /dev/md$mdstart $mntpoint From owner-svn-src-user@freebsd.org Mon Feb 10 09:01:55 2020 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 92CCF232EB9 for ; Mon, 10 Feb 2020 09:01:55 +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 48GKfC3PPqz4Bq3; Mon, 10 Feb 2020 09:01:55 +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 6FF7F1CB74; Mon, 10 Feb 2020 09:01:55 +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 01A91tnr064007; Mon, 10 Feb 2020 09:01:55 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01A91tcj064005; Mon, 10 Feb 2020 09:01:55 GMT (envelope-from pho@FreeBSD.org) Message-Id: <202002100901.01A91tcj064005@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Mon, 10 Feb 2020 09:01:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r357723 - 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: 357723 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: Mon, 10 Feb 2020 09:01:55 -0000 Author: pho Date: Mon Feb 10 09:01:54 2020 New Revision: 357723 URL: https://svnweb.freebsd.org/changeset/base/357723 Log: Cap run time. Fix parameter type for getdirentries(). Modified: user/pho/stress2/misc/namecache.sh user/pho/stress2/misc/namecache2.sh Modified: user/pho/stress2/misc/namecache.sh ============================================================================== --- user/pho/stress2/misc/namecache.sh Mon Feb 10 08:56:29 2020 (r357722) +++ user/pho/stress2/misc/namecache.sh Mon Feb 10 09:01:54 2020 (r357723) @@ -83,7 +83,7 @@ for i in `jot 30`; do for j in `jot 10`; do wait done - [ $((`date '+%s'` - start)) -gt 1800 ] && break + [ $((`date '+%s'` - start)) -gt 1200 ] && break done if ls -l $dir/file.0* 2>&1 | egrep "file.0[0-9]" | grep -q "No such file"; then @@ -122,7 +122,7 @@ pm(void) int fd, n; int space = sizeof(buf); struct stat statb; - long base; + off_t base; struct dirent *dp; char *bp = buf; Modified: user/pho/stress2/misc/namecache2.sh ============================================================================== --- user/pho/stress2/misc/namecache2.sh Mon Feb 10 08:56:29 2020 (r357722) +++ user/pho/stress2/misc/namecache2.sh Mon Feb 10 09:01:54 2020 (r357723) @@ -183,7 +183,7 @@ main(void) nanosleep(&period, 0); return 0; } - if (time(NULL) - start > 1800) { + if (time(NULL) - start > 1200) { fprintf(stderr, "Test timed out.\n"); break; } From owner-svn-src-user@freebsd.org Mon Feb 10 09:09:57 2020 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 D8512233203 for ; Mon, 10 Feb 2020 09:09:57 +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 48GKqT5Ss6z4CFP; Mon, 10 Feb 2020 09:09:57 +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 B6E481CBB9; Mon, 10 Feb 2020 09:09:57 +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 01A99vPV066513; Mon, 10 Feb 2020 09:09:57 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01A99v8x066512; Mon, 10 Feb 2020 09:09:57 GMT (envelope-from pho@FreeBSD.org) Message-Id: <202002100909.01A99v8x066512@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Mon, 10 Feb 2020 09:09:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r357724 - 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: 357724 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: Mon, 10 Feb 2020 09:09:57 -0000 Author: pho Date: Mon Feb 10 09:09:57 2020 New Revision: 357724 URL: https://svnweb.freebsd.org/changeset/base/357724 Log: Added timeout(1) to this test. Modified: user/pho/stress2/misc/sem_wait.sh Modified: user/pho/stress2/misc/sem_wait.sh ============================================================================== --- user/pho/stress2/misc/sem_wait.sh Mon Feb 10 09:01:54 2020 (r357723) +++ user/pho/stress2/misc/sem_wait.sh Mon Feb 10 09:09:57 2020 (r357724) @@ -56,6 +56,8 @@ static sem_t *semaphore; static void * test(void) { + setproctitle("%s", __func__); + alarm(300); for (;;) { if (sem_wait(semaphore) == -1) err(1, "sem_wait"); @@ -70,6 +72,8 @@ main(void) { size_t len; time_t start; + setproctitle("%s", __func__); + alarm(300); len = PAGE_SIZE; if ((semaphore = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_ANON | MAP_SHARED, -1, 0)) == MAP_FAILED) @@ -101,6 +105,7 @@ main(void) { } EOF mycc -o /tmp/sem_wait -Wall -Wextra -O2 /tmp/sem_wait.c || exit 1 -/tmp/sem_wait; s=$? +timeout 6m /tmp/sem_wait; s=$? +[ $s -eq 124 ] && echo "Timed out" rm -f /tmp/sem_wait /tmp/sem_wait.c exit $s From owner-svn-src-user@freebsd.org Mon Feb 10 09:11:11 2020 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 7801E23323A for ; Mon, 10 Feb 2020 09:11:11 +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 48GKrv2crMz4CNN; Mon, 10 Feb 2020 09:11:11 +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 552D41CBFF; Mon, 10 Feb 2020 09:11:11 +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 01A9BBbK069664; Mon, 10 Feb 2020 09:11:11 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01A9BBop069663; Mon, 10 Feb 2020 09:11:11 GMT (envelope-from pho@FreeBSD.org) Message-Id: <202002100911.01A9BBop069663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Mon, 10 Feb 2020 09:11:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r357725 - 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: 357725 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: Mon, 10 Feb 2020 09:11:11 -0000 Author: pho Date: Mon Feb 10 09:11:10 2020 New Revision: 357725 URL: https://svnweb.freebsd.org/changeset/base/357725 Log: Fix naming of helper file. Modified: user/pho/stress2/misc/crossmp4.sh Modified: user/pho/stress2/misc/crossmp4.sh ============================================================================== --- user/pho/stress2/misc/crossmp4.sh Mon Feb 10 09:09:57 2020 (r357724) +++ user/pho/stress2/misc/crossmp4.sh Mon Feb 10 09:11:10 2020 (r357725) @@ -46,6 +46,7 @@ usermem=`sysctl -n hw.usermem` [ `swapinfo | wc -l` -eq 1 ] && usermem=$((usermem/100*80)) size=$((usermem / 1024 / 1024)) +CONT=/tmp/crossmp4.continue mounts=$N # Number of parallel scripts if [ $# -eq 0 ]; then @@ -72,9 +73,9 @@ if [ $# -eq 0 ]; then mdconfig -d -u $mdstart exit 0 else - touch /tmp/crossmp.continue + touch $CONT if [ $1 = find ]; then - while [ -f /tmp/crossmp.continue ]; do + while [ -f $CONT ]; do find ${mntpoint}* -type f > /dev/null 2>&1 done else @@ -103,6 +104,6 @@ else done wait done - rm -f /tmp/crossmp.continue + rm -f $CONT fi fi From owner-svn-src-user@freebsd.org Mon Feb 10 16:14:08 2020 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 7AC1223D8D0 for ; Mon, 10 Feb 2020 16:14:08 +0000 (UTC) (envelope-from uqs@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 48GWDw2gL8z4f5L; Mon, 10 Feb 2020 16:14:08 +0000 (UTC) (envelope-from uqs@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 56E6921B4C; Mon, 10 Feb 2020 16:14:08 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 01AGE8RE022680; Mon, 10 Feb 2020 16:14:08 GMT (envelope-from uqs@FreeBSD.org) Received: (from uqs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01AGE87e022679; Mon, 10 Feb 2020 16:14:08 GMT (envelope-from uqs@FreeBSD.org) Message-Id: <202002101614.01AGE87e022679@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: uqs set sender to uqs@FreeBSD.org using -f From: Ulrich Spoerlein Date: Mon, 10 Feb 2020 16:14:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r357731 - user/uqs/coverity X-SVN-Group: user X-SVN-Commit-Author: uqs X-SVN-Commit-Paths: user/uqs/coverity X-SVN-Commit-Revision: 357731 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: Mon, 10 Feb 2020 16:14:08 -0000 Author: uqs Date: Mon Feb 10 16:14:07 2020 New Revision: 357731 URL: https://svnweb.freebsd.org/changeset/base/357731 Log: Add the Coverity modeling file for posterity. Added: user/uqs/coverity/ user/uqs/coverity/model.c (contents, props changed) Added: user/uqs/coverity/model.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/uqs/coverity/model.c Mon Feb 10 16:14:07 2020 (r357731) @@ -0,0 +1,35 @@ +/* + * This is a model as used by our Coverity Scan systems. It was also in use + * back when we were on Coverity Prevent. + * + * https://scan.coverity.com/projects/freebsd/model_file + * upload it via https://scan.coverity.com/projects/freebsd?tab=analysis_settings + */ + +/* From . */ +#define M_WAITOK 0x0002 + +/* + * If M_WAIT_OK is set, malloc() will always return something meaningful. + */ +void * +malloc(unsigned long size, struct malloc_type *mtp, int flags) +{ + int has_memory; + + __coverity_negative_sink__(size); + + if (flags & M_WAITOK || has_memory) + return __coverity_alloc__(size); + + return 0; +} + +/* + * Don't complain about leaking FDs in unit tests. + */ +static void +leak(int fd) +{ + __coverity_close__(fd); +} From owner-svn-src-user@freebsd.org Mon Feb 10 16:15:35 2020 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 6A44E23D912 for ; Mon, 10 Feb 2020 16:15:35 +0000 (UTC) (envelope-from uqs@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 48GWGb21c8z4f9q; Mon, 10 Feb 2020 16:15:35 +0000 (UTC) (envelope-from uqs@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 4007921B4D; Mon, 10 Feb 2020 16:15:35 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 01AGFZgj022802; Mon, 10 Feb 2020 16:15:35 GMT (envelope-from uqs@FreeBSD.org) Received: (from uqs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01AGFZna022801; Mon, 10 Feb 2020 16:15:35 GMT (envelope-from uqs@FreeBSD.org) Message-Id: <202002101615.01AGFZna022801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: uqs set sender to uqs@FreeBSD.org using -f From: Ulrich Spoerlein Date: Mon, 10 Feb 2020 16:15:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r357732 - user/uqs/coverity X-SVN-Group: user X-SVN-Commit-Author: uqs X-SVN-Commit-Paths: user/uqs/coverity X-SVN-Commit-Revision: 357732 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: Mon, 10 Feb 2020 16:15:35 -0000 Author: uqs Date: Mon Feb 10 16:15:34 2020 New Revision: 357732 URL: https://svnweb.freebsd.org/changeset/base/357732 Log: ... and delete the model, because we currently no longer use it. Coverity apparently got smarter over time and will produce fewer false positives around kernel malloc when this model is *not* in use. Modified: user/uqs/coverity/model.c Modified: user/uqs/coverity/model.c ============================================================================== --- user/uqs/coverity/model.c Mon Feb 10 16:14:07 2020 (r357731) +++ user/uqs/coverity/model.c Mon Feb 10 16:15:34 2020 (r357732) @@ -6,30 +6,5 @@ * upload it via https://scan.coverity.com/projects/freebsd?tab=analysis_settings */ -/* From . */ -#define M_WAITOK 0x0002 -/* - * If M_WAIT_OK is set, malloc() will always return something meaningful. - */ -void * -malloc(unsigned long size, struct malloc_type *mtp, int flags) -{ - int has_memory; - - __coverity_negative_sink__(size); - - if (flags & M_WAITOK || has_memory) - return __coverity_alloc__(size); - - return 0; -} - -/* - * Don't complain about leaking FDs in unit tests. - */ -static void -leak(int fd) -{ - __coverity_close__(fd); -} +// Currently no special model is in use.