From owner-freebsd-stable Thu Mar 4 2:49:10 1999 Delivered-To: freebsd-stable@freebsd.org Received: from mailhost.stack.nl (terra.stack.nl [131.155.140.128]) by hub.freebsd.org (Postfix) with ESMTP id 572EB150D0 for ; Thu, 4 Mar 1999 02:49:07 -0800 (PST) (envelope-from marcolz@stack.nl) Received: from toad.stack.nl (toad.stack.nl [131.155.140.135]) by mailhost.stack.nl (Postfix) with ESMTP id 5012D3049 for ; Thu, 4 Mar 1999 11:48:47 +0100 (MET) Received: by toad.stack.nl (Postfix, from userid 333) id 1260B9672; Thu, 4 Mar 1999 11:48:48 +0100 (CET) Date: Thu, 4 Mar 1999 11:48:47 +0100 From: Marc Olzheim To: freebsd-stable@FreeBSD.ORG Subject: DOS with ktrace Message-ID: <19990304114847.A1201@stack.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.3i X-Operating-System: FreeBSD toad.stack.nl 2.2.8-STABLE FreeBSD 2.2.8-STABLE X-URL: http://www.stack.nl/~marcolz/ Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi. When ktracing the following prog, FreeBSD 2.2.8 sometimes produces a deadlock situation. #include #include #include #include #include #include extern int main (int argc, char **argv) { char buffer[1000000]; int result; if (fcntl(1, F_SETFL, O_NONBLOCK)) err(1, "fcntl(1, F_SETFL, O_NONBLOCK)"); bzero(buffer, sizeof(buffer)); strcpy(buffer, "hoihoihoihoihoi!"); for (;;) { result = write(1, buffer, sizeof(buffer)); if (result == -1) warn("write(1, buffer, %d)", sizeof(buffer)); else if (result == 0) errx(1, "result == 0"); else if (result != sizeof(buffer)) errx(1, "result == %d", result); } argc = 0; argv = NULL; return 0; } Just compile it and run it as: ktrace -t cnsw ./testwrite > /tmp/foo Then suspend it with ^Z Any process trying to do filesystem-io will wait in locks. On a busy machine it will soon run out of resources. This does not happen 100% of the time, but it's very well reproducable, just try one or two times. I have no FreeBSD 3 boxes here yet to test it on, so I don't know wether it's affected or not, but it does affect 2.2.6 (i.e. non-CAM). Marc To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message