svn commit: r282946 - user/pho/stress2/misc
Peter Holm
pho at FreeBSD.org
Fri May 15 08:29:25 UTC 2015
Author: pho
Date: Fri May 15 08:29:24 2015
New Revision: 282946
URL: https://svnweb.freebsd.org/changeset/base/282946
Log:
Added description of two out of *many* problems found by this
scenario, use pgrep(1), added en extra search directory to fts(2)
and added the possibility to run the test as root.
Sponsored by: EMC / Isilon storage division
Modified:
user/pho/stress2/misc/syscall4.sh
Modified: user/pho/stress2/misc/syscall4.sh
==============================================================================
--- user/pho/stress2/misc/syscall4.sh Fri May 15 07:57:47 2015 (r282945)
+++ user/pho/stress2/misc/syscall4.sh Fri May 15 08:29:24 2015 (r282946)
@@ -31,6 +31,15 @@
# Threaded syscall(2) fuzz test inspired by the iknowthis test suite
# by Tavis Ormandy <taviso cmpxchg8b com>
+# Sample problems found:
+# Thread stuck in stopprof.
+# http://people.freebsd.org/~pho/stress/log/kostik732.txt
+# Fixed by r275121.
+
+# panic: td 0xcbe1ac40 is not suspended.
+# https://people.freebsd.org/~pho/stress/log/kostik807.txt
+# Fixed by r282944.
+
[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1
. ../default.cfg
@@ -64,7 +73,8 @@ while [ $((`date '+%s'` - st)) -lt $((10
(cd $mntpoint; /tmp/syscall4 $* ) &
start=`date '+%s'`
while [ $((`date '+%s'` - start)) -lt $sleeptime ]; do
- ps aux | grep -v grep | egrep -q "syscall4$" || break
+# ps aux | grep -v grep | egrep -q "syscall4$" || break
+ pgrep syscall4 > /dev/null || break
sleep .5
done
while pkill -9 syscall4; do
@@ -192,15 +202,16 @@ test(void *arg __unused)
FTS *fts;
FTSENT *p;
int ftsoptions;
- char *args[5];
+ char *args[6];
int i;
ftsoptions = FTS_PHYSICAL;
args[0] = "/dev";
args[1] = "/proc";
args[2] = "/usr/compat/linux/proc";
- args[3] = ".";
- args[4] = 0;
+ args[3] = "/ifs";
+ args[4] = ".";
+ args[5] = 0;
for (;;) {
for (i = 0; i < N; i++)
@@ -290,11 +301,15 @@ main(int argc, char **argv)
if ((pw = getpwnam("nobody")) == NULL)
err(1, "no such user: nobody");
- if (setgroups(1, &pw->pw_gid) ||
- setegid(pw->pw_gid) || setgid(pw->pw_gid) ||
- seteuid(pw->pw_uid) || setuid(pw->pw_uid))
- err(1, "Can't drop privileges to \"nobody\"");
- endpwent();
+ if (getenv("USE_ROOT"))
+ fprintf(stderr, "Running syscall4 as root.\n");
+ else {
+ if (setgroups(1, &pw->pw_gid) ||
+ setegid(pw->pw_gid) || setgid(pw->pw_gid) ||
+ seteuid(pw->pw_uid) || setuid(pw->pw_uid))
+ err(1, "Can't drop privileges to \"nobody\"");
+ endpwent();
+ }
limit.rlim_cur = limit.rlim_max = 1000;
#if defined(RLIMIT_NPTS)
More information about the svn-src-user
mailing list