From owner-freebsd-bugs Sun May 7 1:10:13 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id A66B037B865 for ; Sun, 7 May 2000 01:10:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id BAA64549; Sun, 7 May 2000 01:10:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from vast1.dev.skycache.com (ll-nat1.skycache.com [207.239.230.245]) by hub.freebsd.org (Postfix) with ESMTP id 3D31A37B79B for ; Fri, 5 May 2000 13:39:30 -0700 (PDT) (envelope-from toor@vast1.dev.skycache.com) Received: (from root@localhost) by vast1.dev.skycache.com (8.9.3/8.9.3) id QAA00410; Fri, 5 May 2000 16:39:28 -0400 (EDT) (envelope-from toor) Message-Id: <200005052039.QAA00410@vast1.dev.skycache.com> Date: Fri, 5 May 2000 16:39:28 -0400 (EDT) From: mdiclaud@cidera.com Reply-To: mdiclaud@cidera.com To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: kern/18402: panic in aio_process Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 18402 >Category: kern >Synopsis: panic in aio_process >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun May 07 01:10:02 PDT 2000 >Closed-Date: >Last-Modified: >Originator: Mike DiClaudio >Release: FreeBSD 3.4-RELEASE i386 >Organization: Cidera, Inc >Environment: * all sysctl values relating to AIO are untouched * uname -a >> FreeBSD vast1.dev.skycache.com 3.4-RELEASE FreeBSD 3.4-RELEASE #2: Mon Apr 3 14:52:24 EDT 2000 toor@flash.skycache.com:/usr/src/sys/compile/VAST_DEBUG i386 >Description: the system panics with fatal trap 12 in aio_process when the file is close(2)'ed and there are outstanding aio requests. >How-To-Repeat: the problem occurred in a program i'm developing and the aio is mixed in with lots of other stuff. this code-like sample illustrates what i'm doing which is causing the problem. the code is zeroing the disk. if you need the exact code, let me now struct aiocb x[100]; int outstanding[100]; open(/dev/rda0) for(i=0;i<100;i++) { /* setup x[ i ] values */ aio_write(&x[i]); outstanding[i]=1; } close(/dev/rda0); /* bad thing to do here */ while( requests outstanding ) for(i=0;i<100;i++) { if( aio_error(&x[i]) == EINPROGRESS ) continue; if( outstanding[i] ) { aio_return(&x[i]); outstanding[i]=0; /* setup array for aio_suspend */ } } aio_suspend(); } exit(); >Fix: it works fine if close is called after the loop that is doing the aio_error and aio_return calls, which is where it belongs to begin with. >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message